[657] | 1 | #ifndef OGRE_GLSUPPORT_H
|
---|
| 2 | #define OGRE_GLSUPPORT_H
|
---|
| 3 |
|
---|
| 4 | #include "OgreGLPrerequisites.h"
|
---|
| 5 | #include "OgreGLRenderSystem.h"
|
---|
| 6 |
|
---|
| 7 | #include "OgreRenderWindow.h"
|
---|
| 8 | #include "OgreConfigOptionMap.h"
|
---|
| 9 |
|
---|
| 10 | namespace Ogre
|
---|
| 11 | {
|
---|
| 12 |
|
---|
| 13 | class GLSupport
|
---|
| 14 | {
|
---|
| 15 | public:
|
---|
| 16 | GLSupport() { }
|
---|
| 17 | virtual ~GLSupport() { }
|
---|
| 18 |
|
---|
| 19 | /**
|
---|
| 20 | * Add any special config values to the system.
|
---|
| 21 | * Must have a "Full Screen" value that is a bool and a "Video Mode" value
|
---|
| 22 | * that is a string in the form of wxh
|
---|
| 23 | */
|
---|
| 24 | virtual void addConfig() = 0;
|
---|
| 25 |
|
---|
| 26 | virtual void setConfigOption(const String &name, const String &value);
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * Make sure all the extra options are valid
|
---|
| 30 | * @return string with error message
|
---|
| 31 | */
|
---|
| 32 | virtual String validateConfig() = 0;
|
---|
| 33 |
|
---|
| 34 | virtual ConfigOptionMap& getConfigOptions(void);
|
---|
| 35 |
|
---|
| 36 | virtual RenderWindow* createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle) = 0;
|
---|
| 37 |
|
---|
| 38 | /// @copydoc RenderSystem::createRenderWindow
|
---|
| 39 | virtual RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height,
|
---|
| 40 | bool fullScreen, const NameValuePairList *miscParams = 0) = 0;
|
---|
| 41 |
|
---|
| 42 | /// @copydoc RenderSystem::createRenderTexture
|
---|
| 43 | virtual RenderTexture * createRenderTexture( const String & name, unsigned int width, unsigned int height,
|
---|
| 44 | TextureType texType = TEX_TYPE_2D, PixelFormat internalFormat = PF_X8R8G8B8,
|
---|
| 45 | const NameValuePairList *miscParams = 0 );
|
---|
| 46 |
|
---|
| 47 | /**
|
---|
| 48 | * Start anything special
|
---|
| 49 | */
|
---|
| 50 | virtual void start() = 0;
|
---|
| 51 | /**
|
---|
| 52 | * Stop anything special
|
---|
| 53 | */
|
---|
| 54 | virtual void stop() = 0;
|
---|
| 55 |
|
---|
| 56 | /**
|
---|
| 57 | * get vendor information
|
---|
| 58 | */
|
---|
| 59 | const String& getGLVendor(void) const
|
---|
| 60 | {
|
---|
| 61 | return mVendor;
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | /**
|
---|
| 65 | * get version information
|
---|
| 66 | */
|
---|
| 67 | const String& getGLVersion(void) const
|
---|
| 68 | {
|
---|
| 69 | return mVersion;
|
---|
| 70 | }
|
---|
| 71 |
|
---|
| 72 | /**
|
---|
| 73 | * compare GL version numbers
|
---|
| 74 | */
|
---|
| 75 | bool checkMinGLVersion(const String& v) const;
|
---|
| 76 |
|
---|
| 77 | /**
|
---|
| 78 | * Check if an extension is available
|
---|
| 79 | */
|
---|
| 80 | virtual bool checkExtension(const String& ext) const;
|
---|
| 81 | /**
|
---|
| 82 | * Get the address of a function
|
---|
| 83 | */
|
---|
| 84 | virtual void* getProcAddress(const String& procname) = 0;
|
---|
| 85 |
|
---|
| 86 | /** Intialises GL extensions, must be done AFTER the GL context has been
|
---|
| 87 | established.
|
---|
| 88 | */
|
---|
| 89 | virtual void initialiseExtensions();
|
---|
| 90 |
|
---|
| 91 | /** GLsupport specific capabilities (hardware render-to-texture, being one of
|
---|
| 92 | them) are marked in caps.
|
---|
| 93 | */
|
---|
| 94 | virtual void initialiseCapabilities(RenderSystemCapabilities &caps);
|
---|
| 95 |
|
---|
| 96 | protected:
|
---|
| 97 | // Stored options
|
---|
| 98 | ConfigOptionMap mOptions;
|
---|
| 99 |
|
---|
| 100 | // This contains the complete list of supported extensions
|
---|
| 101 | std::set<String> extensionList;
|
---|
| 102 | private:
|
---|
| 103 | String mVersion;
|
---|
| 104 | String mVendor;
|
---|
| 105 |
|
---|
| 106 | }; // class GLSupport
|
---|
| 107 |
|
---|
| 108 | }; // namespace Ogre
|
---|
| 109 |
|
---|
| 110 | #endif // OGRE_GLSUPPORT_H
|
---|