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 
72  void initialiseRenderTexture();
74  void resizeRenderTexture();
76  String generateTextureName();
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_
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Renderer class to interface with OpenGLES.
Definition: RendererModules/OpenGLES/Renderer.h:66
GLint d_oldFbo
Saving fbo before activation.
Definition: FBOTextureTarget.h:79
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:52
GLuint d_texture
Associated OpenGLES texture ID.
Definition: FBOTextureTarget.h:83
static const float DEFAULT_SIZE
default size of created texture objects
Definition: FBOTextureTarget.h:69
Intermediate OpenGLES implementation of a RenderTarget.
Definition: RendererModules/OpenGLES/RenderTarget.h:42
static uint s_textureNumber
static member var used to generate unique texture names.
Definition: FBOTextureTarget.h:87
OpenGLESTexture * d_CEGUITexture
we use this to wrap d_texture so it can be used by the core CEGUI lib.
Definition: FBOTextureTarget.h:85
OpenGLESFBOTextureTarget - allows rendering to an OpenGLES texture via FBO.
Definition: FBOTextureTarget.h:46
Texture implementation for the OpenGLESRenderer.
Definition: RendererModules/OpenGLES/Texture.h:39
GLuint d_frameBuffer
Frame buffer object.
Definition: FBOTextureTarget.h:81
String class used within the GUI system.
Definition: String.h:62