Crazy Eddie's GUI System  0.8.7
FBOTextureTarget.h
1 /***********************************************************************
2  created: Sun Jan 11 2009
3  author: Paul D Turner
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIOpenGLESFBOTextureTarget_h_
28 #define _CEGUIOpenGLESFBOTextureTarget_h_
29 
30 #include "CEGUI/RendererModules/OpenGLES/RenderTarget.h"
31 #include "CEGUI/TextureTarget.h"
32 #include "CEGUI/Rect.h"
33 #include "CEGUI/RendererModules/OpenGLES/GLES.h"
34 
35 #if defined(_MSC_VER)
36 # pragma warning(push)
37 # pragma warning(disable : 4250)
38 #endif
39 
40 // Start of CEGUI namespace section
41 namespace CEGUI
42 {
43 class OpenGLESTexture;
44 
46 class OPENGLES_GUIRENDERER_API OpenGLESFBOTextureTarget :
47  public OpenGLESRenderTarget<TextureTarget>
48 {
49 public:
51  virtual ~OpenGLESFBOTextureTarget();
52 
53  // overrides from OpenGLESRenderTarget
54  void activate();
55  void deactivate();
56  // implementation of RenderTarget interface
57  bool isImageryCache() const;
58  // implementation of TextureTarget interface
59  void clear();
60  Texture& getTexture() const;
61  void declareRenderSize(const Sizef& sz);
62  bool isRenderingInverted() const;
63 
65  static void initializedFBOExtension();
66 
67 protected:
69  static const float DEFAULT_SIZE;
70 
77 
79  GLint d_oldFbo;
81  GLuint d_frameBuffer;
83  GLuint d_texture;
87  static uint s_textureNumber;
88 };
89 
90 } // End of CEGUI namespace section
91 
92 #if defined(_MSC_VER)
93 # pragma warning(pop)
94 #endif
95 
96 #endif // end of guard _CEGUIOpenGLESFBOTextureTarget_h_
CEGUI::OpenGLESFBOTextureTarget::initialiseRenderTexture
void initialiseRenderTexture()
allocate and set up the texture used with the FBO.
CEGUI::OpenGLESFBOTextureTarget::d_oldFbo
GLint d_oldFbo
Saving fbo before activation.
Definition: FBOTextureTarget.h:79
CEGUI::OpenGLESFBOTextureTarget::activate
void activate()
Activate the render target and put it in a state ready to be drawn to.
CEGUI::OpenGLESFBOTextureTarget::getTexture
Texture & getTexture() const
Return a pointer to the CEGUI::Texture that the TextureTarget is using.
CEGUI::OpenGLESFBOTextureTarget::initializedFBOExtension
static void initializedFBOExtension()
initialize FBO extension functions pointers
CEGUI::OpenGLESRenderTarget
Intermediate OpenGLES implementation of a RenderTarget.
Definition: RendererModules/OpenGLES/RenderTarget.h:43
CEGUI::OpenGLESFBOTextureTarget::generateTextureName
String generateTextureName()
generate a texture name
CEGUI::OpenGLESFBOTextureTarget::resizeRenderTexture
void resizeRenderTexture()
resize the texture
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::OpenGLESFBOTextureTarget::isRenderingInverted
bool isRenderingInverted() const
Return whether rendering done on the target texture is inverted in relation to regular textures.
CEGUI::OpenGLESFBOTextureTarget::declareRenderSize
void declareRenderSize(const Sizef &sz)
Used to declare to the TextureTarget the largest size, in pixels, of the next set of incoming renderi...
CEGUI::OpenGLESFBOTextureTarget::s_textureNumber
static uint s_textureNumber
static member var used to generate unique texture names.
Definition: FBOTextureTarget.h:87
CEGUI::OpenGLESFBOTextureTarget::deactivate
void deactivate()
Deactivate the render target after having completed rendering.
CEGUI::Texture
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:54
CEGUI::OpenGLESFBOTextureTarget::d_texture
GLuint d_texture
Associated OpenGLES texture ID.
Definition: FBOTextureTarget.h:83
CEGUI::OpenGLESFBOTextureTarget::isImageryCache
bool isImageryCache() const
Return whether the RenderTarget is an implementation that caches actual rendered imagery.
CEGUI::OpenGLESFBOTextureTarget
OpenGLESFBOTextureTarget - allows rendering to an OpenGLES texture via FBO.
Definition: FBOTextureTarget.h:48
CEGUI::OpenGLESFBOTextureTarget::d_frameBuffer
GLuint d_frameBuffer
Frame buffer object.
Definition: FBOTextureTarget.h:81
CEGUI::OpenGLESRenderer
Renderer class to interface with OpenGLES.
Definition: RendererModules/OpenGLES/Renderer.h:67
CEGUI::Size< float >
CEGUI::String
String class used within the GUI system.
Definition: String.h:64
CEGUI::OpenGLESFBOTextureTarget::d_CEGUITexture
OpenGLESTexture * d_CEGUITexture
we use this to wrap d_texture so it can be used by the core CEGUI lib.
Definition: FBOTextureTarget.h:85
CEGUI::OpenGLESFBOTextureTarget::DEFAULT_SIZE
static const float DEFAULT_SIZE
default size of created texture objects
Definition: FBOTextureTarget.h:69
CEGUI::OpenGLESFBOTextureTarget::clear
void clear()
Clear the surface of the underlying texture.
CEGUI::OpenGLESTexture
Texture implementation for the OpenGLESRenderer.
Definition: RendererModules/OpenGLES/Texture.h:40