FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
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

Constructor & Destructor Documentation

FIFE::LibRocketRenderInterface::LibRocketRenderInterface ( )

Constructor.

Definition at line 37 of file librocketrenderinterface.cpp.

FIFE::LibRocketRenderInterface::~LibRocketRenderInterface ( )
virtual

Destructor.

Definition at line 43 of file librocketrenderinterface.cpp.

References freeTextures().

Member Function Documentation

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.

void FIFE::LibRocketRenderInterface::EnableScissorRegion ( bool  enable)
virtual
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:

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().

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.

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.

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.

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.

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
void FIFE::LibRocketRenderInterface::SetScissorRegion ( int  x,
int  y,
int  width,
int  height 
)
virtual

Member Data Documentation

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

Definition at line 140 of file librocketrenderinterface.h.

Referenced by freeTextures(), and ReleaseTexture().

std::queue<GeometryCall> FIFE::LibRocketRenderInterface::m_geometryCalls
private
ImageManager* FIFE::LibRocketRenderInterface::m_imageManager
private

Definition at line 110 of file librocketrenderinterface.h.

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

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: