Final Platform Layer 0.9.8-beta
No Matches
Legacy OpenGL

Initialize Legacy OpenGL

To initialize a legacy OpenGL (up to GL version 2.1) rendering context you simply set the fplInitFlags_Video flag in the fplPlatformInit() call and change the video backend type to fplVideoBackendType_OpenGL and set the fplOpenGLSettings::compabilityFlags to fplOpenGLCompabilityFlags_Legacy .

This will work in ~99% on all supported platforms - if not please post an issue for that platform/configuration/video-card ;-)

fplSettings settings;
fplVideoSettings &videoSettings =;
// Forcing the video backend to be legacy OpenGL
videoSettings.opengl.compabilityFlags = fplOpenGLCompabilityFlags_Legacy;
// ... your code here
fpl_common_api bool fplPlatformInit(const fplInitFlags initFlags, const fplSettings *initSettings)
Initializes the platform layer.
fpl_common_api void fplSetDefaultSettings(fplSettings *settings)
Resets the given settings container to default values for window, video, audio, etc.
@ fplInitFlags_Video
Use a video backbuffer (This flag ensures that fplInitFlags_Window is included always)
@ fplOpenGLCompabilityFlags_Legacy
Use legacy context.
@ fplVideoBackendType_OpenGL
A structure containing settings, such as window, video, etc.
fplVideoSettings video
Video settings.
A structure that contains video settings such as backend, v-sync, API-settings, etc.
fplVideoBackendType backend
video backend type


Extensions loader

To use features of OpenGL 1.2 or later you need some sort of an OpenGL extension loader which gives you access to the constants and functions like glMultiTexCoord2f().
For more details please check the modern OpenGL Extensions loader section.

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.