![]() |
ImFusion SDK 4.3
|
Using OpenGL within the ImFusion SDK. More...
Using OpenGL within the ImFusion SDK.
The ImFusionLib comes with OpenGL core bindings and will resolve the OpenGL function pointers during SDK initialization. Thus, you do not need to use an extra library for this such as GLEW, gl3w or glad. If you want to use low-level OpenGL functionality, please use the following include
Generally, the following restriction apply to OpenGL:
Since the ImFusion SDK makes extensive usage of OpenGL it maintains its own set of OpenGL contexts.
You can maintain your own OpenGL contexts if you require OpenGL in a separate thread as long as you ensure that the main and background threads of the ImFusion SDK keep their corresponding contexts current.
Since OpenGL 3.3 the OpenGL attribute stack (glPushAttrib()/glPopAttrib()) is deprecated. You can use the GL::StateGuard interface as alternative to manage changes to the OpenGL state. Furthermore, make sure to set the following settings back to its default values in case you change them:
GL_DEPTH_DEST
: disabledglDepthFunc
: GL_LESSglClearDepth
: 1.0GL_BLEND
: disabledglBlendFunc
: GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHAGL_SCISSOR_TEST
: disabledAll other OpenGL state settings can not be expected to be in any specific state, hence you have to make sure to set them explicitly. It is good practice to clean up after yourself, i.e. restore the original OpenGL state after you're done.
See GLSL Shaders and Program.
See GL::TextRenderer.
Namespaces | |
namespace | ImFusion::GlUtils |
Utility functions for working with OpenGL and/or GlImages. | |