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 00109 bool loadIcon(const String &name, Pixmap *pix, Pixmap *mask); 00110 00117 GLXFBConfig getFBConfigFromContext (::GLXContext context); 00118 00128 GLXFBConfig getFBConfigFromDrawable (GLXDrawable drawable, unsigned int *width, unsigned int *height); 00129 00137 GLXFBConfig selectFBConfig(const int *minAttribs, const int *maxAttribs); 00138 00149 GLXFBConfig getFBConfigFromVisualID(VisualID visualid); 00150 00154 GLXFBConfig* chooseFBConfig(const GLint *attribList, GLint *nElements); 00155 00159 ::GLXContext createNewContext(GLXFBConfig fbConfig, GLint renderType, ::GLXContext shareList, GLboolean direct) const; 00160 00164 GLint getFBConfigAttrib(GLXFBConfig fbConfig, GLint attribute, GLint *value); 00165 00169 XVisualInfo* getVisualFromFBConfig(GLXFBConfig fbConfig); 00170 00171 private: 00175 void initialiseGLXEW(void); 00176 00180 void refreshConfig(void); 00181 00182 Display* mGLDisplay; // used for GL/GLX commands 00183 Display* mXDisplay; // used for other X commands and events 00184 bool mIsExternalDisplay; 00185 00186 typedef std::pair<uint, uint> ScreenSize; 00187 typedef short Rate; 00188 typedef std::pair<ScreenSize, Rate> VideoMode; 00189 typedef std::vector<VideoMode> VideoModes; 00190 00191 VideoModes mVideoModes; 00192 VideoMode mOriginalMode; 00193 VideoMode mCurrentMode; 00194 00195 StringVector mSampleLevels; 00196 }; 00197 00198 #if OGRE_THREAD_SUPPORT == 1 00199 GLXEWContext* glxewGetContext(); 00200 #endif 00201 } 00202 00203 #endif // OGRE_GLXGLSupport_H
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:40:43