Crazy Eddie's GUI System
0.8.4
|
00001 /*********************************************************************** 00002 created: Wed, 8th Feb 2012 00003 author: Lukas E Meindl (based on code by Paul D Turner) 00004 *************************************************************************/ 00005 /*************************************************************************** 00006 * Copyright (C) 2004 - 2012 Paul D Turner & The CEGUI Development Team 00007 * 00008 * Permission is hereby granted, free of charge, to any person obtaining 00009 * a copy of this software and associated documentation files (the 00010 * "Software"), to deal in the Software without restriction, including 00011 * without limitation the rights to use, copy, modify, merge, publish, 00012 * distribute, sublicense, and/or sell copies of the Software, and to 00013 * permit persons to whom the Software is furnished to do so, subject to 00014 * the following conditions: 00015 * 00016 * The above copyright notice and this permission notice shall be 00017 * included in all copies or substantial portions of the Software. 00018 * 00019 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00020 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00021 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00022 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00023 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00024 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00025 * OTHER DEALINGS IN THE SOFTWARE. 00026 ***************************************************************************/ 00027 #ifndef _CEGUIOpenGL3Renderer_h_ 00028 #define _CEGUIOpenGL3Renderer_h_ 00029 00030 #include "RendererBase.h" 00031 00032 namespace CEGUI 00033 { 00034 class OpenGL3Shader; 00035 class OpenGL3ShaderManager; 00036 class OpenGL3StateChangeWrapper; 00037 00042 class OPENGL_GUIRENDERER_API OpenGL3Renderer : public OpenGLRendererBase 00043 { 00044 public: 00064 static OpenGL3Renderer& bootstrapSystem(const int abi = CEGUI_VERSION_ABI); 00065 00088 static OpenGL3Renderer& bootstrapSystem(const Sizef& display_size, 00089 const int abi = CEGUI_VERSION_ABI); 00090 00106 static void destroySystem(); 00107 00119 static OpenGL3Renderer& create(const int abi = CEGUI_VERSION_ABI); 00120 00135 static OpenGL3Renderer& create(const Sizef& display_size, 00136 const int abi = CEGUI_VERSION_ABI); 00137 00145 static void destroy(OpenGL3Renderer& renderer); 00146 00155 OpenGL3Shader*& getShaderStandard(); 00156 00165 GLint getShaderStandardPositionLoc(); 00166 00167 00177 GLint getShaderStandardTexCoordLoc(); 00178 00179 00188 GLint getShaderStandardColourLoc(); 00189 00198 GLint getShaderStandardMatrixUniformLoc(); 00199 00208 OpenGL3StateChangeWrapper* getOpenGLStateChanger(); 00209 00210 // base class overrides / abstract function implementations 00211 void beginRendering(); 00212 void endRendering(); 00213 Sizef getAdjustedTextureSize(const Sizef& sz) const; 00214 bool isS3TCSupported() const; 00215 void setupRenderingBlendMode(const BlendMode mode, 00216 const bool force = false); 00217 00218 private: 00219 OpenGLGeometryBufferBase* createGeometryBuffer_impl(); 00220 TextureTarget* createTextureTarget_impl(); 00221 00222 void initialiseRendererIDString(); 00223 00232 OpenGL3Renderer(); 00233 00245 OpenGL3Renderer(const Sizef& display_size); 00246 00247 void initialiseOpenGLShaders(); 00248 void initialiseGLExtensions(); 00249 00254 virtual ~OpenGL3Renderer(); 00255 00257 void initialiseTextureTargetFactory(); 00258 00260 void setupExtraStates(); 00261 00263 OpenGL3Shader* d_shaderStandard; 00265 GLint d_shaderStandardPosLoc; 00267 GLint d_shaderStandardTexCoordLoc; 00269 GLint d_shaderStandardColourLoc; 00271 GLint d_shaderStandardMatrixLoc; 00273 OpenGL3StateChangeWrapper* d_openGLStateChanger; 00274 OpenGL3ShaderManager* d_shaderManager; 00276 bool d_s3tcSupported; 00278 OGLTextureTargetFactory* d_textureTargetFactory; 00279 }; 00280 00281 } 00282 00283 #endif 00284