OgreGLXGLSupport.h
Go to the documentation of this file.
00001 #ifndef OGRE_GLXGLSupport_H
00002 #define OGRE_GLXGLSupport_H
00003 
00004 #include "OgreGLSupport.h"
00005 
00006 #include <GL/glew.h>
00007 #include <GL/glxew.h>
00008 
00009 namespace Ogre {
00010 
00011     class _OgrePrivate GLXGLSupport : public GLSupport
00012     {
00013     public:
00014         GLXGLSupport();
00015         ~GLXGLSupport();
00016         
00017         Atom mAtomDeleteWindow;
00018         Atom mAtomFullScreen;
00019         Atom mAtomState;
00020         
00022         void addConfig(void);
00023         
00025         String validateConfig(void);
00026         
00028         void setConfigOption(const String &name, const String &value);
00029         
00031         RenderWindow* createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle);
00032         
00034         RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height, 
00035                                 bool fullScreen, const NameValuePairList *miscParams = 0);
00036         
00038         GLPBuffer* createPBuffer(PixelComponentType format, size_t width, size_t height);
00039         
00041         void start();
00042         
00044         void stop();
00045         
00047         void initialiseExtensions();
00048         
00050         void* getProcAddress(const String& procname);
00051         
00052         // The remaining functions are internal to the GLX Rendersystem:
00053         
00067         String getDisplayName (void);
00068         
00076         Display* getGLDisplay(void);
00077         
00083         Display* getXDisplay(void);
00084         
00092         void switchMode (uint& width, uint& height, short& frequency);
00093         
00097         void switchMode (void);
00098         
00110         bool loadIcon(const std::string &name, Pixmap *pix, Pixmap *mask);
00111         
00118         GLXFBConfig getFBConfigFromContext (::GLXContext context);
00119         
00129         GLXFBConfig getFBConfigFromDrawable (GLXDrawable drawable, unsigned int *width, unsigned int *height);
00130         
00139         GLXFBConfig selectFBConfig(const int *minAttribs, const int *maxAttribs);
00140         
00151         GLXFBConfig getFBConfigFromVisualID(VisualID visualid);
00152         
00156         GLXFBConfig* chooseFBConfig(const GLint *attribList, GLint *nElements);
00157         
00161         ::GLXContext createNewContext(GLXFBConfig fbConfig, GLint renderType, ::GLXContext shareList, GLboolean direct) const;
00162         
00166         GLint getFBConfigAttrib(GLXFBConfig fbConfig, GLint attribute, GLint *value);
00167         
00171         XVisualInfo* getVisualFromFBConfig(GLXFBConfig fbConfig);
00172         
00173         private:
00177         void initialiseGLXEW(void);
00178         
00182         void refreshConfig(void);
00183         
00184         Display* mGLDisplay; // used for GL/GLX commands
00185         Display* mXDisplay;  // used for other X commands and events
00186         bool mIsExternalDisplay;
00187         
00188         typedef std::pair<uint, uint>      ScreenSize;
00189         typedef short                      Rate;
00190         typedef std::pair<ScreenSize, Rate> VideoMode;
00191         typedef std::vector<VideoMode>    VideoModes;
00192         
00193         VideoModes mVideoModes;
00194         VideoMode  mOriginalMode;
00195         VideoMode  mCurrentMode;
00196         
00197         StringVector mSampleLevels;
00198     };
00199 }
00200 
00201 #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 Sun Sep 2 2012 07:27:22