Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/SDL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,18 @@ If you wish to use SDL's 2D graphics API, you can also create a 'Renderer':
renderer <- 'createRenderer' window (-1) 'defaultRenderer'
@

Finally, we enter our main application loop:
Then, we enter our main application loop:

@
appLoop renderer
@

Finally, once our appLoop has returned we destroy the 'Window' using 'destroyWindow':

@
'destroyWindow' window
@

For the body of your application, we enter a loop. Inside this loop you should begin by collecting all events that
have happened - these events will inform you about information such as key presses and mouse movement:

Expand Down Expand Up @@ -134,6 +140,7 @@ main = do
window <- 'createWindow' "My SDL Application" 'defaultWindow'
renderer <- 'createRenderer' window (-1) 'defaultRenderer'
appLoop renderer
destroyWindow window

appLoop :: 'Renderer' -> IO ()
appLoop renderer = do
Expand Down