OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ogre::GLXGLSupport Class Reference

#include <OgreGLXGLSupport.h>

+ Inheritance diagram for Ogre::GLXGLSupport:
+ Collaboration diagram for Ogre::GLXGLSupport:

Public Member Functions

 GLXGLSupport ()
 
 ~GLXGLSupport ()
 
void addConfig (void)
 GLSupport::addConfig More...
 
virtual bool checkExtension (const String &ext) const
 Check if an extension is available. More...
 
bool checkMinGLVersion (const String &v) const
 Compare GL version numbers. More...
 
GLXFBConfig * chooseFBConfig (const GLint *attribList, GLint *nElements)
 Portable replacement for glXChooseFBConfig. More...
 
::GLXContext createNewContext (GLXFBConfig fbConfig, GLint renderType,::GLXContext shareList, GLboolean direct) const
 Portable replacement for glXCreateNewContext. More...
 
GLPBuffercreatePBuffer (PixelComponentType format, size_t width, size_t height)
 
RenderWindowcreateWindow (bool autoCreateWindow, GLRenderSystem *renderSystem, const String &windowTitle)
 
virtual ConfigOptionMapgetConfigOptions (void)
 
virtual unsigned int getDisplayMonitorCount () const
 Gets the number of display monitors. More...
 
String getDisplayName (void)
 Get the name of the display and screen used for rendering. More...
 
GLint getFBConfigAttrib (GLXFBConfig fbConfig, GLint attribute, GLint *value)
 Portable replacement for glXGetFBConfigAttrib. More...
 
GLXFBConfig getFBConfigFromContext (::GLXContext context)
 Get the GLXFBConfig used to create a ::GLXContext. More...
 
GLXFBConfig getFBConfigFromDrawable (GLXDrawable drawable, unsigned int *width, unsigned int *height)
 Get the GLXFBConfig used to create a GLXDrawable. More...
 
GLXFBConfig getFBConfigFromVisualID (VisualID visualid)
 Gets a GLXFBConfig compatible with a VisualID. More...
 
Display * getGLDisplay (void)
 Get the Display connection used for rendering. More...
 
const StringgetGLVendor (void) const
 Get vendor information. More...
 
const StringgetGLVersion (void) const
 Get version information. More...
 
void * getProcAddress (const String &procname)
 GLSupport::getProcAddress More...
 
XVisualInfo * getVisualFromFBConfig (GLXFBConfig fbConfig)
 Portable replacement for glXGetVisualFromFBConfig. More...
 
Display * getXDisplay (void)
 Get the Display connection used for window management & events. More...
 
void initialiseExtensions ()
 GLSupport::initialiseExtensions More...
 
bool loadIcon (const std::string &name, Pixmap *pix, Pixmap *mask)
 Loads an icon from an Ogre resource into the X Server. More...
 
RenderWindownewWindow (const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams=0)
 
GLXFBConfig selectFBConfig (const int *minAttribs, const int *maxAttribs)
 Select an FBConfig given a list of required and a list of desired properties. More...
 
void setConfigOption (const String &name, const String &value)
 GLSupport::setConfigOption More...
 
void start ()
 GLSupport::start More...
 
void stop ()
 GLSupport::stop More...
 
virtual bool supportsPBuffers ()
 
void switchMode (uint &width, uint &height, short &frequency)
 Switch video modes. More...
 
void switchMode (void)
 Switch back to original video mode. More...
 
String validateConfig (void)
 GLSupport::validateConfig More...
 

Public Attributes

Atom mAtomDeleteWindow
 
Atom mAtomFullScreen
 
Atom mAtomState
 

Protected Attributes

set< String >::type extensionList
 
ConfigOptionMap mOptions
 

Private Types

typedef short Rate
 
typedef std::pair< uint, uintScreenSize
 
typedef std::pair< ScreenSize,
Rate
VideoMode
 
typedef std::vector< VideoModeVideoModes
 

Private Member Functions

void initialiseGLXEW (void)
 Initialise GLXEW without requiring a current GL context. More...
 
void refreshConfig (void)
 Refresh config options to reflect dependencies. More...
 

Private Attributes

VideoMode mCurrentMode
 
Display * mGLDisplay
 
bool mIsExternalDisplay
 
VideoMode mOriginalMode
 
StringVector mSampleLevels
 
VideoModes mVideoModes
 
Display * mXDisplay
 

Detailed Description

Definition at line 11 of file OgreGLXGLSupport.h.

Member Typedef Documentation

