Skip to content

Allow function pointers#3

Merged
gameblabla merged 2 commits into
gameblabla:sdl12_rs97from
mibus:allow-function-pointers
Mar 27, 2021
Merged

Allow function pointers#3
gameblabla merged 2 commits into
gameblabla:sdl12_rs97from
mibus:allow-function-pointers

Conversation

@mibus

@mibus mibus commented Mar 27, 2021

Copy link
Copy Markdown

Builds on #2

This is enough to get Picopolis to start up and work (at least for a few seconds of play, haven't done extensive testing).

mibus added 2 commits March 27, 2021 17:50
This necessitates plumbing through a callback function, so that SDL can be
called.

So as to not repeat ourselves, extract the code that was used around update()
calls, FPS handling, etc, and have a shared function.

While around, reshuffle some initialisation to be earlier, and make it so
there's not a 1/FPS gap before drawing a frame, but a 1/FPS gap _between_
frames (assuming non-zero time to calculate the next frame etc).
This is needed for e.g. Picopolis, which replaces _update() at different stages of the game.
@gameblabla gameblabla merged commit 901aca7 into gameblabla:sdl12_rs97 Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants