ImFusion SDK 4.3

Using OpenGL within the ImFusion SDK. More...

+ Collaboration diagram for OpenGL:

Detailed Description

Using OpenGL within the ImFusion SDK.

Note
This page mainly describes high-level OpenGL aspects. See OpenGL Wrapper Library for low-level wrapper and helper classes for working with OpenGL.
See also
OpenGL Wrapper Library, Rendering Custom Graphics

OpenGL Function Bindings

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

#include <ImFusion/Core/GL/glad.h>

Availability of OpenGL Contexts

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.

See also
GL::ContextManager, ImFusion SDK Threading Model

Default OpenGL State

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:

All 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.

Loading Custom OpenGL Shaders

See GLSL Shaders and Program.

Font Rendering

See GL::TextRenderer.

Namespaces

namespace  ImFusion::GlUtils
 Utility functions for working with OpenGL and/or GlImages.
 
Search Tab / S to search, Esc to close