typedef short Ogre::GLXGLSupport::Rate
private

Definition at line 189 of file OgreGLXGLSupport.h.

typedef std::pair<uint, uint> Ogre::GLXGLSupport::ScreenSize
private

Definition at line 188 of file OgreGLXGLSupport.h.

typedef std::pair<ScreenSize, Rate> Ogre::GLXGLSupport::VideoMode
private

Definition at line 190 of file OgreGLXGLSupport.h.

typedef std::vector<VideoMode> Ogre::GLXGLSupport::VideoModes
private

Definition at line 191 of file OgreGLXGLSupport.h.

Constructor & Destructor Documentation

Ogre::GLXGLSupport::GLXGLSupport ( )
Ogre::GLXGLSupport::~GLXGLSupport ( )

Member Function Documentation

void Ogre::GLXGLSupport::addConfig ( void  )
virtual
virtual bool Ogre::GLSupport::checkExtension ( const String ext) const
virtualinherited

Check if an extension is available.

Reimplemented in Ogre::GTKGLSupport.

bool Ogre::GLSupport::checkMinGLVersion ( const String v) const
inherited

Compare GL version numbers.

GLXFBConfig* Ogre::GLXGLSupport::chooseFBConfig ( const GLint *  attribList,
GLint *  nElements 
)

Portable replacement for glXChooseFBConfig.

::GLXContext Ogre::GLXGLSupport::createNewContext ( GLXFBConfig  fbConfig,
GLint  renderType,
::GLXContext  shareList,
GLboolean  direct 
) const

Portable replacement for glXCreateNewContext.

GLPBuffer* Ogre::GLXGLSupport::createPBuffer ( PixelComponentType  format,
size_t  width,
size_t  height 
)
virtual

Reimplemented from Ogre::GLSupport.

RenderWindow* Ogre::GLXGLSupport::createWindow ( bool  autoCreateWindow,
GLRenderSystem renderSystem,
const String windowTitle 
)
virtual

Implements Ogre::GLSupport.

virtual ConfigOptionMap& Ogre::GLSupport::getConfigOptions ( void  )
virtualinherited
virtual unsigned int Ogre::GLSupport::getDisplayMonitorCount ( ) const
inlinevirtualinherited

Gets the number of display monitors.

See also
Root::getDisplayMonitorCount

Reimplemented in Ogre::Win32GLSupport.

Definition at line 118 of file OgreGLSupport.h.

String Ogre::GLXGLSupport::getDisplayName ( void  )

Get the name of the display and screen used for rendering.

Ogre normally opens its own connection to the X server and renders onto the screen where the user logged in

However, if Ogre is passed a current GL context when the first RenderTarget is created, then it will connect to the X server using the same connection as that GL context and direct all subsequent rendering to the screen targeted by that GL context.

Returns
Display name.
GLint Ogre::GLXGLSupport::getFBConfigAttrib ( GLXFBConfig  fbConfig,
GLint  attribute,
GLint *  value 
)

Portable replacement for glXGetFBConfigAttrib.

GLXFBConfig Ogre::GLXGLSupport::getFBConfigFromContext ( ::GLXContext  context)

Get the GLXFBConfig used to create a ::GLXContext.

Parameters
drawableGLXContext
Returns
GLXFBConfig used to create the context
GLXFBConfig Ogre::GLXGLSupport::getFBConfigFromDrawable ( GLXDrawable  drawable,
unsigned int *  width,
unsigned int *  height 
)

Get the GLXFBConfig used to create a GLXDrawable.

Caveat: GLX version 1.3 is needed when the drawable is a GLXPixmap

Parameters
drawableGLXDrawable
widthReceiver for the drawable width
heightReceiver for the drawable height
Returns
GLXFBConfig used to create the drawable
GLXFBConfig Ogre::GLXGLSupport::getFBConfigFromVisualID ( VisualID  visualid)

Gets a GLXFBConfig compatible with a VisualID.

Some platforms fail to implement glXGetFBconfigFromVisualSGIX as part of the GLX_SGIX_fbconfig extension, but this portable alternative suffices for the creation of compatible contexts.

Parameters
visualidVisualID
Returns
FBConfig for VisualID
Display* Ogre::GLXGLSupport::getGLDisplay ( void  )

Get the Display connection used for rendering.

This function establishes the initial connection when necessary.

Returns
Display connection
const String& Ogre::GLSupport::getGLVendor ( void  ) const
inlineinherited

Get vendor information.

Definition at line 85 of file OgreGLSupport.h.

