Crazy Eddie's GUI System  0.8.5
GL3Renderer.h
1 /***********************************************************************
2  created: Wed, 8th Feb 2012
3  author: Lukas E Meindl (based on code by Paul D Turner)
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2012 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 _CEGUIOpenGL3Renderer_h_
28 #define _CEGUIOpenGL3Renderer_h_
29 
30 #include "RendererBase.h"
31 
32 namespace CEGUI
33 {
34  class OpenGL3Shader;
35  class OpenGL3ShaderManager;
36  class OpenGL3StateChangeWrapper;
37 
54 class OPENGL_GUIRENDERER_API OpenGL3Renderer : public OpenGLRendererBase
55 {
56 public:
76  static OpenGL3Renderer& bootstrapSystem(const int abi = CEGUI_VERSION_ABI);
77 
100  static OpenGL3Renderer& bootstrapSystem(const Sizef& display_size,
101  const int abi = CEGUI_VERSION_ABI);
102 
118  static void destroySystem();
119 
131  static OpenGL3Renderer& create(const int abi = CEGUI_VERSION_ABI);
132 
147  static OpenGL3Renderer& create(const Sizef& display_size,
148  const int abi = CEGUI_VERSION_ABI);
149 
157  static void destroy(OpenGL3Renderer& renderer);
158 
167  OpenGL3Shader*& getShaderStandard();
168 
177  GLint getShaderStandardPositionLoc();
178 
179 
189  GLint getShaderStandardTexCoordLoc();
190 
191 
200  GLint getShaderStandardColourLoc();
201 
210  GLint getShaderStandardMatrixUniformLoc();
211 
220  OpenGL3StateChangeWrapper* getOpenGLStateChanger();
221 
222  // base class overrides / abstract function implementations
223  void beginRendering();
224  void endRendering();
225  Sizef getAdjustedTextureSize(const Sizef& sz) const;
226  bool isS3TCSupported() const;
227  void setupRenderingBlendMode(const BlendMode mode,
228  const bool force = false);
229 
230 private:
232  OpenGLGeometryBufferBase* createGeometryBuffer_impl();
233  TextureTarget* createTextureTarget_impl();
234 
235  void initialiseRendererIDString();
236 
241  OpenGL3Renderer();
242 
250  OpenGL3Renderer(const Sizef& display_size);
251 
252  void init();
253 
254  void initialiseOpenGLShaders();
255 
256 protected:
261  virtual ~OpenGL3Renderer();
262 
263 private:
265  void initialiseTextureTargetFactory();
266 
268  void setupExtraStates();
269 
271  OpenGL3Shader* d_shaderStandard;
273  GLint d_shaderStandardPosLoc;
275  GLint d_shaderStandardTexCoordLoc;
277  GLint d_shaderStandardColourLoc;
279  GLint d_shaderStandardMatrixLoc;
281  OpenGL3StateChangeWrapper* d_openGLStateChanger;
283  OpenGL3ShaderManager* d_shaderManager;
285  bool d_s3tcSupported;
287  OGLTextureTargetFactory* d_textureTargetFactory;
288 };
289 
290 }
291 
292 #endif
293 
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Specialisation of RenderTarget interface that should be used as the base class for RenderTargets that...
Definition: TextureTarget.h:40
Definition: Shader.h:43
OpenGL based implementation of the GeometryBuffer interface.
Definition: GeometryBufferBase.h:52
Renderer class to interface with desktop OpenGL version >= 3.2 or OpenGL ES version >= 2...
Definition: GL3Renderer.h:54
OpenGL3StateChangeWrapper - wraps OpenGL calls and checks for redundant calls beforehand.
Definition: StateChangeWrapper.h:47
BlendMode
Enumerated type that contains the valid options that specify the type of blending that is to be perfo...
Definition: Renderer.h:61
Definition: RendererBase.h:309
Common base class used for other OpenGL (desktop or ES) based renderer modules.
Definition: RendererBase.h:53
Definition: ShaderManager.h:54