OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Plus/include/windowing/GLX/OgreGLXGLSupport.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_GLXGLSupport_H
29 #define OGRE_GLXGLSupport_H
30 
31 #include "OgreGL3PlusSupport.h"
32 
33 namespace Ogre {
34 
35  class _OgrePrivate GLXGLSupport : public GL3PlusSupport
36  {
37  public:
38  GLXGLSupport();
39  ~GLXGLSupport();
40 
41  Atom mAtomDeleteWindow;
42  Atom mAtomFullScreen;
43  Atom mAtomState;
44 
46  void addConfig(void);
47 
49  String validateConfig(void);
50 
52  void setConfigOption(const String &name, const String &value);
53 
55  RenderWindow* createWindow(bool autoCreateWindow, GL3PlusRenderSystem* renderSystem, const String& windowTitle);
56 
58  RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height,
59  bool fullScreen, const NameValuePairList *miscParams = 0);
60 
62  void start();
63 
65  void stop();
66 
68  void initialiseExtensions();
69 
71  void* getProcAddress(const String& procname);
72 
73  // The remaining functions are internal to the GLX Rendersystem:
74 
88  String getDisplayName (void);
89 
97  Display* getGLDisplay(void);
98 
104  Display* getXDisplay(void);
105 
113  void switchMode (uint& width, uint& height, short& frequency);
114 
118  void switchMode (void);
119 
131  bool loadIcon(const String &name, Pixmap *pix, Pixmap *mask);
132 
139  GLXFBConfig getFBConfigFromContext (::GLXContext context);
140 
150  GLXFBConfig getFBConfigFromDrawable (GLXDrawable drawable, unsigned int *width, unsigned int *height);
151 
159  GLXFBConfig selectFBConfig(const int *minAttribs, const int *maxAttribs);
160 
171  GLXFBConfig getFBConfigFromVisualID(VisualID visualid);
172 
176  GLXFBConfig* chooseFBConfig(const GLint *attribList, GLint *nElements);
177 
181  ::GLXContext createNewContext(GLXFBConfig fbConfig, GLint renderType, ::GLXContext shareList, GLboolean direct) const;
182 
186  GLint getFBConfigAttrib(GLXFBConfig fbConfig, GLint attribute, GLint *value);
187 
191  XVisualInfo* getVisualFromFBConfig(GLXFBConfig fbConfig);
192 
193  private:
194 
198  void refreshConfig(void);
199 
200  Display* mGLDisplay; // used for GL/GLX commands
201  Display* mXDisplay; // used for other X commands and events
202  bool mIsExternalDisplay;
203 
204  typedef std::pair<uint, uint> ScreenSize;
205  typedef short Rate;
206  typedef std::pair<ScreenSize, Rate> VideoMode;
207  typedef std::vector<VideoMode> VideoModes;
208 
209  VideoModes mVideoModes;
210  VideoMode mOriginalMode;
211  VideoMode mCurrentMode;
212 
213  StringVector mSampleLevels;
214  };
215 }
216 
217 #endif // OGRE_GLXGLSupport_H
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:580
#define _OgrePrivate
Definition: OgrePlatform.h:256
vector< String >::type StringVector
_StringBase String
Definition: OgreCommon.h:53
unsigned int uint