summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-07-29 01:21:53 +0200
committerAraq <rumpf_a@web.de>2013-07-29 01:21:53 +0200
commitd6d665b0c0b487a87595b99630f4d0916e3d8ccb (patch)
treed24c18e01cd2482bebe10391009ac3bf05d175dc
parentef975d277a368ba9d9b85451bb0b054c87d5d782 (diff)
parentc5c6ef6e2beb187e4d1e1c4b67a14b67a291e6f9 (diff)
downloadNim-d6d665b0c0b487a87595b99630f4d0916e3d8ccb.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
-rw-r--r--lib/impure/graphics.nim5
-rw-r--r--lib/wrappers/sdl/sdl.nim3
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/impure/graphics.nim b/lib/impure/graphics.nim
index f9aadf995..85eeaed42 100644
--- a/lib/impure/graphics.nim
+++ b/lib/impure/graphics.nim
@@ -360,7 +360,7 @@ proc drawEllipse*(sur: PSurface, CX, CY, XRadius, YRadius: Natural,
   ## of the ellipse.
   var 
     X, Y: Natural
-    XChange, YChange: Natural
+    XChange, YChange: Int
     EllipseError: Natural
     TwoASquare, TwoBSquare: Natural
     StoppingX, StoppingY: Natural
@@ -501,6 +501,7 @@ if sdl_ttf.Init() < 0: raiseEGraphics()
 
 when isMainModule:
   var surf = newScreenSurface(800, 600)
+
   surf.fillSurface(colWhite)
 
   # Draw the shapes
@@ -545,6 +546,8 @@ when isMainModule:
       if evk.keysym.sym == SDL.K_LEFT:
         surf.drawHorLine(395, 300, 50, colBlack)
         echo("Drawing")
+      elif evk.keysym.sym == SDL.K_ESCAPE:
+        break
       else:
         echo(evk.keysym.sym)
     of SDL.MOUSEBUTTONDOWN:
diff --git a/lib/wrappers/sdl/sdl.nim b/lib/wrappers/sdl/sdl.nim
index 1d43ca556..1c88bc14e 100644
--- a/lib/wrappers/sdl/sdl.nim
+++ b/lib/wrappers/sdl/sdl.nim
@@ -270,6 +270,7 @@
 #
 
 {.deadCodeElim: on.}
+import unsigned
 when defined(windows): 
   const 
     LibName = "SDL.dll"
@@ -1807,7 +1808,7 @@ proc ListModes*(format: PPixelFormat, flags: int32): PPSDL_Rect{.cdecl,
   #  applications that redraw the entire screen on every update.
   #
   #  This function returns the video framebuffer surface, or NULL if it fails.
-proc SetVideoMode*(width, height, bpp: int, flags: int32): PSurface{.cdecl, 
+proc SetVideoMode*(width, height, bpp: int, flags: uint32): PSurface{.cdecl, 
     importc: "SDL_SetVideoMode", dynlib: LibName.}
   # Makes sure the given list of rectangles is updated on the given screen.
   #  If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire