OgreGLXGLSupport.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 #ifndef OGRE_GLXGLSupport_H
00029 #define OGRE_GLXGLSupport_H
00030 
00031 #include "OgreGL3PlusSupport.h"
00032 
00033 namespace Ogre {
00034 
00035     class _OgrePrivate GLXGLSupport : public GL3PlusSupport
00036     {
00037     public:
00038         GLXGLSupport();
00039         ~GLXGLSupport();
00040 
00041         Atom mAtomDeleteWindow;
00042         Atom mAtomFullScreen;
00043         Atom mAtomState;
00044 
00046         void addConfig(void);
00047 
00049         String validateConfig(void);
00050 
00052         void setConfigOption(const String &name, const String &value);
00053 
00055         RenderWindow* createWindow(bool autoCreateWindow, GL3PlusRenderSystem* renderSystem, const String& windowTitle);
00056 
00058         RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height,
00059                                 bool fullScreen, const NameValuePairList *miscParams = 0);
00060 
00062         void start();
00063 
00065         void stop();
00066 
00068         void initialiseExtensions();
00069 
00071         void* getProcAddress(const String& procname);
00072 
00073         // The remaining functions are internal to the GLX Rendersystem:
00074 
00088         String getDisplayName (void);
00089 
00097         Display* getGLDisplay(void);
00098 
00104         Display* getXDisplay(void);
00105 
00113         void switchMode (uint& width, uint& height, short& frequency);
00114 
00118         void switchMode (void);
00119 
00131         bool loadIcon(const String &name, Pixmap *pix, Pixmap *mask);
00132 
00139         GLXFBConfig getFBConfigFromContext (::GLXContext context);
00140 
00150         GLXFBConfig getFBConfigFromDrawable (GLXDrawable drawable, unsigned int *width, unsigned int *height);
00151 
00159         GLXFBConfig selectFBConfig(const int *minAttribs, const int *maxAttribs);
00160 
00171         GLXFBConfig getFBConfigFromVisualID(VisualID visualid);
00172 
00176         GLXFBConfig* chooseFBConfig(const GLint *attribList, GLint *nElements);
00177 
00181         ::GLXContext createNewContext(GLXFBConfig fbConfig, GLint renderType, ::GLXContext shareList, GLboolean direct) const;
00182 
00186         GLint getFBConfigAttrib(GLXFBConfig fbConfig, GLint attribute, GLint *value);
00187 
00191         XVisualInfo* getVisualFromFBConfig(GLXFBConfig fbConfig);
00192 
00193         private:
00194 
00198         void refreshConfig(void);
00199 
00200         Display* mGLDisplay; // used for GL/GLX commands
00201         Display* mXDisplay;  // used for other X commands and events
00202         bool mIsExternalDisplay;
00203 
00204         typedef std::pair<uint, uint>      ScreenSize;
00205         typedef short                      Rate;
00206         typedef std::pair<ScreenSize, Rate> VideoMode;
00207         typedef std::vector<VideoMode>    VideoModes;
00208 
00209         VideoModes mVideoModes;
00210         VideoMode  mOriginalMode;
00211         VideoMode  mCurrentMode;
00212 
00213         StringVector mSampleLevels;
00214     };
00215 }
00216 
00217 #endif // OGRE_GLXGLSupport_H

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:43