summary refs log tree commit diff stats
path: root/examples/sdlex.nim
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sdlex.nim')
-rw-r--r--examples/sdlex.nim28
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/sdlex.nim b/examples/sdlex.nim
index 665affff8..3dd474d8e 100644
--- a/examples/sdlex.nim
+++ b/examples/sdlex.nim
@@ -9,21 +9,21 @@ var
   event: TEvent

   bgColor = colChocolate.int32

 

-if Init(INIT_VIDEO) != 0:

+if init(INIT_VIDEO) != 0:

   quit "SDL failed to initialize!"

 

-screen = SetVideoMode(640, 480, 16, SWSURFACE or ANYFORMAT)

+screen = setVideoMode(640, 480, 16, SWSURFACE or ANYFORMAT)

 if screen.isNil:

-  quit($sdl.GetError())

+  quit($sdl.getError())

 

-greeting = IMG_load("tux.png")

+greeting = imgLoad("tux.png")

 if greeting.isNil:

   echo "Failed to load tux.png"

 else:

   ## convert the image to alpha and free the old one

-  var s = greeting.DisplayFormatAlpha()

+  var s = greeting.displayFormatAlpha()

   swap(greeting, s)

-  s.FreeSurface()

+  s.freeSurface()

 

 r.x = 0

 r.y = 0

@@ -31,22 +31,22 @@ r.y = 0
 block game_loop:

   while true:

     

-    while PollEvent(addr event) > 0:

+    while pollEvent(addr event) > 0:

       case event.kind

       of QUITEV:

         break game_loop

       of KEYDOWN:

-        if EvKeyboard(addr event).keysym.sym == K_ESCAPE:

+        if evKeyboard(addr event).keysym.sym == K_ESCAPE:

           break game_loop

       else:

         discard

     

-    discard FillRect(screen, nil, bgColor) 

-    discard BlitSurface(greeting, nil, screen, addr r)

-    discard Flip(screen)

+    discard fillRect(screen, nil, bgColor) 

+    discard blitSurface(greeting, nil, screen, addr r)

+    discard flip(screen)

 

-greeting.FreeSurface()

-screen.FreeSurface()

-sdl.Quit()

+greeting.freeSurface()

+screen.freeSurface()

+sdl.quit()

 

 ## fowl wuz here 10/2012
\ No newline at end of file