OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreGLSupport.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef OGRE_GLSUPPORT_H
29 #define OGRE_GLSUPPORT_H
30 
31 #include "OgreGLPrerequisites.h"
32 #include "OgreGLRenderSystem.h"
33 
34 #include "OgreRenderWindow.h"
35 #include "OgreConfigOptionMap.h"
36 #include "OgreGLPBuffer.h"
37 
38 namespace Ogre
39 {
40 
41 class GLStateCacheManager;
42 
44 {
45 public:
46  GLSupport() { }
47  virtual ~GLSupport() { }
48 
54  virtual void addConfig() = 0;
55 
56  virtual void setConfigOption(const String &name, const String &value);
57 
62  virtual String validateConfig() = 0;
63 
64  virtual ConfigOptionMap& getConfigOptions(void);
65 
66  virtual RenderWindow* createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle) = 0;
67 
69  virtual RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height,
70  bool fullScreen, const NameValuePairList *miscParams = 0) = 0;
71 
72  virtual bool supportsPBuffers();
73  virtual GLPBuffer *createPBuffer(PixelComponentType format, size_t width, size_t height);
74 
76  {
77  return mStateCacheManager;
78  }
79 
81  {
82  mStateCacheManager = stateCacheMgr;
83  }
84 
88  virtual void start() = 0;
92  virtual void stop() = 0;
93 
97  const String& getGLVendor(void) const
98  {
99  return mVendor;
100  }
101 
105  const String& getGLVersion(void) const
106  {
107  return mVersion;
108  }
109 
113  bool checkMinGLVersion(const String& v) const;
114 
118  virtual bool checkExtension(const String& ext) const;
122  virtual void* getProcAddress(const String& procname) = 0;
123 
127  virtual void initialiseExtensions();
128 
130  virtual unsigned int getDisplayMonitorCount() const
131  {
132  return 1;
133  }
134 
135 protected:
136  // Stored options
138 
139  // This contains the complete list of supported extensions
141 private:
144 
146 
147 }; // class GLSupport
148 
149 } // namespace Ogre
150 
151 #endif // OGRE_GLSUPPORT_H
Manages the target rendering window.
GLStateCacheManager * getStateCacheManager() const
Definition: OgreGLSupport.h:75
virtual unsigned int getDisplayMonitorCount() const
Gets the number of display monitors.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:580
const String & getGLVendor(void) const
Get vendor information.
Definition: OgreGLSupport.h:97
void setStateCacheManager(GLStateCacheManager *stateCacheMgr)
Definition: OgreGLSupport.h:80
#define _OgreGLExport
virtual ~GLSupport()
Definition: OgreGLSupport.h:47
PixelComponentType
Pixel component format.
GLStateCacheManager * mStateCacheManager
set< String >::type extensionList
map< String, ConfigOption >::type ConfigOptionMap
An off-screen rendering context.
Definition: OgreGLPBuffer.h:38
ConfigOptionMap mOptions
_StringBase String
Definition: OgreCommon.h:53
const String & getGLVersion(void) const
Get version information.
Implementation of GL as a rendering system.
An in memory cache of the OpenGL state.