Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::GTKGLSupport Class Reference

GL support in a GTK window. More...

#include <OgreGTKGLSupport.h>

Inheritance diagram for Ogre::GTKGLSupport:

Inheritance graph
[legend]
List of all members.

Public Methods

 GTKGLSupport ()
void addConfig ()
 Add any special config values to the system.

void setConfigOptions (const String &name, const String &value)
String validateConfig ()
 Make sure all the extra options are valid.

RenderWindowcreateWindow (bool autoCreateWindow, GLRenderSystem *renderSystem, const String &windowTitle)
RenderWindownewWindow (const String &name, unsigned int width, unsigned int height, unsigned int colourDepth, bool fullScreen, int left, int top, bool depthBuffer, RenderWindow *parentWindowHandle, bool vsync)
 Create a specific instance of a render window.

void start ()
 Start anything special.

void stop ()
 Stop anything special.

void begin_context (RenderTarget *_target=0)
void end_context ()
 Stop the currrent context.

void initialiseExtensions (void)
 Intialises GL extensions, must be done AFTER the GL context has been established.

bool checkMinGLVersion (const String &v) const
 compare GL version numbers

bool checkExtension (const String &ext) const
 Check if an extension is available.

void * getProcAddress (const String &procname)
 Get the address of a function.

Glib::RefPtr< const Gdk::GL::Context > getMainContext () const
virtual void setConfigOption (const String &name, const String &value)
virtual ConfigOptionMapgetConfigOptions (void)
virtual void begin_context ()
 Set the correct context as active.

const StringgetGLVendor (void) const
 get vendor information

const StringgetGLVersion (void) const
 get version information


Static Public Methods

GTKGLSupport & getSingleton (void)
 Override standard Singleton retrieval.

GTKGLSupport * getSingletonPtr (void)
 Override standard Singleton retrieval.


Protected Attributes

ConfigOptionMap mOptions

Static Protected Attributes

GTKGLSupport * ms_Singleton

Private Attributes

int _context_ref
Gtk::Main _kit
Glib::RefPtr< Gdk::GL::Context > _main_context
Glib::RefPtr< Gdk::GL::Window > _main_window

Detailed Description

GL support in a GTK window.

I made this a Singleton, so that the main context can be queried by GTKWindows.

Definition at line 44 of file OgreGTKGLSupport.h.


Constructor & Destructor Documentation

GTKGLSupport::GTKGLSupport  
 

Definition at line 47 of file OgreGTKGLSupport.cpp.

References _main_context, and _main_window.


Member Function Documentation

void GTKGLSupport::addConfig   [virtual]
 

Add any special config values to the system.

Must have a "Full Screen" value that is a bool and a "Video Mode" value that is a string in the form of wxh

Implements Ogre::GLSupport.

Definition at line 57 of file OgreGTKGLSupport.cpp.

References Ogre::_ConfigOption::currentValue, Ogre::_ConfigOption::immutable, Ogre::GLSupport::mOptions, Ogre::_ConfigOption::name, and Ogre::_ConfigOption::possibleValues.

virtual void Ogre::GLSupport::begin_context   [virtual, inherited]
 

Set the correct context as active.

Definition at line 58 of file OgreGLSupport.h.

Referenced by Ogre::GLTexture::blitToTexture(), Ogre::GLTexture::createRenderTexture(), Ogre::GLTexture::generateMipMaps(), Ogre::GLTexture::loadImages(), and Ogre::GLTexture::rescaleNPower2().

void GTKGLSupport::begin_context RenderTarget   _target = 0
 

Definition at line 159 of file OgreGTKGLSupport.cpp.

References _context_ref, _main_context, and _main_window.

bool GTKGLSupport::checkExtension const String   ext const [virtual]
 

Check if an extension is available.

Reimplemented from Ogre::GLSupport.

Definition at line 207 of file OgreGTKGLSupport.cpp.

References _context_ref, _main_context, and _main_window.

bool GTKGLSupport::checkMinGLVersion const String   v const
 

compare GL version numbers

Reimplemented from Ogre::GLSupport.

Definition at line 195 of file OgreGTKGLSupport.cpp.

RenderWindow * GTKGLSupport::createWindow bool    autoCreateWindow,
GLRenderSystem   renderSystem,
const String   windowTitle
[virtual]
 

Implements Ogre::GLSupport.

Definition at line 89 of file OgreGTKGLSupport.cpp.

References Ogre::GLRenderSystem::createRenderWindow(), Except, and Ogre::GLSupport::mOptions.

void GTKGLSupport::end_context   [virtual]
 

Stop the currrent context.

Reimplemented from Ogre::GLSupport.

Definition at line 176 of file OgreGTKGLSupport.cpp.

References _context_ref, _main_window, and Except.

ConfigOptionMap & Ogre::GLSupport::getConfigOptions void    [virtual, inherited]
 

Definition at line 41 of file OgreGLSupport.cpp.

References Ogre::ConfigOptionMap, and Ogre::GLSupport::mOptions.

Referenced by Ogre::GLRenderSystem::getConfigOptions().

const String& Ogre::GLSupport::getGLVendor void    const [inherited]
 

