Merge branch 'master' of github.com:Araq/Nimrod
This commit is contained in:
commit
d6d665b0c0
2 changed files with 6 additions and 2 deletions
|
|
@ -360,7 +360,7 @@ proc drawEllipse*(sur: PSurface, CX, CY, XRadius, YRadius: Natural,
|
||||||
## of the ellipse.
|
## of the ellipse.
|
||||||
var
|
var
|
||||||
X, Y: Natural
|
X, Y: Natural
|
||||||
XChange, YChange: Natural
|
XChange, YChange: Int
|
||||||
EllipseError: Natural
|
EllipseError: Natural
|
||||||
TwoASquare, TwoBSquare: Natural
|
TwoASquare, TwoBSquare: Natural
|
||||||
StoppingX, StoppingY: Natural
|
StoppingX, StoppingY: Natural
|
||||||
|
|
@ -501,6 +501,7 @@ if sdl_ttf.Init() < 0: raiseEGraphics()
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
var surf = newScreenSurface(800, 600)
|
var surf = newScreenSurface(800, 600)
|
||||||
|
|
||||||
surf.fillSurface(colWhite)
|
surf.fillSurface(colWhite)
|
||||||
|
|
||||||
# Draw the shapes
|
# Draw the shapes
|
||||||
|
|
@ -545,6 +546,8 @@ when isMainModule:
|
||||||
if evk.keysym.sym == SDL.K_LEFT:
|
if evk.keysym.sym == SDL.K_LEFT:
|
||||||
surf.drawHorLine(395, 300, 50, colBlack)
|
surf.drawHorLine(395, 300, 50, colBlack)
|
||||||
echo("Drawing")
|
echo("Drawing")
|
||||||
|
elif evk.keysym.sym == SDL.K_ESCAPE:
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
echo(evk.keysym.sym)
|
echo(evk.keysym.sym)
|
||||||
of SDL.MOUSEBUTTONDOWN:
|
of SDL.MOUSEBUTTONDOWN:
|
||||||
|
|
|
||||||
|
|
@ -270,6 +270,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
{.deadCodeElim: on.}
|
{.deadCodeElim: on.}
|
||||||
|
import unsigned
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
const
|
const
|
||||||
LibName = "SDL.dll"
|
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.
|
# applications that redraw the entire screen on every update.
|
||||||
#
|
#
|
||||||
# This function returns the video framebuffer surface, or NULL if it fails.
|
# 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.}
|
importc: "SDL_SetVideoMode", dynlib: LibName.}
|
||||||
# Makes sure the given list of rectangles is updated on the given screen.
|
# 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
|
# If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue