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

Ogre::GLXConfigurator Class Reference

Single X window with image backdrop, making it possible to configure OGRE in a graphical way. More...

List of all members.

Public Methods

 GLXConfigurator ()
 ~GLXConfigurator ()
bool CreateWindow ()
void Main ()
void Exit ()
 Exit from main loop.

void SetRenderSystem (RenderSystem *sys)

Public Attributes

bool accept
std::list< RendererCallbackDatamRendererCallbackData
RenderSystemmRenderer
Widget box
std::list< Widget > mRenderOptionWidgets
std::list< ConfigCallbackDatamConfigCallbackData

Protected Methods

virtual Pixmap CreateBackdrop (Window rootWindow, int depth)
 Create backdrop image, and return it as a Pixmap.

virtual bool Init ()
 Called after window initialisation.

virtual void Draw ()
 Called initially, and on expose.


Protected Attributes

Display * mDisplay
Window mWindow
Pixmap mBackDrop
int mWidth
int mHeight
XtAppContext appContext
Widget toplevel

Private Methods

void SetRenderer (RenderSystem *)
void SetConfigOption (const std::string &optionName, const std::string &valueName)

Static Private Methods

void acceptHandler (Widget w, GLXConfigurator *obj, XtPointer callData)
void cancelHandler (Widget w, GLXConfigurator *obj, XtPointer callData)
void renderSystemHandler (Widget w, RendererCallbackData *cdata, XtPointer callData)
void configOptionHandler (Widget w, ConfigCallbackData *cdata, XtPointer callData)

Static Private Attributes

const int wWidth = 400
const int wHeight = 300
const int col1x = 20
const int col2x = 180
const int col1w = 150
const int col2w = 200
const int ystart = 105
const int rowh = 20


Detailed Description

Single X window with image backdrop, making it possible to configure OGRE in a graphical way.

XaW uses a not-very-smart widget positioning system, so I override it to use fixed positions. This works great, but it means you need to define the various positions manually. Furthermore, it has no OptionMenu by default, so I simulate this with dropdown buttons.

Definition at line 64 of file OgreGLXConfig.cpp.


Constructor & Destructor Documentation

Ogre::GLXConfigurator::GLXConfigurator  
 

Definition at line 183 of file OgreGLXConfig.cpp.

Ogre::GLXConfigurator::~GLXConfigurator  
 

Definition at line 191 of file OgreGLXConfig.cpp.

References mBackDrop, mDisplay, and toplevel.


Member Function Documentation

void Ogre::GLXConfigurator::acceptHandler Widget    w,
GLXConfigurator *    obj,
XtPointer    callData
[static, private]
 

Definition at line 149 of file OgreGLXConfig.cpp.

References accept, Exit(), and mRenderer.

void Ogre::GLXConfigurator::cancelHandler Widget    w,
GLXConfigurator *    obj,
XtPointer    callData
[static, private]
 

Definition at line 156 of file OgreGLXConfig.cpp.

References Exit().

void Ogre::GLXConfigurator::configOptionHandler Widget    w,
ConfigCallbackData   cdata,
XtPointer    callData
[static, private]
 

Definition at line 166 of file OgreGLXConfig.cpp.

References Ogre::GLXConfigurator::ConfigCallbackData::optionmenu, Ogre::GLXConfigurator::ConfigCallbackData::optionName, Ogre::GLXConfigurator::ConfigCallbackData::parent, SetConfigOption(), and Ogre::GLXConfigurator::ConfigCallbackData::valueName.

Pixmap Ogre::GLXConfigurator::CreateBackdrop Window    rootWindow,
int    depth
[protected, virtual]
 

Create backdrop image, and return it as a Pixmap.

Definition at line 313 of file OgreGLXConfig.cpp.

References Ogre::Image::getData(), Ogre::Image::getFormat(), Ogre::Image::getHeight(), Ogre::Image::getWidth(), Ogre::Image::load(), malloc, mDisplay, mHeight, mWidth, and Ogre::PF_R8G8B8.

Referenced by CreateWindow().

bool Ogre::GLXConfigurator::CreateWindow  
 

Definition at line 203 of file OgreGLXConfig.cpp.

References appContext, box, col1w, col1x, col2w, col2x, CreateBackdrop(), Ogre::RenderSystem::getName(), mBackDrop, mDisplay, mHeight, mRenderer, mRendererCallbackData, mWidth, Ogre::RenderSystemList, rowh, SetRenderer(), toplevel, and ystart.

Referenced by Ogre::GLXConfig::display().

void Ogre::GLXConfigurator::Draw   [protected, virtual]
 

Called initially, and on expose.

Definition at line 408 of file OgreGLXConfig.cpp.

void Ogre::GLXConfigurator::Exit  
 

Exit from main loop.

Definition at line 413 of file OgreGLXConfig.cpp.

References appContext.

Referenced by acceptHandler(), and cancelHandler().

bool Ogre::GLXConfigurator::Init   [protected, virtual]
 

Called after window initialisation.

Definition at line 404 of file OgreGLXConfig.cpp.

