FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::LibRocketRenderInterface Class Reference

#include <librocketrenderinterface.h>

Inherits RenderInterface.

+ Collaboration diagram for FIFE::LibRocketRenderInterface:

Classes

class  GeometryCall
 
class  GeometryCallData
 

Public Member Functions

 LibRocketRenderInterface ()
 Constructor. More...
 
virtual ~LibRocketRenderInterface ()
 Destructor. More...
 
virtual void RenderGeometry (Rocket::Core::Vertex *vertices, int num_vertices, int *indices, int num_indices, Rocket::Core::TextureHandle texture, const Rocket::Core::Vector2f &translation)
 Called by Rocket when it wants to render geometry that it does not wish to optimise. More...
 
virtual Rocket::Core::CompiledGeometryHandle CompileGeometry (Rocket::Core::Vertex *vertices, int num_vertices, int *indices, int num_indices, Rocket::Core::TextureHandle texture)
 Called by Rocket when it wants to compile geometry it believes will be static for the forseeable future. More...
 
virtual void RenderCompiledGeometry (Rocket::Core::CompiledGeometryHandle geometry, const Rocket::Core::Vector2f &translation)
 Called by Rocket when it wants to render application-compiled geometry. More...
 
virtual void ReleaseCompiledGeometry (Rocket::Core::CompiledGeometryHandle geometry)
 Called by Rocket when it wants to release application-compiled geometry. More...
 
virtual void EnableScissorRegion (bool enable)
 Called by Rocket when it wants to enable or disable scissoring to clip content. More...
 
virtual void SetScissorRegion (int x, int y, int width, int height)
 Called by Rocket when it wants to change the scissor region. More...
 
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. More...
 
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. More...
 
virtual void ReleaseTexture (Rocket::Core::TextureHandle texture_handle)
 Called by Rocket when a loaded texture is no longer required. More...
 
void render ()
 Renders librocket gui. More...
 
void freeTextures ()
 Frees all textures that are no longer needed by librocket. More...
 

Private Types

typedef std::queue< GeometryCallDataGeometryCallDataChain
 

Private Attributes

RenderBackendm_renderBackend
 
ImageManagerm_imageManager
 
std::queue< GeometryCallm_geometryCalls
 
std::list< ResourceHandlem_freedTextures
 

Detailed Description

Definition at line 49 of file librocketrenderinterface.h.

Member Typedef Documentation

◆ GeometryCallDataChain

Constructor & Destructor Documentation

◆ LibRocketRenderInterface()

FIFE::LibRocketRenderInterface::LibRocketRenderInterface ( )

Constructor.

Definition at line 37 of file librocketrenderinterface.cpp.

◆ ~LibRocketRenderInterface()

FIFE::LibRocketRenderInterface::~LibRocketRenderInterface ( )
virtual

Destructor.

Definition at line 43 of file librocketrenderinterface.cpp.

References freeTextures().

Member Function Documentation

◆ CompileGeometry()

Rocket::Core::CompiledGeometryHandle FIFE::LibRocketRenderInterface::CompileGeometry ( Rocket::Core::Vertex *  vertices,
int  num_vertices,
int *  indices,
int  num_indices,
Rocket::Core::TextureHandle  texture 
)
virtual

Called by Rocket when it wants to compile geometry it believes will be static for the forseeable future.

Definition at line 82 of file librocketrenderinterface.cpp.

◆ EnableScissorRegion()

void FIFE::LibRocketRenderInterface::EnableScissorRegion ( bool  enable)
virtual

◆ freeTextures()

void FIFE::LibRocketRenderInterface::freeTextures ( )

Frees all textures that are no longer needed by librocket.

Definition at line 192 of file librocketrenderinterface.cpp.

References FIFE::Image::free(), FIFE::ImageManager::get(), m_freedTextures, and m_imageManager.

Referenced by FIFE::LibRocketManager::turn(), and ~LibRocketRenderInterface().

+ Here is the caller graph for this function:

◆ GenerateTexture()

bool FIFE::LibRocketRenderInterface::GenerateTexture ( Rocket::Core::TextureHandle &  texture_handle,
const Rocket::Core::byte *  source,
const Rocket::Core::Vector2i &  source_dimensions 
)
virtual

Called by Rocket when a texture is required to be built from an internally-generated sequence of pixels.

Definition at line 141 of file librocketrenderinterface.cpp.

References FIFE::ImageManager::add(), FIFE::RenderBackend::createImage(), FIFE::IResource::getHandle(), m_imageManager, m_renderBackend, FIFE::IResource::RES_LOADED, and FIFE::IResource::setState().

◆ LoadTexture()

bool FIFE::LibRocketRenderInterface::LoadTexture ( Rocket::Core::TextureHandle &  texture_handle,
Rocket::Core::Vector2i &  texture_dimensions,
const Rocket::Core::String &  source 
)
virtual

Called by Rocket when a texture is required by the library.

Definition at line 126 of file librocketrenderinterface.cpp.

References FIFE::ImageManager::exists(), FIFE::ImageManager::get(), FIFE::Image::getWidth(), FIFE::ImageManager::load(), and m_imageManager.

◆ ReleaseCompiledGeometry()

void FIFE::LibRocketRenderInterface::ReleaseCompiledGeometry ( Rocket::Core::CompiledGeometryHandle  geometry)
virtual

Called by Rocket when it wants to release application-compiled geometry.

Definition at line 89 of file librocketrenderinterface.cpp.

◆ ReleaseTexture()

void FIFE::LibRocketRenderInterface::ReleaseTexture ( Rocket::Core::TextureHandle  texture_handle)
virtual

Called by Rocket when a loaded texture is no longer required.

Definition at line 153 of file librocketrenderinterface.cpp.

References m_freedTextures.

◆ render()

◆ RenderCompiledGeometry()

void FIFE::LibRocketRenderInterface::RenderCompiledGeometry ( Rocket::Core::CompiledGeometryHandle  geometry,
const Rocket::Core::Vector2f &  translation 
)
virtual

Called by Rocket when it wants to render application-compiled geometry.

Definition at line 86 of file librocketrenderinterface.cpp.

◆ RenderGeometry()

void FIFE::LibRocketRenderInterface::RenderGeometry ( Rocket::Core::Vertex *  vertices,
int  num_vertices,
int *  indices,
int  num_indices,
Rocket::Core::TextureHandle  texture,
const Rocket::Core::Vector2f &  translation 
)
virtual

◆ SetScissorRegion()

void FIFE::LibRocketRenderInterface::SetScissorRegion ( int  x,
int  y,
int  width,
int  height 
)
virtual

Member Data Documentation

◆ m_freedTextures

std::list<ResourceHandle> FIFE::LibRocketRenderInterface::m_freedTextures
private

Definition at line 140 of file librocketrenderinterface.h.

Referenced by freeTextures(), and ReleaseTexture().

◆ m_geometryCalls

std::queue<GeometryCall> FIFE::LibRocketRenderInterface::m_geometryCalls
private

◆ m_imageManager

ImageManager* FIFE::LibRocketRenderInterface::m_imageManager
private

Definition at line 110 of file librocketrenderinterface.h.

Referenced by freeTextures(), GenerateTexture(), LoadTexture(), and render().

◆ m_renderBackend

RenderBackend* FIFE::LibRocketRenderInterface::m_renderBackend
private

Definition at line 108 of file librocketrenderinterface.h.

Referenced by GenerateTexture(), and render().


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