Simple template which creates an event loop. Event is the name of the variable containing the TEvent object.
If anyone can point to examples where this template (or graphics module usage in general exists) it would be greatly appreciated.
Background: I'm looking into learning the Nimrod language and, as a game developer, am doing it by creating a game. Please excuse my incredibly basic questions as I spin up on the language. The language is newer than I'm used to experimenting with, if I'm failing to grok something in the basic introduction feel free to just throw me back at that.
Thanks a lot, I'd just been browsing that module's source on GitHub and it's helped.
For anyone following in my footsteps:
https://github.com/Araq/Nimrod/blob/devel/lib/impure/graphics.nim
http://nimrod-lang.org/tut2.html#statement-macros
both helped. Basic code to throw up a window is:
import graphics, sdl
var surface: graphics.PSurface = newScreenSurface(640, 480)
withEvents(surface, event):
case event.kind
of sdl.QUITEV:
break
else: nil