Final Platform Layer 0.9.8-beta
|
To initialize either software or hardware video output, you have to set the fplInitFlags_Video flag in the fplPlatformInit() call and ensure that video is not disabled by a preprocessor directive FPL_NO_VIDEO.
Also setting the fplInitFlags_Video flag ensures that the fplInitFlags_Window flag is appended automatically.
If you don't specify any settings then the video backend is automatically detected, depending on your operating system and supported hardware and software.
By default, this is most likely be legacy OpenGL - which is supported on almost every video card on any OS.
But this is not the recommended way to initialize video output, because you are responsible for handling any video output yourself.
It is recommended to set at least the video backend manually, to ensure that you get either initialized with that backend properly or an error when your configuration is not supported.
You do that by simply setting the fplVideoBackendType field in your fplVideoSettings structure which is included in the fplSettings structure to the fplPlatformInit() call.
If you want to enable/disable vertical synchronization you simply set the fplVideoSettings.isVSync field respectively.
To compile out certain video backends, you simply specify the FPL_NO_VIDEO_[Name of the video backend] preprocessor directive.
But the fplVideoBackendType in question is never removed from the enumeration - keep that in mind!
Example (Disable OpenGL video backend):
To compile out all video output code you define the FPL_NO_VIDEO preprocessor directive.
Backend types stored in the fplVideoBackendType enumeration are not filtered away, even when you disable it by a preprocessor directive!
Keep that in mind when you initialize the video backend.
If needed you can use fplSetDefaultVideoSettings() to fill in just the default video settings inside the fplVideoSettings structure.