ParCompMark::GLXRenderWindow Class Reference

#include <PCMGLXRenderWindow.h>

Collaboration diagram for ParCompMark::GLXRenderWindow:

Collaboration graph
[legend]
List of all members.

Detailed Description

Manages the target rendering window in GLX environment.

Original source can be found in Ogre3D sources (http://ogre3d.org).

Definition at line 71 of file PCMGLXRenderWindow.h.


Methods

virtual void reposition (const s32 &left, const s32 &top)
 Set new window position.
virtual void resize (const u32 &width, const u32 &height)
 Set new window sizes.
virtual void startFrame ()
 Start a frame.
virtual void finishFrame ()
 Finish current frame.
virtual void setCurrent ()
 Enable the context of the window.
virtual void releaseCurrent ()
 Disable the context of the window.
virtual void initialize ()
 Initialize the GLX RenderWindow.
virtual void finalize ()
 Finalize the GLX RenderWindow.
virtual void resetStatistics ()
 Reset statistics.
virtual void reportTriangles (const u32 &triangleCount)
 Report certain number of triangles being rendered to the render window.
virtual void createWindow ()
 Create GLX Window.
virtual void destroyWindow ()
 Destroy GLX Window.
virtual void updateStatistics ()
 Update statistics of the window.
virtual void _reposition ()
 Efficiently set window position (for internal use).
virtual void _resize ()
 Efficiently set window sizes (for internal use).
virtual void _setCaption ()
 Efficiently set window caption (for internal use).

Public Types

typedef Pointer< GLXRenderWindow,
Mutex
Pointer
 Type for pointer on this class.

Public Member Functions

Constructors & destructor
 GLXRenderWindow (XDisplay::Pointer &display, Process *process, const std::string caption="PCM Framework", const bool &fullScreen=true, const u32 &colourDepth=0, const u32 &width=GLXRenderWindow::MAXIMALSIZE, const u32 &height=GLXRenderWindow::MAXIMALSIZE, const s32 &left=GLXRenderWindow::CENTERED, const s32 &top=GLXRenderWindow::CENTERED, const u32 &fsaaSamples=0)
 Create GLX render window.
virtual ~GLXRenderWindow ()
 The destructor.
Getters & setters
XDisplay::PointergetDisplay ()
 Getter of mDisplay.
GLXGLContext::PointergetGLXGLContext ()
 Getter of mGLXGLContext.
ProcessgetProcess () const
 Getter of mProcess.
const ::Window & getWindow () const
 Getter of mWindow.
const bool & getInitialized () const
 Getter of mInitialized.
const bool & getVisible () const
 Getter of mVisible.
void setVisible (const bool &visible)
 Setter of mVisible.
const bool & getFullScreen () const
 Getter of mFullScreen.
void setFullScreen (const bool &fullscreen)
 Setter of mFullScreen.
const std::string & getCaption () const
 Getter of mCaption.
void setCaption (const std::string &caption)
 Setter of mCaption.
const s32getLeft () const
 Getter of mLeft.
void setLeft (const s32 &left)
 Setter of mLeft.
const s32getTop () const
 Getter of mTop.
void setTop (const s32 &top)
 Setter of mTop.
const u32getWidth () const
 Getter of mWidth.
void setWidth (const u32 &width)
 Setter of mWidth.
const u32getHeight () const
 Getter of mHeight.
void setHeight (const u32 &height)
 Setter of mHeight.
const u32getColourDepth () const
 Getter of mColourDepth.
void setColourDepth (const u32 &colourdepth)
 Setter of mColourDepth.
const u32getFSAASamples () const
 Getter of mFSAASamples.
void setFSAASamples (const u32 &fsaasamples)
 Setter of mFSAASamples.
const GLXRenderWindow::WindowStatisticsgetWindowStatistics () const
 Getter of mWindowStatistics.

Static Public Attributes

Class constants
static const s32 CENTERED = -1
 Constant for centered position.
static const u32 MAXIMALSIZE = 0
 Constant for maximal size.
static const Real UNDEFINEDSTATISTICS = -1.0
 Undefined statistics value.
static const s32 UNDEFINEDXRRCONFIGURATION = -1
 Constant for undefined XRR configuration.
static const u32 DEFAULTWINDOWWIDTH = 128
 Default window width.
static const u32 DEFAULTWINDOWHEIGHT = 128
 Default window height.

Protected Attributes

Variables
XDisplay::Pointer mDisplay
 Corresponding X Display.
GLXGLContext::Pointer mGLXGLContext
 GLX context of the render window.
ProcessmProcess
 Corresponding process.
::Window mWindow
 Wrapped GLX Window.
bool mInitialized
 The window is initialized.
bool mVisible
 The window is visible.
bool mFullScreen
 The window appears in full screen mode.
std::string mCaption
 Window caption.
s32 mLeft
 Horizontal position of the window.
s32 mTop
 Vertical position of the window.
u32 mWidth
 Horizontal size of the window.
u32 mHeight
 Vertical size of the window.
u32 mColourDepth
 Colour depth of the window.
u32 mFSAASamples
 Number of fullscreen antialasing samples.
s32 mOriginalXRRConfiguation
 For storing original XRR configuration mode.
::Atom mAtomDeleteWindow
 Atom to recognize window close events.
WindowStatistics mWindowStatistics
 Current window statistics.
Real mRenderingBeginTime
 Time of the start of the rendering.
Real mFPSMeasuringBeginTime
 Time of stating measuring a second for FPS calculation.
u32 mFPSMeasuringFrameCount
 Frame counter for storing number of frames during a second.
Real mSumTriangleCount
 Summarized triangle count for all frames for calculating avgTriangleCount statistics.
Real mSumFPS
 Summarized frame rates for all frames for calculating avgFPS statistics.

Classes

struct  WindowStatistics
 Struct for window statistics (FPS values, frame times). More...

Member Typedef Documentation

Type for pointer on this class.

Definition at line 89 of file PCMGLXRenderWindow.h.


Constructor & Destructor Documentation

ParCompMark::GLXRenderWindow::GLXRenderWindow ( XDisplay::Pointer display,
Process process,
const std::string  caption = "PCM Framework",
const bool &  fullScreen = true,
const u32 colourDepth = 0,
const u32 width = GLXRenderWindow::MAXIMALSIZE,
const u32 height = GLXRenderWindow::MAXIMALSIZE,
const s32 left = GLXRenderWindow::CENTERED,
const s32 top = GLXRenderWindow::CENTERED,
const u32 fsaaSamples = 0 
)

Create GLX render window.

Normally called by XDisplay::createRenderWindow.

Parameters:
[out] display X display
[in] process Corresponding process.
[in] caption Window caption
[in] fullScreen The window appears in full screen mode
[in] colourDepth Colour depth of the window
[in] width Horizontal size
[in] height Vertical size
[in] left Horizontal position
[in] top Vertical position
[in] fsaaSamples Number of fullscreen antialasing samples (Do not use FSAA samples other than 0 now with nVidia cards!)

Definition at line 63 of file PCMGLXRenderWindow.cpp.

References mCaption, mColourDepth, mFSAASamples, mFullScreen, mHeight, mInitialized, mLeft, mOriginalXRRConfiguation, mTop, mVisible, mWidth, mWindow, resetStatistics(), and UNDEFINEDXRRCONFIGURATION.

Here is the call graph for this function:

ParCompMark::GLXRenderWindow::~GLXRenderWindow (  )  [virtual]

The destructor.

This class has virtual destructor.

Definition at line 116 of file PCMGLXRenderWindow.cpp.

References finalize(), and mInitialized.

Here is the call graph for this function:


Member Function Documentation

void ParCompMark::GLXRenderWindow::_reposition (  )  [inline, protected, virtual]

Efficiently set window position (for internal use).

Definition at line 942 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::_resize (  )  [inline, protected, virtual]

Efficiently set window sizes (for internal use).

Definition at line 951 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::_setCaption (  )  [protected, virtual]

void ParCompMark::GLXRenderWindow::createWindow (  )  [protected, virtual]

void ParCompMark::GLXRenderWindow::destroyWindow (  )  [protected, virtual]

Destroy GLX Window.

Protected method for internal use.

Definition at line 436 of file PCMGLXRenderWindow.cpp.

References Assert, ParCompMark::Singleton< T >::getInstance(), ParCompMark::Pointer< T, Lock >::lock(), mCaption, mDisplay, mWindow, ParCompMark::Logger::NOTICE, and ParCompMark::Pointer< T, Lock >::unlock().

Referenced by finalize().

Here is the call graph for this function:

void ParCompMark::GLXRenderWindow::finalize (  )  [virtual]

Finalize the GLX RenderWindow.

Protected method for internal use.

Definition at line 165 of file PCMGLXRenderWindow.cpp.

References Assert, destroyWindow(), ParCompMark::Pointer< T, Lock >::kill(), ParCompMark::Pointer< T, Lock >::lock(), mGLXGLContext, mInitialized, and ParCompMark::Pointer< T, Lock >::unlock().

Referenced by ~GLXRenderWindow().

Here is the call graph for this function:

void ParCompMark::GLXRenderWindow::finishFrame (  )  [inline, virtual]

Finish current frame.

Definition at line 923 of file PCMGLXRenderWindow.h.

const std::string & ParCompMark::GLXRenderWindow::getCaption (  )  const [inline]

Getter of mCaption.

Returns value of mCaption.

Returns:
The value of mCaption

Definition at line 774 of file PCMGLXRenderWindow.h.

Referenced by ParCompMark::GLXGLContext::finalize(), ParCompMark::GLXGLContext::GLXGLContext(), ParCompMark::GLXGLContext::initialize(), and ParCompMark::GLXGLContext::~GLXGLContext().

const u32 & ParCompMark::GLXRenderWindow::getColourDepth (  )  const [inline]

Getter of mColourDepth.

Returns value of mColourDepth.

Returns:
The value of mColourDepth

Definition at line 846 of file PCMGLXRenderWindow.h.

XDisplay::Pointer & ParCompMark::GLXRenderWindow::getDisplay (  )  [inline]

Getter of mDisplay.

Returns value of mDisplay.

Returns:
The value of mDisplay

Definition at line 701 of file PCMGLXRenderWindow.h.

const u32 & ParCompMark::GLXRenderWindow::getFSAASamples (  )  const [inline]

Getter of mFSAASamples.

Returns value of mFSAASamples.

Returns:
The value of mFSAASamples

Definition at line 860 of file PCMGLXRenderWindow.h.

const bool & ParCompMark::GLXRenderWindow::getFullScreen (  )  const [inline]

Getter of mFullScreen.

Returns value of mFullScreen.

Returns:
The value of mFullScreen

Definition at line 760 of file PCMGLXRenderWindow.h.

GLXGLContext::Pointer & ParCompMark::GLXRenderWindow::getGLXGLContext (  )  [inline]

Getter of mGLXGLContext.

Returns value of mGLXGLContext.

Returns:
The value of mGLXGLContext

Definition at line 708 of file PCMGLXRenderWindow.h.

const u32 & ParCompMark::GLXRenderWindow::getHeight (  )  const [inline]

Getter of mHeight.

Returns value of mHeight.

Returns:
The value of mHeight

Definition at line 832 of file PCMGLXRenderWindow.h.

const bool & ParCompMark::GLXRenderWindow::getInitialized (  )  const [inline]

Getter of mInitialized.

Returns value of mInitialized.

Returns:
The value of mInitialized

Definition at line 729 of file PCMGLXRenderWindow.h.

const s32 & ParCompMark::GLXRenderWindow::getLeft (  )  const [inline]

Getter of mLeft.

Returns value of mLeft.

Returns:
The value of mLeft

Definition at line 790 of file PCMGLXRenderWindow.h.

Process * ParCompMark::GLXRenderWindow::getProcess (  )  const [inline]

Getter of mProcess.

Returns value of mProcess.

Returns:
The value of mProcess

Definition at line 715 of file PCMGLXRenderWindow.h.

const s32 & ParCompMark::GLXRenderWindow::getTop (  )  const [inline]

Getter of mTop.

Returns value of mTop.

Returns:
The value of mTop

Definition at line 804 of file PCMGLXRenderWindow.h.

const bool & ParCompMark::GLXRenderWindow::getVisible (  )  const [inline]

Getter of mVisible.

Returns value of mVisible.

Returns:
The value of mVisible

Definition at line 736 of file PCMGLXRenderWindow.h.

const u32 & ParCompMark::GLXRenderWindow::getWidth (  )  const [inline]

Getter of mWidth.

Returns value of mWidth.

Returns:
The value of mWidth

Definition at line 818 of file PCMGLXRenderWindow.h.

const ::Window & ParCompMark::GLXRenderWindow::getWindow (  )  const [inline]

Getter of mWindow.

Returns value of mWindow.

Returns:
The value of mWindow

Definition at line 722 of file PCMGLXRenderWindow.h.

Referenced by ParCompMark::GLXGLContext::setCurrent().

const GLXRenderWindow::WindowStatistics & ParCompMark::GLXRenderWindow::getWindowStatistics (  )  const [inline]

Getter of mWindowStatistics.

Returns value of mWindowStatistics.

Returns:
The value of mWindowStatistics

Definition at line 874 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::initialize (  )  [virtual]

Initialize the GLX RenderWindow.

Protected method for internal use.

Definition at line 146 of file PCMGLXRenderWindow.cpp.

References Assert, createWindow(), ParCompMark::GLXRenderWindow::WindowStatistics::frameCount, mInitialized, mSumFPS, mSumTriangleCount, and mWindowStatistics.

Here is the call graph for this function:

void ParCompMark::GLXRenderWindow::releaseCurrent (  )  [virtual]

Disable the context of the window.

Release the current context without assigning a new one.

Definition at line 137 of file PCMGLXRenderWindow.cpp.

References ParCompMark::Pointer< T, Lock >::lock(), mGLXGLContext, and ParCompMark::Pointer< T, Lock >::unlock().

Here is the call graph for this function:

void ParCompMark::GLXRenderWindow::reportTriangles ( const u32 triangleCount  )  [virtual]

Report certain number of triangles being rendered to the render window.

Parameters:
[in] triangleCount Number of rendered triangles.

Definition at line 216 of file PCMGLXRenderWindow.cpp.

References ParCompMark::GLXRenderWindow::WindowStatistics::lastTriangleCount, and mWindowStatistics.

void ParCompMark::GLXRenderWindow::reposition ( const s32 left,
const s32 top 
) [inline, virtual]

Set new window position.

Parameters:
[in] left Horizontal position
[in] top Vertical position

Definition at line 885 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::resize ( const u32 width,
const u32 height 
) [inline, virtual]

Set new window sizes.

Parameters:
[in] width Horizontal size
[in] height Vertical size

Definition at line 898 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::setCaption ( const std::string &  caption  )  [inline]

Setter of mCaption.

Sets value of mCaption.

Parameters:
[in] caption The value of mCaption

Definition at line 781 of file PCMGLXRenderWindow.h.

Referenced by updateStatistics().

void ParCompMark::GLXRenderWindow::setColourDepth ( const u32 colourdepth  )  [inline]

Setter of mColourDepth.

Sets value of mColourDepth.

Parameters:
[in] colourdepth The value of mColourDepth

Definition at line 853 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::setCurrent (  )  [virtual]

Enable the context of the window.

All subsequent rendering commands will go on this window. The side effect of calling this method is reseting the window statistics.

Definition at line 128 of file PCMGLXRenderWindow.cpp.

References ParCompMark::Pointer< T, Lock >::lock(), mGLXGLContext, and ParCompMark::Pointer< T, Lock >::unlock().

Here is the call graph for this function:

void ParCompMark::GLXRenderWindow::setFSAASamples ( const u32 fsaasamples  )  [inline]

Setter of mFSAASamples.

Sets value of mFSAASamples.

Parameters:
[in] fsaasamples The value of mFSAASamples

Definition at line 867 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::setFullScreen ( const bool &  fullscreen  )  [inline]

Setter of mFullScreen.

Sets value of mFullScreen.

Parameters:
[in] fullscreen The value of mFullScreen

Definition at line 767 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::setHeight ( const u32 height  )  [inline]

Setter of mHeight.

Sets value of mHeight.

Parameters:
[in] height The value of mHeight

Definition at line 839 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::setLeft ( const s32 left  )  [inline]

Setter of mLeft.

Sets value of mLeft.

Parameters:
[in] left The value of mLeft

Definition at line 797 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::setTop ( const s32 top  )  [inline]

Setter of mTop.

Sets value of mTop.

Parameters:
[in] top The value of mTop

Definition at line 811 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::setVisible ( const bool &  visible  )  [inline]

Setter of mVisible.

Sets value of mVisible.

Parameters:
[in] visible The value of mVisible

Definition at line 743 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::setWidth ( const u32 width  )  [inline]

Setter of mWidth.

Sets value of mWidth.

Parameters:
[in] width The value of mWidth

Definition at line 825 of file PCMGLXRenderWindow.h.

void ParCompMark::GLXRenderWindow::startFrame (  )  [inline, virtual]

Start a frame.

Definition at line 909 of file PCMGLXRenderWindow.h.


Member Data Documentation

Constant for centered position.

Remarks:
This is own attribute of this class.

Definition at line 140 of file PCMGLXRenderWindow.h.

Referenced by ParCompMark::Process::actualizeRenderWindow(), and createWindow().

Default window height.

Remarks:
This is own attribute of this class.

Definition at line 175 of file PCMGLXRenderWindow.h.

Referenced by ParCompMark::Process::threadInitialize().

Default window width.

Remarks:
This is own attribute of this class.

Definition at line 168 of file PCMGLXRenderWindow.h.

Referenced by ParCompMark::Process::threadInitialize().

Atom to recognize window close events.

Remarks:
This is own attribute of this class.

Definition at line 298 of file PCMGLXRenderWindow.h.

Referenced by createWindow().

Constant for maximal size.

Remarks:
This is own attribute of this class.

Definition at line 147 of file PCMGLXRenderWindow.h.

Referenced by createWindow().

std::string ParCompMark::GLXRenderWindow::mCaption [protected]

Window caption.

Remarks:
This is own attribute of this class.

Definition at line 242 of file PCMGLXRenderWindow.h.

Referenced by _setCaption(), createWindow(), destroyWindow(), GLXRenderWindow(), and updateStatistics().

Colour depth of the window.

Remarks:
This is own attribute of this class.

Definition at line 277 of file PCMGLXRenderWindow.h.

Referenced by GLXRenderWindow().

Corresponding X Display.

Remarks:
This is own attribute of this class.

Definition at line 193 of file PCMGLXRenderWindow.h.

Referenced by _setCaption(), createWindow(), and destroyWindow().

Time of stating measuring a second for FPS calculation.

Remarks:
This is own attribute of this class.

Definition at line 319 of file PCMGLXRenderWindow.h.

Referenced by resetStatistics(), and updateStatistics().

Frame counter for storing number of frames during a second.

Remarks:
This is own attribute of this class.

Definition at line 326 of file PCMGLXRenderWindow.h.

Referenced by resetStatistics(), and updateStatistics().

Number of fullscreen antialasing samples.

Remarks:
This is own attribute of this class.

Definition at line 284 of file PCMGLXRenderWindow.h.

Referenced by createWindow(), and GLXRenderWindow().

The window appears in full screen mode.

Remarks:
This is own attribute of this class.

Definition at line 235 of file PCMGLXRenderWindow.h.

Referenced by createWindow(), and GLXRenderWindow().

GLX context of the render window.

Remarks:
This is own attribute of this class.

Definition at line 200 of file PCMGLXRenderWindow.h.

Referenced by createWindow(), finalize(), releaseCurrent(), and setCurrent().

Vertical size of the window.

Remarks:
This is own attribute of this class.

Definition at line 270 of file PCMGLXRenderWindow.h.

Referenced by createWindow(), and GLXRenderWindow().

The window is initialized.

Remarks:
This is own attribute of this class.

Definition at line 221 of file PCMGLXRenderWindow.h.

Referenced by finalize(), GLXRenderWindow(), initialize(), and ~GLXRenderWindow().

Horizontal position of the window.

Remarks:
This is own attribute of this class.

Definition at line 249 of file PCMGLXRenderWindow.h.

Referenced by createWindow(), and GLXRenderWindow().

For storing original XRR configuration mode.

Remarks:
This is own attribute of this class.

Definition at line 291 of file PCMGLXRenderWindow.h.

Referenced by createWindow(), and GLXRenderWindow().

Corresponding process.

Remarks:
This attribute references an attribute.

Definition at line 207 of file PCMGLXRenderWindow.h.

Referenced by _setCaption().

Time of the start of the rendering.

Remarks:
This is own attribute of this class.

Definition at line 312 of file PCMGLXRenderWindow.h.

Referenced by resetStatistics(), and updateStatistics().

Summarized frame rates for all frames for calculating avgFPS statistics.

Remarks:
This is own attribute of this class.

Definition at line 340 of file PCMGLXRenderWindow.h.

Referenced by initialize().

Summarized triangle count for all frames for calculating avgTriangleCount statistics.

Remarks:
This is own attribute of this class.

Definition at line 333 of file PCMGLXRenderWindow.h.

Referenced by initialize(), and updateStatistics().

Vertical position of the window.

Remarks:
This is own attribute of this class.

Definition at line 256 of file PCMGLXRenderWindow.h.

Referenced by createWindow(), and GLXRenderWindow().

The window is visible.

Remarks:
This is own attribute of this class.

Definition at line 228 of file PCMGLXRenderWindow.h.

Referenced by GLXRenderWindow().

Horizontal size of the window.

Remarks:
This is own attribute of this class.

Definition at line 263 of file PCMGLXRenderWindow.h.

Referenced by createWindow(), and GLXRenderWindow().

Wrapped GLX Window.

Remarks:
This is own attribute of this class.

Definition at line 214 of file PCMGLXRenderWindow.h.

Referenced by _setCaption(), createWindow(), destroyWindow(), and GLXRenderWindow().

Current window statistics.

Remarks:
This is own attribute of this class.

Definition at line 305 of file PCMGLXRenderWindow.h.

Referenced by _setCaption(), initialize(), reportTriangles(), resetStatistics(), and updateStatistics().

Undefined statistics value.

Remarks:
This is own attribute of this class.

Definition at line 154 of file PCMGLXRenderWindow.h.

Referenced by resetStatistics(), and updateStatistics().

Constant for undefined XRR configuration.

Remarks:
This is own attribute of this class.

Definition at line 161 of file PCMGLXRenderWindow.h.

Referenced by GLXRenderWindow().


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