Rendering interfacing bridge between libRocket and nomlib.
More...
#include <RocketSDL2RenderInterface.hpp>
|
|
| RocketSDL2RenderInterface (RenderWindow *window) |
| virtual void | Release () |
| | Implements Rocket::Core::SystemInterface::Release.
|
|
virtual void | RenderGeometry (Rocket::Core::Vertex *vertices, int num_vertices, int *indices, int num_indices, Rocket::Core::TextureHandle texture_handle, const Rocket::Core::Vector2f &translation) |
| | Called by Rocket when it wants to render geometry that it does not wish to optimise.
|
|
virtual void | EnableScissorRegion (bool enable) |
| | Called by Rocket when it wants to enable or disable scissoring to clip content.
|
| virtual void | SetScissorRegion (int x, int y, int width, int height) |
| | Called by Rocket when it wants to change the scissor region.
|
|
virtual bool | LoadTexture (Rocket::Core::TextureHandle &texture_handle, Rocket::Core::Vector2i &texture_dimensions, const Rocket::Core::String &source) |
| | Called by Rocket when a texture is required by the library.
|
|
virtual bool | GenerateTexture (Rocket::Core::TextureHandle &texture_handle, const Rocket::Core::byte *source, const Rocket::Core::Vector2i &source_dimensions) |
| | Called by Rocket when a texture is required to be built from an internally-generated sequence of pixels.
|
|
virtual void | ReleaseTexture (Rocket::Core::TextureHandle texture_handle) |
| | Called by Rocket when a loaded texture is no longer required.
|
|
| static bool | gl_init (int width, int height) |
| | Initialize OpenGL with the necessary settings for libRocket and SDL2 to be all friendly.
|
|
| static priv::glUseProgramObjectARB_func | ctx_ |
| | Shader context function pointer.
|
Rendering interfacing bridge between libRocket and nomlib.
- Note
- Currently, only the OpenGL back-end for SDL2 is supported.
- Todo
- Add support for OpenGLES and OpenGLES2 (mobile platforms).
- See also
- http://mdqinc.com/blog/2013/01/integrating-librocket-with-sdl-2
Definition at line 62 of file RocketSDL2RenderInterface.hpp.
◆ gl_init()
| bool nom::RocketSDL2RenderInterface::gl_init |
( |
int | width, |
|
|
int | height ) |
|
static |
Initialize OpenGL with the necessary settings for libRocket and SDL2 to be all friendly.
- Returns
- Boolean TRUE if OpenGL initialization is successful, and boolean FALSE on failure.
- Parameters
-
| width | The width of the clipping plane (orthographic matrix). |
| height | The height of the clipping plane (orthographic matrix). |
- Note
- This method should be called before the construction of this object, after the creation of a RenderWindow, and before any other rendering (OpenGL or otherwise).
◆ Release()
| virtual void nom::RocketSDL2RenderInterface::Release |
( |
| ) |
|
|
virtual |
Implements Rocket::Core::SystemInterface::Release.
◆ SetScissorRegion()
| virtual void nom::RocketSDL2RenderInterface::SetScissorRegion |
( |
int | x, |
|
|
int | y, |
|
|
int | width, |
|
|
int | height ) |
|
virtual |
Called by Rocket when it wants to change the scissor region.
- Todo
- The clipping calculations are slightly off for the y / height dimensions. This bug can often be seen with use of libRocket's scrollbar feature (i.e.: visual debugger's element info window).
◆ ctx_
| priv::glUseProgramObjectARB_func nom::RocketSDL2RenderInterface::ctx_ |
|
staticprivate |
Shader context function pointer.
- Note
- We bypass the use of GLEW by requesting this extension through SDL2.
Definition at line 127 of file RocketSDL2RenderInterface.hpp.
◆ window_
The documentation for this class was generated from the following file: