Final Platform Layer  0.9.6-beta
Modern OpenGL

Initialize a modern OpenGL Rendering Context

To initialize a modern OpenGL (3.0+) rendering context, you simply set the fplInitFlags_Video flag in the fplPlatformInit() call and change the video backend type to fplVideoBackendType_OpenGL and setup the following parameters:

fplSettings settings;
fplVideoSettings &videoSettings =;
// Forcing the video backend to be modern OpenGL with Core profile and for GL version 3.3 = 3; = 3;
// ... modern context is ready


Extensions loader

To use modern OpenGL, you need some sort of a OpenGL extension loader which gives you access to the constants and functions like glCreateProgram().
You can either use a third-party C/C++ Library for doing that for you or use/write your own OpenGL loader. FPL should work in both ways.

List of tested OpenGL loaders:

Presenting your frame

Call fplVideoFlip() to present the frame to the screen.
Its recommend to call this after each draw call of your frame at the end of the main-loop.

Multisample anti-aliasing (MSAA)

In a modern OpenGL context, you can activate multi-sampling-antialiasing (MSAA) to get smooth edges with few performance costs out-of-the-box.
By default, multisampling is disabled. To enable it, you simply set your desired multi-sampling count in fplOpenGLSettings::multiSamplingCount .

fplSettings settings;
fplVideoSettings &videoSettings =;
// Forcing the video backend to be modern OpenGL with Core profile and for GL version 3.3 = 3; = 3;
// Use 4x MSAA
videoSettings.opengl.multiSamplingCount = 4;
// ... modern context is ready


FPL does not provide any OpenGL types, prototypes, or functions - it's fully up to the caller how to handle this.
Keep in mind that FPL does not work with platform abstraction libraries like GLFW or GLUT, but GLEW for example will work just fine.

fplOpenGLCompabilityFlags compabilityFlags
Compability flags.
Definition: final_platform_layer.h:3478
A structure containing settings, such as window, video, etc.
Definition: final_platform_layer.h:3930
Definition: final_platform_layer.h:3452
fplVideoBackendType backend
video backend type
Definition: final_platform_layer.h:3565
fpl_common_api bool fplPlatformInit(const fplInitFlags initFlags, const fplSettings *initSettings)
Initializes the platform layer.
fplGraphicsApiSettings graphics
Graphics API settings.
Definition: final_platform_layer.h:3563
uint32_t majorVersion
Desired major version.
Definition: final_platform_layer.h:3480
fplVideoSettings video
Video settings.
Definition: final_platform_layer.h:3934
Use a video backbuffer (This flag ensures that fplInitFlags_Window is included always)
Definition: final_platform_layer.h:3384
Use core profile.
Definition: final_platform_layer.h:3468
A structure that contains video settings such as backend, v-sync, API-settings, etc.
Definition: final_platform_layer.h:3561
uint32_t minorVersion
Desired minor version.
Definition: final_platform_layer.h:3482
fplOpenGLSettings opengl
OpenGL settings.
Definition: final_platform_layer.h:3550
fpl_common_api void fplSetDefaultSettings(fplSettings *settings)
Resets the given settings container to default values for window, video, audio, etc.