TGUI  1.6.1
Loading...
Searching...
No Matches
tgui::BackendRendererGLES2 Class Reference

Backend renderer that uses OpenGL ES 2 or 3 (depending on the loaded OpenGL ES context that you have to provide) More...

#include <TGUI/Backend/Renderer/GLES2/BackendRendererGLES2.hpp>

Inheritance diagram for tgui::BackendRendererGLES2:
tgui::BackendRenderer

Public Types

using ContextLoadFuncReturnType = void (*)()
 
using ContextLoadFuncType = ContextLoadFuncReturnType (*)(const char *name)
 
using SDLContextLoadFuncType = void* (*)(const char *name)
 

Public Member Functions

 BackendRendererGLES2 (ContextLoadFuncType contextLoadFunction)
 Initializes the backend renderer. This will initialize GLAD to use OpenGL ES.
 
 BackendRendererGLES2 (SDLContextLoadFuncType contextLoadFunction)
 Helper constructor so that you can pass SDL_GL_GetProcAddress without needing to cast the type.
 
std::shared_ptr< BackendTexturecreateTexture () override
 Creates a new empty texture object.
 
unsigned int getMaximumTextureSize () override
 Get the maximum allowed texture size.
 
- Public Member Functions inherited from tgui::BackendRenderer
virtual ~BackendRenderer ()=default
 Virtual destructor.
 
virtual std::shared_ptr< BackendTextcreateText ()
 Creates a new empty text object.
 

Detailed Description

Backend renderer that uses OpenGL ES 2 or 3 (depending on the loaded OpenGL ES context that you have to provide)

Constructor & Destructor Documentation

◆ BackendRendererGLES2() [1/2]

tgui::BackendRendererGLES2::BackendRendererGLES2 ( ContextLoadFuncType contextLoadFunction)

Initializes the backend renderer. This will initialize GLAD to use OpenGL ES.

Parameters
contextLoadFunctionFunction that gets the address of an OpenGL function

Examples of load functions are sf::Context::getFunction, SDL_GL_GetProcAddress and glfwGetProcAddress.

Example usage:

backend->setRenderer(std::make_shared<BackendRendererGLES2>(glfwGetProcAddress));

◆ BackendRendererGLES2() [2/2]

tgui::BackendRendererGLES2::BackendRendererGLES2 ( SDLContextLoadFuncType contextLoadFunction)

Helper constructor so that you can pass SDL_GL_GetProcAddress without needing to cast the type.

See also
BackendRendererGLES2(ContextLoadFuncType)
Parameters
contextLoadFunctionFunction that gets the address of an OpenGL function

Member Function Documentation

◆ createTexture()

std::shared_ptr< BackendTexture > tgui::BackendRendererGLES2::createTexture ( )
nodiscardoverridevirtual

Creates a new empty texture object.

Returns
Shared pointer to a new texture object

Implements tgui::BackendRenderer.

◆ getMaximumTextureSize()

unsigned int tgui::BackendRendererGLES2::getMaximumTextureSize ( )
nodiscardoverridevirtual

Get the maximum allowed texture size.

Returns
Maximum width and height that you should try to use in a single texture

This maximum size is defined by the graphics driver. Most likely this will return 8192 or 16384.

Implements tgui::BackendRenderer.


The documentation for this class was generated from the following file: