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:

[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.
RenderWindow * | createWindow (bool autoCreateWindow, GLRenderSystem *renderSystem, const String &windowTitle)
RenderWindow * | 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)
| Create a specific instance of a render window.
void | start ()
| Start anything special.
void | stop ()
| Stop anything special.
void | begin_context (RenderTarget *_target=0)
| Set the correct context (that of _target) as active.
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 ConfigOptionMap & | getConfigOptions (void)
const String & | getGLVendor (void) const
| get vendor information
const String & | getGLVersion (void) const
| get version information
void | setExternalWindowHandle (void *hwnd)
virtual void | resizeRepositionWindow (void *window)
virtual void | resizeReposition (void *)

## Static Public Methods

GTKGLSupport & | getSingleton (void)
| Override standard Singleton retrieval.
GTKGLSupport * | getSingletonPtr (void)
| Override standard Singleton retrieval.

## Protected Attributes

ConfigOptionMap | mOptions
void * | m_windowToResize

## 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.

void GTKGLSupport::begin_context | ( | RenderTarget * | _target = 0 | ) | `[virtual]`

| Set the correct context (that of _target) as active. 0 means 'activate some context', for example in case of uploading textures. This obviously fails if there is no context yet. Reimplemented from Ogre::GLSupport. 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, _main_window, and Ogre::String.

bool GTKGLSupport::checkMinGLVersion | ( | const String & | v | ) | const

| compare GL version numbers Reimplemented from Ogre::GLSupport. Definition at line 195 of file OgreGTKGLSupport.cpp. References Ogre::String.

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, Ogre::GLSupport::mOptions, and Ogre::String.

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 73 of file OgreGLSupport.h. References Ogre::GLSupport::mVendor, and Ogre::String. Referenced by Ogre::GLRenderSystem::initGL().

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

| get version information Definition at line 81 of file OgreGLSupport.h. References Ogre::GLSupport::mVersion, and Ogre::String.

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. References Ogre::String.

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(), Ogre::GTKWindow::get_ogre_widget(), and Ogre::String.

virtual void Ogre::GLSupport::resizeReposition | ( | void * |  | ) | `[virtual, inherited]`

| Reimplemented in Ogre::Win32GLSupport. Definition at line 108 of file OgreGLSupport.h. Referenced by Ogre::GLRenderSystem::resizeRepositionWindow().

virtual void Ogre::GLSupport::resizeRepositionWindow | ( | void * | window | ) | `[virtual, inherited]`

| Definition at line 107 of file OgreGLSupport.h. References Ogre::GLSupport::m_windowToResize. Referenced by Ogre::GLRenderSystem::resizeRepositionWindow().

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, and Ogre::String. Referenced by Ogre::GLRenderSystem::setConfigOption().

void Ogre::GTKGLSupport::setConfigOptions | ( | const String & | name,
|  | const String & | value
| ) |

void Ogre::GLSupport::setExternalWindowHandle | ( | void * | hwnd | ) | `[inherited]`

| Reimplemented in Ogre::Win32GLSupport. Definition at line 100 of file OgreGLSupport.h. Referenced by Ogre::GLRenderSystem::createRenderWindow().

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.

References Ogre::String.

## 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().

void* Ogre::GLSupport::m_windowToResize`[protected, inherited]`

| Definition at line 114 of file OgreGLSupport.h. Referenced by Ogre::Win32GLSupport::resizeReposition(), and Ogre::GLSupport::resizeRepositionWindow().

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

Definition at line 112 of file OgreGLSupport.h.

Referenced by Ogre::Win32GLSupport::addConfig(), Ogre::SDLGLSupport::addConfig(), addConfig(), Ogre::GLXGLSupport::addConfig(), Ogre::Win32GLSupport::createWindow(), Ogre::SDLGLSupport::createWindow(), createWindow(), Ogre::GLXGLSupport::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:

- OgreGTKGLSupport.h
- OgreGTKGLSupport.cpp

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:49:39 2004