get vendor information

Definition at line 70 of file OgreGLSupport.h.

References Ogre::GLSupport::mVendor.

Referenced by Ogre::GLRenderSystem::initGL().

const String& Ogre::GLSupport::getGLVersion void    const [inherited]
 

get version information

Definition at line 78 of file OgreGLSupport.h.

References Ogre::GLSupport::mVersion.

Glib::RefPtr< const Gdk::GL::Context > GTKGLSupport::getMainContext   const
 

Definition at line 224 of file OgreGTKGLSupport.cpp.

References _main_context.

void * GTKGLSupport::getProcAddress const String   procname [virtual]
 

Get the address of a function.

Implements Ogre::GLSupport.

Definition at line 219 of file OgreGTKGLSupport.cpp.

GTKGLSupport & GTKGLSupport::getSingleton void    [static]
 

Override standard Singleton retrieval.

Remarks:
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

Reimplemented from Ogre::Singleton< GTKGLSupport >.

Definition at line 42 of file OgreGTKGLSupport.cpp.

References Ogre::Singleton< GTKGLSupport >::ms_Singleton.

GTKGLSupport * GTKGLSupport::getSingletonPtr void    [static]
 

Override standard Singleton retrieval.

Remarks:
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

Reimplemented from Ogre::Singleton< GTKGLSupport >.

Definition at line 38 of file OgreGTKGLSupport.cpp.

References Ogre::Singleton< GTKGLSupport >::ms_Singleton.

void GTKGLSupport::initialiseExtensions void    [virtual]
 

Intialises GL extensions, must be done AFTER the GL context has been established.

Reimplemented from Ogre::GLSupport.

Definition at line 190 of file OgreGTKGLSupport.cpp.

RenderWindow * GTKGLSupport::newWindow const String   name,
unsigned int    width,
unsigned int    height,
unsigned int    colourDepth,
bool    fullScreen,
int    left,
int    top,
bool    depthBuffer,
RenderWindow   parentWindowHandle,
bool    vsync
[virtual]
 

Create a specific instance of a render window.

Implements Ogre::GLSupport.

Definition at line 121 of file OgreGTKGLSupport.cpp.

References _main_context, _main_window, Ogre::GTKWindow::create(), and Ogre::GTKWindow::get_ogre_widget().

void Ogre::GLSupport::setConfigOption const String   name,
const String   value
[virtual, inherited]
 

Reimplemented in Ogre::Win32GLSupport.

Definition at line 33 of file OgreGLSupport.cpp.

References Ogre::GLSupport::mOptions.

Referenced by Ogre::GLRenderSystem::setConfigOption().

void Ogre::GTKGLSupport::setConfigOptions const String   name,
const String   value
 

void GTKGLSupport::start   [virtual]
 

Start anything special.

Implements Ogre::GLSupport.

Definition at line 142 of file OgreGTKGLSupport.cpp.

void GTKGLSupport::stop   [virtual]
 

Stop anything special.

Implements Ogre::GLSupport.

Definition at line 151 of file OgreGTKGLSupport.cpp.

String GTKGLSupport::validateConfig   [virtual]
 

Make sure all the extra options are valid.

Returns:
string with error message

Implements Ogre::GLSupport.

Definition at line 84 of file OgreGTKGLSupport.cpp.


Member Data Documentation

int Ogre::GTKGLSupport::_context_ref [private]
 

Definition at line 101 of file OgreGTKGLSupport.h.

Referenced by begin_context(), checkExtension(), and end_context().

Gtk::Main Ogre::GTKGLSupport::_kit [private]
 

Definition at line 102 of file OgreGTKGLSupport.h.

Glib::RefPtr<Gdk::GL::Context> Ogre::GTKGLSupport::_main_context [private]
 

Definition at line 105 of file OgreGTKGLSupport.h.

Referenced by begin_context(), checkExtension(), getMainContext(), GTKGLSupport(), and newWindow().

Glib::RefPtr<Gdk::GL::Window> Ogre::GTKGLSupport::_main_window [private]
 

Definition at line 106 of file OgreGTKGLSupport.h.

Referenced by begin_context(), checkExtension(), end_context(), GTKGLSupport(), and newWindow().

ConfigOptionMap Ogre::GLSupport::mOptions [protected, inherited]
 

Definition at line 103 of file OgreGLSupport.h.

Referenced by Ogre::Win32GLSupport::addConfig(), Ogre::SDLGLSupport::addConfig(), addConfig(), Ogre::Win32GLSupport::createWindow(), Ogre::SDLGLSupport::createWindow(), createWindow(), Ogre::GLSupport::getConfigOptions(), Ogre::Win32GLSupport::newWindow(), Ogre::Win32GLSupport::refreshConfig(), Ogre::Win32GLSupport::setConfigOption(), and Ogre::GLSupport::setConfigOption().

GTKGLSupport* Ogre::Singleton< GTKGLSupport >::ms_Singleton [static, protected, inherited]
 

Definition at line 54 of file OgreSingleton.h.

Referenced by getSingleton(), and getSingletonPtr().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:24:09 2004