Final Platform Layer 0.9.8-beta
|
To create a window, you add the fplInitFlags_Window flag to the fplInitFlags argument in the fplPlatformInit() call.
It makes no sense to create a window alone, so we combine it at least with something else, like for example a video context or audio playback.
After you initialize FPL with a window, you have to create some sort of a loop to keep the window open until you close them.
This is required because the operating systems use an event-based system to communicate with the window and your application.
If no communication happens with your window and your app, the window will no longer be responsive - so make sure to communicate properly.
To solve this, you have to use fplWindowUpdate() and fplPollEvent() respectively.
First, you need to call fplWindowUpdate() for every 'tick' for your application. This will clear the internal event queue and update input devices properly.
After that, you have to poll all events from the operating systems event queue using fplPollEvent() .
See Window events for more details.
Simply call fplWindowShutdown to shutdown the window, while it is still running.
You can also query the running state of the window by calling fplIsWindowRunning() .