const String& Ogre::GLSupport::getGLVersion ( void  ) const
inlineinherited

Get version information.

Definition at line 93 of file OgreGLSupport.h.

void* Ogre::GLXGLSupport::getProcAddress ( const String procname)
virtual
XVisualInfo* Ogre::GLXGLSupport::getVisualFromFBConfig ( GLXFBConfig  fbConfig)

Portable replacement for glXGetVisualFromFBConfig.

Display* Ogre::GLXGLSupport::getXDisplay ( void  )

Get the Display connection used for window management & events.

Returns
Display connection
void Ogre::GLXGLSupport::initialiseExtensions ( )
virtual
void Ogre::GLXGLSupport::initialiseGLXEW ( void  )
private

Initialise GLXEW without requiring a current GL context.

bool Ogre::GLXGLSupport::loadIcon ( const std::string &  name,
Pixmap *  pix,
Pixmap *  mask 
)

Loads an icon from an Ogre resource into the X Server.

This currently only works for 24 and 32 bit displays. The image must be findable by the Ogre resource system, and of format PF_A8R8G8B8.

Parameters
displayX display
nameName of image to load
pixReceiver for the output pixmap
maskReceiver for the output mask (alpha bitmap)
Returns
true on success
RenderWindow* Ogre::GLXGLSupport::newWindow ( const String name,
unsigned int  width,
unsigned int  height,
bool  fullScreen,
const NameValuePairList miscParams = 0 
)
virtual

Implements Ogre::GLSupport.

void Ogre::GLXGLSupport::refreshConfig ( void  )
private

Refresh config options to reflect dependencies.

GLXFBConfig Ogre::GLXGLSupport::selectFBConfig ( const int *  minAttribs,
const int *  maxAttribs 
)

Select an FBConfig given a list of required and a list of desired properties.

Parameters
displayX Display
minAttribsFBConfig attributes that must be provided with minimum values
maxAttribsFBConfig attributes that are desirable with maximum values
Returns
GLXFBConfig with attributes or 0 when unsupported.
void Ogre::GLXGLSupport::setConfigOption ( const String name,
const String value 
)
virtual
void Ogre::GLXGLSupport::start ( )
virtual
void Ogre::GLXGLSupport::stop ( )
virtual
virtual bool Ogre::GLSupport::supportsPBuffers ( )
virtualinherited

Reimplemented in Ogre::OSXGLSupport, and Ogre::Win32GLSupport.

void Ogre::GLXGLSupport::switchMode ( uint width,
uint height,
short &  frequency 
)

Switch video modes.

Parameters
widthReceiver for requested and final width
heightReceiver for requested and final drawable height
heightReceiver for requested and final drawable frequency
void Ogre::GLXGLSupport::switchMode ( void  )

Switch back to original video mode.

String Ogre::GLXGLSupport::validateConfig ( void  )
virtual

Member Data Documentation

set<String>::type Ogre::GLSupport::extensionList
protectedinherited

Definition at line 128 of file OgreGLSupport.h.

Atom Ogre::GLXGLSupport::mAtomDeleteWindow

Definition at line 17 of file OgreGLXGLSupport.h.

Atom Ogre::GLXGLSupport::mAtomFullScreen

Definition at line 18 of file OgreGLXGLSupport.h.

Atom Ogre::GLXGLSupport::mAtomState

Definition at line 19 of file OgreGLXGLSupport.h.

VideoMode Ogre::GLXGLSupport::mCurrentMode
private

Definition at line 195 of file OgreGLXGLSupport.h.

Display* Ogre::GLXGLSupport::mGLDisplay
private

Definition at line 184 of file OgreGLXGLSupport.h.

bool Ogre::GLXGLSupport::mIsExternalDisplay
private

Definition at line 186 of file OgreGLXGLSupport.h.

ConfigOptionMap Ogre::GLSupport::mOptions
protectedinherited

Definition at line 125 of file OgreGLSupport.h.

VideoMode Ogre::GLXGLSupport::mOriginalMode
private

Definition at line 194 of file OgreGLXGLSupport.h.

StringVector Ogre::GLXGLSupport::mSampleLevels
private

Definition at line 197 of file OgreGLXGLSupport.h.

VideoModes Ogre::GLXGLSupport::mVideoModes
private

Definition at line 193 of file OgreGLXGLSupport.h.

Display* Ogre::GLXGLSupport::mXDisplay
private

Definition at line 185 of file OgreGLXGLSupport.h.


The documentation for this class was generated from the following file: