Ogre::GLXGLSupport Class Reference

`#include <OgreGLXGLSupport.h>`

Inheritance diagram for Ogre::GLXGLSupport:
[legend]

List of all members.

## Public Member Functions

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

## Public Attributes

Atom | mAtomDeleteWindow
Atom | mAtomFullScreen
Atom | mAtomState

## Protected Attributes

ConfigOptionMap | mOptions
set< String >::type | extensionList

## Private Types

typedef std::pair< uint, uint > | ScreenSize
typedef short | Rate
typedef std::pair< ScreenSize, Rate > | VideoMode
typedef std::vector< VideoMode > | VideoModes

## Private Member Functions

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

## Private Attributes

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

## 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]`

GLSupport::addConfig

Implements Ogre::GLSupport.

virtual bool Ogre::GLSupport::checkExtension | ( | const String & | ext | ) | const`[virtual, inherited]`

Check if an extension is available.

Reimplemented in Ogre::GTKGLSupport.

bool Ogre::GLSupport::checkMinGLVersion | ( | const String & | v | ) | const`[inherited]`

Compare GL version numbers.

Reimplemented in Ogre::GTKGLSupport.

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 |  | ) | `[virtual, inherited]`

virtual unsigned int Ogre::GLSupport::getDisplayMonitorCount | ( |  | ) | const`[virtual, inherited]`

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:

  drawable | GLXContext

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:

  drawable | GLXDrawable
  width | Receiver for the drawable width
  height | Receiver 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:

  visualid | VisualID

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`[inherited]`

Get vendor information.

Definition at line 85 of file OgreGLSupport.h.

const String& Ogre::GLSupport::getGLVersion | ( | void |  | ) | const`[inherited]`

Get version information.

Definition at line 93 of file OgreGLSupport.h.

void* Ogre::GLXGLSupport::getProcAddress | ( | const String & | procname | ) | `[virtual]`

GLSupport::getProcAddress

Implements Ogre::GLSupport.

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]`

GLSupport::initialiseExtensions

Reimplemented from Ogre::GLSupport.

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:

  display | X display
  name | Name of image to load
  pix | Receiver for the output pixmap
  mask | Receiver 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:

  display | X Display
  minAttribs | FBConfig attributes that must be provided with minimum values
  maxAttribs | FBConfig 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]`

GLSupport::setConfigOption

Reimplemented from Ogre::GLSupport.

void Ogre::GLXGLSupport::start | ( |  | ) | `[virtual]`

GLSupport::start

Implements Ogre::GLSupport.

void Ogre::GLXGLSupport::stop | ( |  | ) | `[virtual]`

GLSupport::stop

Implements Ogre::GLSupport.

virtual bool Ogre::GLSupport::supportsPBuffers | ( |  | ) | `[virtual, inherited]`

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

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

Switch video modes.

Parameters:

  width | Receiver for requested and final width
  height | Receiver for requested and final drawable height
  height | Receiver for requested and final drawable frequency

void Ogre::GLXGLSupport::switchMode | ( | void |  | ) |

Switch back to original video mode.

String Ogre::GLXGLSupport::validateConfig | ( | void |  | ) | `[virtual]`

GLSupport::validateConfig

Implements Ogre::GLSupport.

## Member Data Documentation

set<String>::type Ogre::GLSupport::extensionList`[protected, inherited]`

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`[protected, inherited]`

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:

- OgreGLXGLSupport.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun Sep 2 2012 07:27:50