Final Platform Layer 0.9.8-beta
|
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:
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:
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.
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 .
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.