mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03:00
Add deferred callbacks to game loop
Sometimes, there needs to be code that gets ran at the end of the game loop, otherwise rendering issues might occur. Currently, we do this by special-casing each deferred routine (e.g. shouldreturntoeditor), but it would be better if we could generalize this deference instead. Deferred callbacks can be added using the DEFER_CALLBACK macro. It takes in one argument, which is the name of a function, and that function must be a void function that takes in no arguments. Also, due to annoying C++ quirks, void functions taking no arguments cannot be attributes of objects (because they have an implicit `this` parameter), so it's recommended to create each callback separately before using the DEFER_CALLBACK macro.
This commit is contained in:
@@ -125,6 +125,7 @@ SET(VVV_SRC
|
||||
src/WarpClass.cpp
|
||||
src/XMLUtils.cpp
|
||||
src/main.cpp
|
||||
src/DeferCallbacks.c
|
||||
src/Network.c
|
||||
src/ThirdPartyDeps.c
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user