void Ogre::GLXConfigurator::Main  
 

Definition at line 410 of file OgreGLXConfig.cpp.

References appContext.

Referenced by Ogre::GLXConfig::display().

void Ogre::GLXConfigurator::renderSystemHandler Widget    w,
RendererCallbackData   cdata,
XtPointer    callData
[static, private]
 

Definition at line 160 of file OgreGLXConfig.cpp.

References Ogre::RenderSystem::getName(), Ogre::GLXConfigurator::RendererCallbackData::optionmenu, Ogre::GLXConfigurator::RendererCallbackData::parent, Ogre::GLXConfigurator::RendererCallbackData::renderer, and SetRenderer().

void Ogre::GLXConfigurator::SetConfigOption const std::string &    optionName,
const std::string &    valueName
[private]
 

Definition at line 478 of file OgreGLXConfig.cpp.

References mRenderer, and Ogre::RenderSystem::setConfigOption().

Referenced by configOptionHandler().

void Ogre::GLXConfigurator::SetRenderer RenderSystem   [private]
 

Definition at line 417 of file OgreGLXConfig.cpp.

References box, col1w, col1x, col2w, col2x, Ogre::ConfigOptionMap, Ogre::RenderSystem::getConfigOptions(), mConfigCallbackData, mRenderer, mRenderOptionWidgets, rowh, and ystart.

Referenced by CreateWindow(), and renderSystemHandler().

void Ogre::GLXConfigurator::SetRenderSystem RenderSystem   sys
 

Definition at line 144 of file OgreGLXConfig.cpp.

Referenced by Ogre::GLXConfig::display().


Member Data Documentation

bool Ogre::GLXConfigurator::accept
 

Definition at line 110 of file OgreGLXConfig.cpp.

Referenced by acceptHandler(), and Ogre::GLXConfig::display().

XtAppContext Ogre::GLXConfigurator::appContext [protected]
 

Definition at line 93 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), Exit(), and Main().

Widget Ogre::GLXConfigurator::box
 

Definition at line 126 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), and SetRenderer().

const int Ogre::GLXConfigurator::col1w = 150 [static, private]
 

Definition at line 70 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), and SetRenderer().

const int Ogre::GLXConfigurator::col1x = 20 [static, private]
 

Definition at line 68 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), and SetRenderer().

const int Ogre::GLXConfigurator::col2w = 200 [static, private]
 

Definition at line 71 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), and SetRenderer().

const int Ogre::GLXConfigurator::col2x = 180 [static, private]
 

Definition at line 69 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), and SetRenderer().

Pixmap Ogre::GLXConfigurator::mBackDrop [protected]
 

Definition at line 89 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), and ~GLXConfigurator().

std::list<ConfigCallbackData> Ogre::GLXConfigurator::mConfigCallbackData
 

Definition at line 142 of file OgreGLXConfig.cpp.

Referenced by SetRenderer().

Display* Ogre::GLXConfigurator::mDisplay [protected]
 

Definition at line 87 of file OgreGLXConfig.cpp.

Referenced by CreateBackdrop(), CreateWindow(), and ~GLXConfigurator().

int Ogre::GLXConfigurator::mHeight [protected]
 

Definition at line 91 of file OgreGLXConfig.cpp.

Referenced by CreateBackdrop(), and CreateWindow().

RenderSystem* Ogre::GLXConfigurator::mRenderer
 

Definition at line 125 of file OgreGLXConfig.cpp.

Referenced by acceptHandler(), CreateWindow(), Ogre::GLXConfig::display(), SetConfigOption(), and SetRenderer().

std::list<RendererCallbackData> Ogre::GLXConfigurator::mRendererCallbackData
 

Definition at line 123 of file OgreGLXConfig.cpp.

Referenced by CreateWindow().

std::list<Widget> Ogre::GLXConfigurator::mRenderOptionWidgets
 

Definition at line 127 of file OgreGLXConfig.cpp.

Referenced by SetRenderer().

int Ogre::GLXConfigurator::mWidth [protected]
 

Definition at line 91 of file OgreGLXConfig.cpp.

Referenced by CreateBackdrop(), and CreateWindow().

Window Ogre::GLXConfigurator::mWindow [protected]
 

Definition at line 88 of file OgreGLXConfig.cpp.

const int Ogre::GLXConfigurator::rowh = 20 [static, private]
 

Definition at line 73 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), and SetRenderer().

Widget Ogre::GLXConfigurator::toplevel [protected]
 

Definition at line 94 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), and ~GLXConfigurator().

const int Ogre::GLXConfigurator::wHeight = 300 [static, private]
 

Definition at line 67 of file OgreGLXConfig.cpp.

const int Ogre::GLXConfigurator::wWidth = 400 [static, private]
 

Definition at line 66 of file OgreGLXConfig.cpp.

const int Ogre::GLXConfigurator::ystart = 105 [static, private]
 

Definition at line 72 of file OgreGLXConfig.cpp.

Referenced by CreateWindow(), and SetRenderer().


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

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