Crazy Eddie's GUI System
0.8.4
|
00001 /*********************************************************************** 00002 created: Sun Jan 11 2009 00003 authors: Paul D Turner <paul@cegui.org.uk> 00004 Lukas E Meindl 00005 *************************************************************************/ 00006 /*************************************************************************** 00007 * Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team 00008 * 00009 * Permission is hereby granted, free of charge, to any person obtaining 00010 * a copy of this software and associated documentation files (the 00011 * "Software"), to deal in the Software without restriction, including 00012 * without limitation the rights to use, copy, modify, merge, publish, 00013 * distribute, sublicense, and/or sell copies of the Software, and to 00014 * permit persons to whom the Software is furnished to do so, subject to 00015 * the following conditions: 00016 * 00017 * The above copyright notice and this permission notice shall be 00018 * included in all copies or substantial portions of the Software. 00019 * 00020 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00021 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00022 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00023 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00024 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00025 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00026 * OTHER DEALINGS IN THE SOFTWARE. 00027 ***************************************************************************/ 00028 #ifndef _CEGUIOpenGLRenderer_h_ 00029 #define _CEGUIOpenGLRenderer_h_ 00030 00031 #include "RendererBase.h" 00032 00033 namespace CEGUI 00034 { 00039 class OPENGL_GUIRENDERER_API OpenGLRenderer : public OpenGLRendererBase 00040 { 00041 public: 00043 enum TextureTargetType 00044 { 00046 TTT_AUTO, 00048 TTT_FBO, 00050 TTT_PBUFFER, 00052 TTT_NONE 00053 }; 00054 00078 static OpenGLRenderer& bootstrapSystem( 00079 const TextureTargetType tt_type = TTT_AUTO, 00080 const int abi = CEGUI_VERSION_ABI); 00081 00108 static OpenGLRenderer& bootstrapSystem(const Sizef& display_size, 00109 const TextureTargetType tt_type = TTT_AUTO, 00110 const int abi = CEGUI_VERSION_ABI); 00111 00127 static void destroySystem(); 00128 00140 static OpenGLRenderer& create(const TextureTargetType tt_type = TTT_AUTO, 00141 const int abi = CEGUI_VERSION_ABI); 00142 00157 static OpenGLRenderer& create(const Sizef& display_size, 00158 const TextureTargetType tt_type = TTT_AUTO, 00159 const int abi = CEGUI_VERSION_ABI); 00160 00168 static void destroy(OpenGLRenderer& renderer); 00169 00170 // base class overrides / abstract function implementations 00171 void beginRendering(); 00172 void endRendering(); 00173 bool isS3TCSupported() const; 00174 void setupRenderingBlendMode(const BlendMode mode, 00175 const bool force = false); 00176 void setViewProjectionMatrix(const mat4Pimpl* viewProjectionMatrix); 00177 00178 protected: 00179 OpenGLGeometryBufferBase* createGeometryBuffer_impl(); 00180 TextureTarget* createTextureTarget_impl(); 00181 00183 void initialiseRendererIDString(); 00184 00193 OpenGLRenderer(const TextureTargetType tt_type); 00194 00206 OpenGLRenderer(const Sizef& display_size, const TextureTargetType tt_type); 00207 00212 virtual ~OpenGLRenderer(); 00213 00215 void setupExtraStates(); 00216 00218 void cleanupExtraStates(); 00219 00221 void initialiseTextureTargetFactory(const TextureTargetType tt_type); 00222 00223 void initialiseGLExtensions(); 00224 00226 OGLTextureTargetFactory* d_textureTargetFactory; 00227 }; 00228 00229 } 00230 00231 #endif 00232