OgreGLES2Support.h
Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright (c) 2000-2013 Torus Knot Software Ltd
00008 
00009 Permission is hereby granted, free of charge, to any person obtaining a copy
00010 of this software and associated documentation files (the "Software"), to deal
00011 in the Software without restriction, including without limitation the rights
00012 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00013 copies of the Software, and to permit persons to whom the Software is
00014 furnished to do so, subject to the following conditions:
00015 
00016 The above copyright notice and this permission notice shall be included in
00017 all copies or substantial portions of the Software.
00018 
00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00021 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00022 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00023 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00024 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00025 THE SOFTWARE.
00026 -----------------------------------------------------------------------------
00027 */
00028 
00029 #ifndef __GLES2Support_H__
00030 #define __GLES2Support_H__
00031 
00032 #include "OgreGLES2Prerequisites.h"
00033 #include "OgreRenderWindow.h"
00034 #include "OgreConfigOptionMap.h"
00035 
00036 namespace Ogre
00037 {
00038     class GLES2RenderSystem;
00039     class GLES2StateCacheManager;
00040 
00041     class _OgreGLES2Export GLES2Support
00042     {
00043         public:
00044             GLES2Support() : mStateCacheMgr(0)  { }
00045             virtual ~GLES2Support() { }
00046 
00052             virtual void addConfig() = 0;
00053             virtual void setConfigOption(const String &name, const String &value);
00054 
00059             virtual String validateConfig() = 0;
00060             virtual ConfigOptionMap& getConfigOptions(void);
00061             virtual RenderWindow* createWindow(bool autoCreateWindow,
00062                                                GLES2RenderSystem *renderSystem,
00063                                                const String& windowTitle) = 0;
00064 
00066             virtual RenderWindow* newWindow(const String &name,
00067                                             unsigned int width, unsigned int height,
00068                                             bool fullScreen,
00069                                             const NameValuePairList *miscParams = 0) = 0;
00070 
00074             const String& getGLVendor(void) const
00075             {
00076                 return mVendor;
00077             }
00078 
00082             const String& getGLVersion(void) const
00083             {
00084                 return mVersion;
00085             }
00086 
00090             const String& getShaderCachePath(void) const
00091             {
00092                 return mShaderCachePath;
00093             }
00094 
00098             const String& getShaderLibraryPath(void) const
00099             {
00100                 return mShaderLibraryPath;
00101             }
00102 
00106             void setShaderCachePath(String path)
00107             {
00108                 mShaderCachePath = path;
00109             }
00110 
00114             void setShaderLibraryPath(String path)
00115             {
00116                 mShaderLibraryPath = path;
00117             }
00118 
00122             virtual void *getProcAddress(const String& procname) = 0;
00123 
00127             virtual void initialiseExtensions();
00128 
00132             virtual bool checkExtension(const String& ext) const;
00133 
00135             virtual unsigned int getDisplayMonitorCount() const
00136             {
00137                 return 1;
00138             }
00139 
00143             GLES2StateCacheManager* getStateCacheManager() const
00144             {
00145                 return mStateCacheMgr;
00146             }
00147         
00151             void setStateCacheManager(GLES2StateCacheManager* stateCacheMgr)
00152             {
00153                 mStateCacheMgr = stateCacheMgr;
00154             }
00155             
00159             virtual void start() = 0;
00163             virtual void stop() = 0;
00164 
00165         private:
00166             String mVersion;
00167             String mVendor;
00168             String mShaderCachePath;
00169             String mShaderLibraryPath;
00170 
00171         protected:
00172             // Stored options
00173             ConfigOptionMap mOptions;
00174 
00175             // This contains the complete list of supported extensions
00176             set<String>::type extensionList;
00177             
00178             // State cache management
00179             GLES2StateCacheManager* mStateCacheMgr;
00180     };
00181 
00182 }
00183 
00184 #endif

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:40:42