OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
include/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 "OgreGLSupport.h"
32 
33 #include <GL/glew.h>
34 #include <GL/glxew.h>
35 
36 namespace Ogre {
37 
39  {
40  public:
41  GLXGLSupport();
42  ~GLXGLSupport();
43 
46  Atom mAtomState;
47 
49  void addConfig(void);
50 
52  String validateConfig(void);
53 
55  void setConfigOption(const String &name, const String &value);
56 
58  RenderWindow* createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle);
59 
61  RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height,
62  bool fullScreen, const NameValuePairList *miscParams = 0);
63 
65  GLPBuffer* createPBuffer(PixelComponentType format, size_t width, size_t height);
66 
68  void start();
69 
71  void stop();
72 
74  void initialiseExtensions();
75 
77  void* getProcAddress(const String& procname);
78 
79  // The remaining functions are internal to the GLX Rendersystem:
80 
94  String getDisplayName (void);
95 
103  Display* getGLDisplay(void);
104 
110  Display* getXDisplay(void);
111 
119  void switchMode (uint& width, uint& height, short& frequency);
120 
124  void switchMode (void);
125 
136  bool loadIcon(const String &name, Pixmap *pix, Pixmap *mask);
137 
144  GLXFBConfig getFBConfigFromContext (::GLXContext context);
145 
155  GLXFBConfig getFBConfigFromDrawable (GLXDrawable drawable, unsigned int *width, unsigned int *height);
156 
164  GLXFBConfig selectFBConfig(const int *minAttribs, const int *maxAttribs);
165 
176  GLXFBConfig getFBConfigFromVisualID(VisualID visualid);
177 
181  GLXFBConfig* chooseFBConfig(const GLint *attribList, GLint *nElements);
182 
186  ::GLXContext createNewContext(GLXFBConfig fbConfig, GLint renderType, ::GLXContext shareList, GLboolean direct) const;
187 
191  GLint getFBConfigAttrib(GLXFBConfig fbConfig, GLint attribute, GLint *value);
192 
196  XVisualInfo* getVisualFromFBConfig(GLXFBConfig fbConfig);
197 
198  private:
202  void initialiseGLXEW(void);
203 
207  void refreshConfig(void);
208 
209  Display* mGLDisplay; // used for GL/GLX commands
210  Display* mXDisplay; // used for other X commands and events
212 
213  typedef std::pair<uint, uint> ScreenSize;
214  typedef short Rate;
215  typedef std::pair<ScreenSize, Rate> VideoMode;
216  typedef std::vector<VideoMode> VideoModes;
217 
221 
223  };
224 
225 #if OGRE_THREAD_SUPPORT == 1
226  GLXEWContext* glxewGetContext();
227 #endif
228 }
229 
230 #endif // OGRE_GLXGLSupport_H
std::pair< ScreenSize, Rate > VideoMode
Manages the target rendering window.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:580
std::pair< uint, uint > ScreenSize
PixelComponentType
Pixel component format.
#define _OgrePrivate
Definition: OgrePlatform.h:256
std::vector< VideoMode > VideoModes
vector< String >::type StringVector
An off-screen rendering context.
Definition: OgreGLPBuffer.h:38
_StringBase String
Definition: OgreCommon.h:53
Implementation of GL as a rendering system.
unsigned int uint