![]() |
ImFusion C++ SDK 4.4.0
|
Helper classes and functions for working with OpenGL. More...
Helper classes and functions for working with OpenGL.
Classes | |
| class | ImFusion::GL::Blending |
| Helper class to configure the OpenGL blending stage. More... | |
| class | ImFusion::GL::ObjectPicking |
| Helper class to consolidate functionality for implementing object picking of rendered geometry. More... | |
| class | ImFusion::GL::OffscreenRenderHelper |
| Helper class to perform deferred off-screen rendering. More... | |
| class | ImFusion::GL::StateGuard |
| Guard to easily save and restore critical (modern) OpenGL state. More... | |
| class | ImFusion::GL::SyncObject |
| Helper class to synchronize between multiple OpenGL contexts or a context and the application. More... | |
| struct | ImFusion::GL::PlatformInfo |
| Structure storing information on the GPU/driver/OpenGL context configuration. More... | |
| struct | ImFusion::GL::MemoryInfo |
| Structure storing information about the available video memory as reported by OpenGL. More... | |
| struct | ImFusion::GL::Viewport |
| Structure describing an OpenGL viewport. More... | |
| class | ImFusion::GL::ViewState |
| Encapsulates the OpenGL view state defined by the viewport, a projection matrix and a model-view matrix. More... | |
| class | ImFusion::GL::OrderIndependentTransparency |
| Helper class to consolidate functionality for implementing order-independent transparency of rendered geometry. More... | |
Functions | |
| void | ImFusion::GL::init (std::unique_ptr< Context >=nullptr) |
| Initializes the OpenGL backend. | |
| void | ImFusion::GL::deinit () |
| Properly deinitializes all OpenGL resources. | |
| bool | ImFusion::GL::getBool (uint32_t param) |
| Convenience wrapper for glGetBoolean_v() that directly returns the result. | |
| int32_t | ImFusion::GL::getInt (uint32_t param) |
| Convenience wrapper for glGetInteger_v() that directly returns the result. | |
| int32_t | ImFusion::GL::getIntIndexed (uint32_t param, uint32_t index) |
| Convenience wrapper for indexed glGetIntegeri_v() that directly returns the result. | |
| float | ImFusion::GL::getFloat (uint32_t param) |
| Convenience wrapper for glGetFloat_v() that directly returns the result. | |
| std::string | ImFusion::GL::getString (uint32_t param) |
| Convenience wrapper for glGetString() that directly returns the result. | |
| GraphicsResetStatus | ImFusion::GL::getGraphicsResetStatus () |
| Checks if the current context has been lost due to software or hardware issues. | |
| void | ImFusion::GL::clearColorBuffer (const vec4f &color) |
| Clears all color buffers attached to the current framebuffer by calling glClearColor(color) and glClear(GL_COLOR_BUFFER_BIT);. | |
| void | ImFusion::GL::clearDepthBuffer (double value) |
| Clears the depth buffer attached to the current framebuffer by calling glClearDepth(value) and glClear(GL_DEPTH_BUFFER_BIT);. | |
| void | ImFusion::GL::memoryBarrier (Flags< Barrier > barriers) |
| Inserts a barrier into the OpenGL command stream to order memory transactions. | |
| void | ImFusion::GL::flush () |
| Calls glFlush() to block until all OpenGL commands have been transferred to the GPU. | |
| void | ImFusion::GL::finish () |
| Calls glFinish() to block until all OpenGL execution is complete. | |
| mat4 | ImFusion::GL::createOrtho (double left, double right, double bottom, double top, double pnear, double pfar) |
| Generates an orthographic projection matrix, the same as glOrtho() would do. | |
| mat4 | ImFusion::GL::createOrtho2d (int width, int height) |
| Generates a pixel-perfect 2D orthographic projection matrix for the given viewport size. | |
| mat4 | ImFusion::GL::createPerspective (double fov, double aspect, double pnear, double pfar) |
| Generates an perspective projection matrix, the same as glPerspective() would do. | |
| PlatformInfo | ImFusion::GL::platformInfo () |
| Returns information about the currently active OpenGL platform. | |
| MemoryInfo | ImFusion::GL::memoryInfo () |
| Returns information about the currently available and total GPU memory. | |
| Utils::Version | ImFusion::GL::versionInfo () |
| Returns the available OpenGL version of the current context. | |
| void | ImFusion::GL::setDpiScale (double dpiScale) |
| Sets the global DPI scaling factor that should be used by DPI-sensitive OpenGL renderings. | |
| double | ImFusion::GL::dpiScale () |
| Queries the global DPI scaling factor that should be used by DPI-sensitive OpenGL renderings. | |
|
strong |
#include <ImFusion/Core/GL/Types.h>
Describes the host pixel format during OpenGL texture upload/download.
|
strong |
#include <ImFusion/Core/GL/Types.h>
Describes the host pixel type during OpenGL texture upload/download.
|
strong |
#include <ImFusion/Core/GL/Types.h>
Primitive type to render, to be used with GL::VertexBuffer::draw().
|
strong |
#include <ImFusion/Core/GL/Types.h>
Bitflag enum to describe how you intend to use the data after issuing the memoryBarrier() command.
| Enumerator | |
|---|---|
| VertexAttribArray | Vertex data sourced from buffer objects after the barrier will reflect data written by shaders prior to the barrier. |
| ElementArray | Vertex array indices sourced from buffer objects after the barrier will reflect data written by shaders prior to the barrier. |
| Uniform | Shader uniforms sourced from buffer objects after the barrier will reflect data written by shaders prior to the barrier. |
| TextureFetch | Texture fetches from shaders, including fetches from buffer object memory via buffer textures, after the barrier will reflect data written by shaders prior to the barrier. |
| ShaderImageAccess | Memory accesses using shader image load, store, and atomic built-in functions issued after the barrier will reflect data written by shaders prior to the barrier. Additionally, image stores and atomics issued after the barrier will not execute until all memory accesses (e.g., loads, stores, texture fetches, vertex fetches) initiated prior to the barrier complete. |
| Command | Command data sourced from buffer objects by Draw*Indirect commands after the barrier will reflect data written by shaders prior to the barrier. |
| PixelBuffer | Reads and writes of buffer objects via the GL_PIXEL_PACK_BUFFER and GL_PIXEL_UNPACK_BUFFER bindings (via glReadPixels, glTexSubImage2D, etc.) after the barrier will reflect data written by shaders prior to the barrier. Additionally, buffer object writes issued after the barrier will wait on the completion of all shader writes initiated prior to the barrier. |
| TextureUpdate | Writes to a texture via glTex(Sub)Image*, glCopyTex(Sub)Image*, glClearTex*Image, glCompressedTex(Sub)Image*, and reads via glGetTexImage after the barrier will reflect data written by shaders prior to the barrier. Additionally, texture writes from these commands issued after the barrier will not execute until all shader writes initiated prior to the barrier complete. |
| BufferUpdate | Reads or writes to buffer objects via any OpenGL API functions that allow modifying their contents reflect data written by shaders prior to the barrier. Additionally, writes via these commands issued after the barrier will wait on the completion of any shader writes to the same memory initiated prior to the barrier. |
| Framebuffer | Reads and writes via framebuffer object attachments after the barrier will reflect data written by shaders prior to the barrier. Additionally, framebuffer writes issued after the barrier will wait on the completion of all shader writes issued prior to the barrier. |
| TransformFeedback | Writes via transform feedback bindings after the barrier will reflect data written by shaders prior to the barrier. Additionally, transform feedback writes issued after the barrier will wait on the completion of all shader writes issued prior to the barrier. |
| AtomicCounter | Accesses to atomic counters after the barrier will reflect writes prior to the barrier. |
| ShaderStorage | Accesses to shader storage blocks after the barrier will reflect writes prior to the barrier. |
| ClientMappedBuffer | Access by the client to persistent mapped regions of buffer objects will reflect data written by shaders prior to the barrier. Note that this may cause additional synchronization operations. |
| QueryBuffer | Writes of buffer objects via the GL_QUERY_BUFFER binding after the barrier will reflect data written by shaders prior to the barrier. Additionally, buffer object writes issued after the barrier will wait on the completion of all shader writes initiated prior to the barrier. |
| All | Combines all flags above. |
|
strong |
#include <ImFusion/Core/GL/Types.h>
Return value of GL::getGraphicsResetStatus().
| Enumerator | |
|---|---|
| NoError | Context has not been reset since last call. |
| GuiltyContextReset | A reset has been detected that is attributable to the current GL context. |
| InnocentContextReset | A reset has been detected that is not attributable to the current GL context. |
| UnknownContextReset | Indicates a detected graphics reset whose cause is unknown. |
| void ImFusion::GL::init | ( | std::unique_ptr< Context > | = nullptr | ) |
#include <ImFusion/Core/GL/Functions.h>
Initializes the OpenGL backend.
You can provide an optional OpenGL context to use as main context. Otherwise, it will create a new default context with the following settings:
| OpenGLNotFoundException | if the OpenGL could not be initialized. |
| void ImFusion::GL::deinit | ( | ) |
#include <ImFusion/Core/GL/Functions.h>
Properly deinitializes all OpenGL resources.
Deinitialize the logging framework.
| GraphicsResetStatus ImFusion::GL::getGraphicsResetStatus | ( | ) |
#include <ImFusion/Core/GL/Functions.h>
Checks if the current context has been lost due to software or hardware issues.
#include <ImFusion/Core/GL/Functions.h>
Inserts a barrier into the OpenGL command stream to order memory transactions.
| barriers | Bitflag describing how you intend to use the data after issueing this command. |
| mat4 ImFusion::GL::createOrtho2d | ( | int | width, |
| int | height ) |
#include <ImFusion/Core/GL/Functions.h>
Generates a pixel-perfect 2D orthographic projection matrix for the given viewport size.
Same as calling createOrtho(0, width, 0, height, -1, 1).
| MemoryInfo ImFusion::GL::memoryInfo | ( | ) |
#include <ImFusion/Core/GL/Functions.h>
Returns information about the currently available and total GPU memory.
This function requires the GL_NVX_gpu_memory_info extension. If it is not supported by the current platform it may return a ByteSize of 0 to indicate failure.
| Utils::Version ImFusion::GL::versionInfo | ( | ) |
#include <ImFusion/Core/GL/Functions.h>
Returns the available OpenGL version of the current context.
Will return {-1, -1} in case of any error.
| void ImFusion::GL::setDpiScale | ( | double | dpiScale | ) |
#include <ImFusion/Core/GL/Functions.h>
Sets the global DPI scaling factor that should be used by DPI-sensitive OpenGL renderings.
This scaling factor is usually the product of a user defined scaling and the pixel ratio of the underlying device (e.g. retina displays). Since ImFusionGL has no access abstraction to the windowing system, this value must be set from the outside.
| double ImFusion::GL::dpiScale | ( | ) |
#include <ImFusion/Core/GL/Functions.h>
Queries the global DPI scaling factor that should be used by DPI-sensitive OpenGL renderings.
Entities of the ImFusion SDK (such as FixedFunctionPipeline, TextRenderer, ...) already consider this setting internally, so that users do not need to worry about it. However, if you need to perform custom DPI-sensitive rendering, use this function.