27 #ifndef _CEGUIOpenGLESRenderer_h_
28 #define _CEGUIOpenGLESRenderer_h_
30 #include "CEGUI/Base.h"
31 #include "CEGUI/Renderer.h"
32 #include "CEGUI/Size.h"
33 #include "CEGUI/Vector.h"
34 #include "CEGUI/RendererModules/OpenGLES/GLES.h"
38 #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
39 # ifdef CEGUIOPENGLESRENDERER_EXPORTS
40 # define OPENGLES_GUIRENDERER_API __declspec(dllexport)
42 # define OPENGLES_GUIRENDERER_API __declspec(dllimport)
45 # define OPENGLES_GUIRENDERER_API
49 # pragma warning(push)
50 # pragma warning(disable : 4251)
57 class OpenGLESTexture;
58 class OpenGLESTextureTarget;
59 class OpenGLESGeometryBuffer;
60 class OGLTextureTargetFactory;
107 const int abi = CEGUI_VERSION_ABI);
136 const Sizef& display_size,
138 const int abi = CEGUI_VERSION_ABI);
169 const int abi = CEGUI_VERSION_ABI);
187 const int abi = CEGUI_VERSION_ABI);
219 const String& resourceGroup);
347 void setupExtraStates();
350 void cleanupExtraStates();
353 void initialiseTextureTargetFactory(
const TextureTargetType tt_type);
356 void logTextureDestruction(
const String& name);
361 GLboolean glScissorTest;
370 static String d_rendererID;
374 Vector2f d_displayDPI;
376 RenderTarget* d_defaultTarget;
378 typedef std::vector<TextureTarget*> TextureTargetList;
380 TextureTargetList d_textureTargets;
382 typedef std::vector<OpenGLESGeometryBuffer*> GeometryBufferList;
384 GeometryBufferList d_geometryBuffers;
386 typedef std::map<String, OpenGLESTexture*, StringFastLessCompare
387 CEGUI_MAP_ALLOC(String, OpenGLESTexture*)> TextureMap;
389 TextureMap d_textures;
391 uint d_maxTextureSize;
393 bool d_initExtraStates;
395 OGLTextureTargetFactory* d_textureTargetFactory;
400 #if defined(_MSC_VER)
401 # pragma warning(pop)
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
Renderer class to interface with OpenGLES.
Definition: RendererModules/OpenGLES/Renderer.h:67
bool isTexCoordSystemFlipped() const
Returns if the texture coordinate system is vertically flipped or not. The original of a texture coor...
Definition: RendererModules/OpenGLES/Renderer.h:314
void destroyTextureTarget(TextureTarget *target)
Function that cleans up TextureTarget objects created with the createTextureTarget function.
static OpenGLESRenderer & bootstrapSystem(const Sizef &display_size, const TextureTargetType tt_type=TTT_AUTO, const int abi=CEGUI_VERSION_ABI)
Convenience function that creates the required objects to initialise the CEGUI system.
Texture & createTexture(const String &name, const String &filename, const String &resourceGroup)
Create a Texture object using the given image file.
TextureTarget * createTextureTarget()
Create a TextureTarget that can be used to cache imagery; this is a RenderTarget that does not lose i...
void destroyAllTextures()
Destroy all Texture objects created by this Renderer.
static OpenGLESRenderer & bootstrapSystem(const TextureTargetType tt_type=TTT_AUTO, const int abi=CEGUI_VERSION_ABI)
Convenience function that creates the required objects to initialise the CEGUI system.
GeometryBuffer & createGeometryBuffer()
Create a new GeometryBuffer and return a reference to it. You should remove the GeometryBuffer from a...
void destroyAllTextureTargets()
Destory all TextureTarget objects created by this Renderer.
uint getMaxTextureSize() const
Return the pixel size of the maximum supported texture.
void endRendering()
Perform any operations required to finalise rendering.
Sizef getAdjustedTextureSize(const Sizef &sz) const
Helper to return a valid texture size according to reported OpenGLES capabilities.
void destroyTexture(Texture &texture)
Destroy a Texture object that was previously created by calling the createTexture functions.
static void destroySystem()
Convenience function to cleanup the CEGUI system and related objects that were created by calling the...
void beginRendering()
Perform any operations required to put the system into a state ready for rendering operations to begi...
TextureTargetType
Enumeration of valid texture target types.
Definition: RendererModules/OpenGLES/Renderer.h:71
@ TTT_FBO
Use targets based on frame buffer objects if available, else none.
Definition: RendererModules/OpenGLES/Renderer.h:75
@ TTT_PBUFFER
Use targets based on pbuffer support if available, else none.
Definition: RendererModules/OpenGLES/Renderer.h:77
@ TTT_AUTO
Automatically choose the best type available.
Definition: RendererModules/OpenGLES/Renderer.h:73
const Vector2f & getDisplayDPI() const
Return the resolution of the display or host window in dots per inch.
Texture & createTexture(const String &name, GLuint tex, const Sizef &sz)
Create a texture that uses an existing OpenGLES texture with the specified size. Note that it is your...
void restoreTextures()
Restores all the loaded textures from the local data buffers previously created by 'grabTextures'.
void enableExtraStateSettings(bool setting)
Tells the renderer to initialise some extra states beyond what it directly needs itself for CEGUI.
static OpenGLESRenderer & create(const Sizef &display_size, const TextureTargetType tt_type=TTT_AUTO, const int abi=CEGUI_VERSION_ABI)
Create an OpenGLESRenderer object.
static void destroy(OpenGLESRenderer &renderer)
Destroy an OpenGLESRenderer object.
void destroyTexture(const String &name)
Destroy a Texture object that was previously created by calling the createTexture functions.
Texture & createTexture(const String &name, const Sizef &size)
Create a Texture object with the given pixel dimensions as specified by size.
static float getNextPOTSize(const float f)
Utility function that will return f if it's a power of two, or the next power of two up from f if it'...
void destroyGeometryBuffer(const GeometryBuffer &buffer)
Destroy a GeometryBuffer that was returned when calling the createGeometryBuffer function....
void setDisplaySize(const Sizef &sz)
Set the size of the display or host window in pixels for this Renderer object.
Texture & createTexture(const String &name)
Create a 'null' Texture object.
Texture & getTexture(const String &name) const
Return a Texture object that was previously created by calling the createTexture functions.
bool isTextureDefined(const String &name) const
Return whether a texture with the given name exists.
static bool isGLExtensionSupported(const char *extension)
Check if provided extension is supported on current platform. Khronos reference implementation.
void destroyAllGeometryBuffers()
Destroy all GeometryBuffer objects created by this Renderer.
RenderTarget & getDefaultRenderTarget()
Returns the default RenderTarget object. The default render target is is typically one that targets t...
void grabTextures()
Grabs all the loaded textures from Texture RAM and stores them in a local data buffer....
const Sizef & getDisplaySize() const
Return the size of the display or host window in pixels.
const String & getIdentifierString() const
Return identification string for the renderer module.
static OpenGLESRenderer & create(const TextureTargetType tt_type=TTT_AUTO, const int abi=CEGUI_VERSION_ABI)
Create an OpenGLESRenderer object.
Defines interface to some surface that can be rendered to. Concrete instances of objects that impleme...
Definition: RenderTarget.h:60
Abstract class defining the basic required interface for Renderer objects.
Definition: Renderer.h:84
String class used within the GUI system.
Definition: String.h:64
Specialisation of RenderTarget interface that should be used as the base class for RenderTargets that...
Definition: TextureTarget.h:41
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:54
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1