KarmaEngine
Game Engine for practical learning and research purposes
|
The chief class for KarmaGui's OpenGL based backend renderer. More...
#include <KarmaGuiOpenGLHandler.h>
Static Public Member Functions | |
static bool | KarmaGui_ImplOpenGL3_Init (const char *glsl_version=NULL) |
Initializing OpenGL backend renderer. | |
static void | KarmaGui_ImplOpenGL3_InitPlatformInterface () |
KarmaGuiPlatformIO 's instance's member, platform_io.Renderer_RenderWindow, is set to KarmaGui_ImplOpenGL3_RenderWindow. | |
static void | KarmaGui_ImplOpenGL3_ShutdownPlatformInterface () |
Destroy window(s) opened in viewport(s) and clear the data. | |
static void | KarmaGui_ImplOpenGL3_Shutdown () |
Function called when KarmaGui layer shuts down (happens when LayerStack is destroyed). Call stack is like so: KarmaGuiLayer::OnDetach() -> KarmaGuiRenderer::OnKarmaGuiLayerDetach() -> KarmaGuiOpenGLHandler::KarmaGui_ImplOpenGL3_Shutdown(). | |
static void | KarmaGui_ImplOpenGL3_NewFrame () |
Function called in the begining of each KarmaGui's render loop. | |
static void | KarmaGui_ImplOpenGL3_RenderDrawData (KGDrawData *draw_data) |
The routine for rendering the Karma's UI using OpenGL3 API. | |
static void | KarmaGui_ImplOpenGL3_SetupRenderState (KGDrawData *draw_data, int fb_width, int fb_height, GLuint vertex_array_object) |
Setup render state: alpha-blending (process of combining one image with a background to create the appearance of partial or full transparency) enabled, no face culling, no depth testing, scissor enabled, polygon fill, setup viewport. Bind vertex/index buffers and setup attributes for KGDrawVert. | |
static bool | CheckShader (GLuint handle, const char *desc) |
A check for success of shader (within KarmaGuiOpenGLHandler context) compilation. | |
static bool | CheckProgram (GLuint handle, const char *desc) |
A check for the success of shader (within KarmaGuiOpenGLHandler context) linking. | |
static void | KarmaGui_ImplOpenGL3_RenderWindow (KarmaGuiViewport *viewport, void *render_arg) |
Prepares the context for OpenGl's rendering of KarmaGui's primitives and calls the function KarmaGui_ImplOpenGL3_RenderDrawData. | |
static void | KarmaGui_ImplOpenGL3_CreateTexture (char const *fileName, const std::string &label="") |
A helper function to generate texture, in appropriate format, and add to the list openglMesaDecalDataList for use. | |
static bool | KarmaGui_ImplOpenGL3_CreateFontsTexture () |
A function to generate texture for OpenGL fonts The following steps are taken: | |
static void | KarmaGui_ImplOpenGL3_DestroyFontsTexture () |
Clear up the resources occupied by the fonts and decals, all the textures in this context. | |
static bool | KarmaGui_ImplOpenGL3_CreateDeviceObjects () |
Creates and generates shaders and buffers to be used along with the necessary uniforms. | |
static void | KarmaGui_ImplOpenGL3_DestroyDeviceObjects () |
Clears up all the resources (shaders, buffers, and uniforms) allocated in KarmaGui_ImplOpenGL3_CreateDeviceObjects() | |
The chief class for KarmaGui's OpenGL based backend renderer.
|
static |
A check for the success of shader (within KarmaGuiOpenGLHandler context) linking.
The following log message is printed on the occurance of the linking error detected by the check
handle | The GL program (for shader object) object being queried |
desc | The category name of the program object. For instance "shader program" (only) |
|
static |
A check for success of shader (within KarmaGuiOpenGLHandler context) compilation.
The following log message is printed on the occurance of compilation error detected by the check
handle | The shader object being queried |
desc | The category name of the shader object. For instance "vertex shader" or "fragment shader" |
|
static |
Creates and generates shaders and buffers to be used along with the necessary uniforms.
|
static |
A function to generate texture for OpenGL fonts The following steps are taken:
|
static |
A helper function to generate texture, in appropriate format, and add to the list openglMesaDecalDataList for use.
fileName | The path to the file containing texture |
label | The name of the texture for identification purpose |
|
static |
Clears up all the resources (shaders, buffers, and uniforms) allocated in KarmaGui_ImplOpenGL3_CreateDeviceObjects()
|
static |
Clear up the resources occupied by the fonts and decals, all the textures in this context.
|
static |
Initializing OpenGL backend renderer.
The following steps are taken:
glsl_version | The version of OpenGL driver being used |
|
static |
KarmaGuiPlatformIO 's instance's member, platform_io.Renderer_RenderWindow, is set to KarmaGui_ImplOpenGL3_RenderWindow.
|
static |
Function called in the begining of each KarmaGui's render loop.
In minor detail, the sequence is like so
|
static |
The routine for rendering the Karma's UI using OpenGL3 API.
Basically all that is drawn for Karma's UI (and inside the UI, including text, textures, and all that) is nothing but the set of triangles (KGDrawList). The relevant information is written in KGDrawData instance by the call Karma::KarmaGui::Render()
draw_data | The data to render a KarmaGui frame |
|
static |
Prepares the context for OpenGl's rendering of KarmaGui's primitives and calls the function KarmaGui_ImplOpenGL3_RenderDrawData.
viewport | The only single platform window since we are not working with multi-viewport |
render_arg | Is the value passed to KarmaGui::RenderPlatformWindowsDefault() by KarmaGuiRenderer::OnKarmaGuiLayerEnd(), usually NULL |
|
static |
Setup render state: alpha-blending (process of combining one image with a background to create the appearance of partial or full transparency) enabled, no face culling, no depth testing, scissor enabled, polygon fill, setup viewport. Bind vertex/index buffers and setup attributes for KGDrawVert.
draw_data | The collection of variables composing the draw data to render a KarmaGui frame |
fb_width | The width of the KarmaGui's rendering scope (draw_data->DisplaySize.x * draw_data->FramebufferScale.x), for glViewport's use. |
fb_height | The height of the KarmaGui's rendering scope (draw_data->DisplaySize.y * draw_data->FramebufferScale.y), for glViewport's use. |
vertex_array_object | The name of the OpenGl vertexarray object |
|
static |
Function called when KarmaGui layer shuts down (happens when LayerStack is destroyed). Call stack is like so: KarmaGuiLayer::OnDetach() -> KarmaGuiRenderer::OnKarmaGuiLayerDetach() -> KarmaGuiOpenGLHandler::KarmaGui_ImplOpenGL3_Shutdown().
|
static |
Destroy window(s) opened in viewport(s) and clear the data.