Equalizer  1.2.1
Public Member Functions | Public Types | Protected Member Functions | Friends
eq::Window Class Reference

A Window represents an on-screen or off-screen drawable. More...

#include <window.h>

+ Inheritance diagram for eq::Window:
+ Collaboration diagram for eq::Window:

List of all members.

Public Member Functions

 Window (Pipe *parent)
 Construct a new window.
virtual ~Window ()
 Destruct the window.
Data Access
co::CommandQueuegetPipeThreadQueue ()
co::CommandQueuegetCommandThreadQueue ()
uint32_t getCurrentFrame () const
const NodegetNode () const
NodegetNode ()
const ConfiggetConfig () const
ConfiggetConfig ()
ClientPtr getClient ()
ServerPtr getServer ()
bool isRunning () const
bool isStopped () const
bool getRenderContext (const int32_t x, const int32_t y, RenderContext &context) const
 Get the last rendering context at the x, y position.
OpenGL context handling and sharing
void setSharedContextWindow (Window *sharedContextWindow)
 Set the window with which this window shares the OpenGL context.
const WindowgetSharedContextWindow () const
WindowgetSharedContextWindow ()
ObjectManagergetObjectManager ()
const ObjectManagergetObjectManager () const
const FontgetSmallFont ()
const FontgetMediumFont ()
const GLEWContext * glewGetContext () const
 Get the GLEW context for this window.
uint32_t getColorFormat () const
SystemWindow interface
void setSystemWindow (SystemWindow *window)
 Set the OS-specific window.
const SystemWindowgetSystemWindow () const
SystemWindowgetSystemWindow ()
const SystemPipegetSystemPipe () const
SystemPipegetSystemPipe ()

Public Types

typedef eq::ObjectManager ObjectManager
 The per-window OpenGL object manager.
typedef BitmapFont Font
 Fonts used for overlays.

Protected Member Functions

virtual void attach (const UUID &id, const uint32_t instanceID)

Friends

class Pipe
class Channel

Actions

virtual void flush () const
 Flush outstanding rendering requests.
virtual void finish () const
 Finish outstanding rendering requests.
virtual void swapBuffers ()
 Swap the front and back buffer of the window.
virtual void drawFPS ()
 Render the current framerate as on overlay.
float getFPS () const
virtual void makeCurrent (const bool cache=true) const
virtual void bindFrameBuffer () const
virtual void notifyViewportChanged ()
void startFrame (const uint32_t frameNumber)
 Start a frame by unlocking all child resources.
void releaseFrame (const uint32_t frameNumber)
 Signal the completion of a frame to the parent.
void releaseFrameLocal (const uint32_t frameNumber)
 Signal the release of the local synchronization to the parent.

Callbacks

The callbacks are called by Equalizer during rendering to execute various actions.

virtual bool processEvent (const Event &event)
 Process a received event.
virtual bool configInit (const uint128_t &initID)
 Initialize this window.
virtual bool configInitSystemWindow (const uint128_t &initID)
 Initialize the OS-specific window.
virtual bool configInitGL (const uint128_t &initID)
 Initialize the OpenGL state for this window.
virtual bool configExit ()
 Exit this window.
virtual bool configExitSystemWindow ()
 De-initialize the OS-specific window.
virtual bool configExitGL ()
 De-initialize the OpenGL state for this window.
virtual void frameStart (const uint128_t &frameID, const uint32_t frameNumber)
 Start rendering a frame.
virtual void frameFinish (const uint128_t &frameID, const uint32_t frameNumber)
 Finish rendering a frame.
virtual void frameDrawFinish (const uint128_t &frameID, const uint32_t frameNumber)
 Finish drawing.

Detailed Description

A Window represents an on-screen or off-screen drawable.

A drawable is a 2D rendering surface, typically attached to an OpenGL context. A window uses an SystemWindow implementation to manage the operating system specific handling of window and context creation.

A Window is a child of a Pipe. The task methods for all windows of a pipe are executed in the same pipe thread. All window and subsequent channel task methods are executed in the order the windows are defined on the pipe, with the exception of the swap and finish tasks, which are executed after all windows have been updated. This ensures that all windows of a given pipe swap at the same time.

The default window initialization methods initialize all windows of the same pipe with a shared context, so that OpenGL objects can be reused between them for optimal GPU memory usage. The window facilitates OpenGL object management by providing an ObjectManager for allocating and sharing OpenGL objects.

Please note that each window potentially has its own OpenGL command buffer, thus glFlush is needed to synchronize the state of OpenGL objects between windows. Therefore, Equalizer calls flush() at the end of each frame for each window.

See also:
fabric::Window

Definition at line 63 of file include/eq/client/window.h.


Member Typedef Documentation

Fonts used for overlays.

Version:
1.0

Definition at line 70 of file include/eq/client/window.h.

The per-window OpenGL object manager.

Version:
1.0

Definition at line 67 of file include/eq/client/window.h.


Constructor & Destructor Documentation

eq::Window::Window ( Pipe parent)

Construct a new window.

Version:
1.0

Reimplemented in eqAsync::Window, eqPly::Window, osgScaleViewer::Window, eqNbody::Window, eqPixelBench::Window, and eVolve::Window.

virtual eq::Window::~Window ( ) [virtual]

Destruct the window.

Version:
1.0

Reimplemented from eq::fabric::Window< Pipe, Window, Channel >.

Reimplemented in eqPly::Window, eVolve::Window, osgScaleViewer::Window, and eqNbody::Window.


Member Function Documentation

virtual bool eq::Window::configExit ( ) [protected, virtual]

Exit this window.

Version:
1.0
virtual bool eq::Window::configExitGL ( ) [inline, protected, virtual]

De-initialize the OpenGL state for this window.

Version:
1.0

Reimplemented in eqPly::Window, and osgScaleViewer::Window.

Definition at line 362 of file include/eq/client/window.h.

virtual bool eq::Window::configExitSystemWindow ( ) [protected, virtual]

De-initialize the OS-specific window.

Version:
1.0

Referenced by eqPly::Window::configInitSystemWindow().

+ Here is the caller graph for this function:

virtual bool eq::Window::configInit ( const uint128_t initID) [protected, virtual]

Initialize this window.

Parameters:
initIDthe init identifier.
Version:
1.0

Reimplemented in eVolve::Window, and eqPixelBench::Window.

virtual bool eq::Window::configInitGL ( const uint128_t initID) [protected, virtual]

Initialize the OpenGL state for this window.

Parameters:
initIDthe init identifier.
Returns:
true if the initialization was successful, false if not.
Version:
1.0

Reimplemented in eqAsync::Window, eqPly::Window, eVolve::Window, and osgScaleViewer::Window.

Referenced by osgScaleViewer::Window::configInitGL(), eqAsync::Window::configInitGL(), and eqPly::Window::configInitGL().

+ Here is the caller graph for this function:

virtual bool eq::Window::configInitSystemWindow ( const uint128_t initID) [protected, virtual]

Initialize the OS-specific window.

See also:
setSystemWindow()
Version:
1.0

Reimplemented in eqPly::Window.

Referenced by eqPly::Window::configInitSystemWindow().

+ Here is the caller graph for this function:

virtual void eq::Window::drawFPS ( ) [virtual]

Render the current framerate as on overlay.

Version:
1.0
virtual void eq::Window::finish ( ) const [inline, virtual]

Finish outstanding rendering requests.

Called before a software swap barrier to ensure that the window will swap directly after the barrier is left.

Version:
1.0

Definition at line 213 of file include/eq/client/window.h.

virtual void eq::Window::flush ( ) const [inline, virtual]

Flush outstanding rendering requests.

Called at the end of each frame from frameFinish() to ensure timely execution of pending rendering requests.

Version:
1.0

Definition at line 204 of file include/eq/client/window.h.

virtual void eq::Window::frameDrawFinish ( const uint128_t frameID,
const uint32_t  frameNumber 
) [protected, virtual]

Finish drawing.

Called once per frame after the last draw operation. Typically releases the local node thread synchronization for this frame.

Parameters:
frameIDthe per-frame identifier.
frameNumberthe frame to finished with draw.
Version:
1.0
virtual void eq::Window::frameFinish ( const uint128_t frameID,
const uint32_t  frameNumber 
) [protected, virtual]

Finish rendering a frame.

Called once at the end of each frame, to do per-frame updates of window-specific data. This method has to call releaseFrame(). The default implementation also flushes all rendering commands. This light-weight call ensures that all outstanding rendering commands for the window's context are being executed in a timely fashion.

Parameters:
frameIDthe per-frame identifier.
frameNumberthe frame to finish.
Version:
1.0
virtual void eq::Window::frameStart ( const uint128_t frameID,
const uint32_t  frameNumber 
) [protected, virtual]

Start rendering a frame.

Called once at the beginning of each frame, to do per-frame updates of window-specific data. This method has to call startFrame().

Parameters:
frameIDthe per-frame identifier.
frameNumberthe frame to start.
Version:
1.0

Reimplemented in eqPly::Window.

Returns:
the Client of this window.
Version:
1.0
const Config* eq::Window::getConfig ( ) const
Returns:
the Config of this window.
Version:
1.0

Referenced by eqPly::Window::configInitGL().

+ Here is the caller graph for this function:

Returns:
the Config of this window.
Version:
1.0
float eq::Window::getFPS ( ) const [inline]
Returns:
the window's average framerate.
Version:
1.0

Definition at line 222 of file include/eq/client/window.h.

Returns:
a medium bitmap font used for overlays.
Warning:
experimental - may not be supported in the future.
const Node* eq::Window::getNode ( ) const
Returns:
the Node of this window.
Version:
1.0

Referenced by osgScaleViewer::Window::configInitGL().

+ Here is the caller graph for this function:

Returns:
the Node of this window.
Version:
1.0
Returns:
the window's object manager instance.
Version:
1.0

Definition at line 154 of file include/eq/client/window.h.

Referenced by eqPly::Window::configInitGL().

+ Here is the caller graph for this function:

const ObjectManager* eq::Window::getObjectManager ( ) const [inline]
Returns:
the window's object manager instance.
Version:
1.0

Definition at line 157 of file include/eq/client/window.h.

bool eq::Window::getRenderContext ( const int32_t  x,
const int32_t  y,
RenderContext &  context 
) const

Get the last rendering context at the x, y position.

If no render context is found on the given position, false is returned and context is not modified.

Returns:
true if a render context was found, false otherwise.
Warning:
experimental - may not be supported in the future.
Returns:
the Server of this window.
Version:
1.0
const Window* eq::Window::getSharedContextWindow ( ) const [inline]
Returns:
the window with which this window shares the GL context.
Version:
1.0

Definition at line 144 of file include/eq/client/window.h.

Referenced by osgScaleViewer::Window::configInitGL().

+ Here is the caller graph for this function:

Returns:
the window with which this window shares the GL context.
Version:
1.0

Definition at line 151 of file include/eq/client/window.h.

Returns:
a small bitmap font used for overlays.
Warning:
experimental - may not be supported in the future.
Returns:
the OS-specific pipe implementation.
Version:
1.0
Returns:
the OS-specific pipe implementation.
Version:
1.0
const SystemWindow* eq::Window::getSystemWindow ( ) const [inline]
Returns:
the OS-specific window implementation.
Version:
1.0

Definition at line 256 of file include/eq/client/window.h.

Returns:
the OS-specific window implementation.
Version:
1.0

Definition at line 259 of file include/eq/client/window.h.

const GLEWContext* eq::Window::glewGetContext ( ) const

Get the GLEW context for this window.

The glew context is provided and initialized by the SystemWindow, and provides access to OpenGL extensions. This function does not follow the Equalizer naming conventions, since GLEW uses a function of this name to automatically resolve OpenGL function entry points. Therefore, any OpenGL function support by the driver can be directly called from any method of an initialized window.

Returns:
the extended OpenGL function table for the window's OpenGL context.
Version:
1.0

Referenced by eVolve::Window::configInitGL().

+ Here is the caller graph for this function:

bool eq::Window::isRunning ( ) const [inline]
Returns:
true if this window is running, false otherwise.
Version:
1.0

Definition at line 106 of file include/eq/client/window.h.

bool eq::Window::isStopped ( ) const [inline]
Returns:
true if this window is stopped, false otherwise.
Version:
1.0

Definition at line 112 of file include/eq/client/window.h.

virtual bool eq::Window::processEvent ( const Event event) [virtual]

Process a received event.

The task of this method is to update the window as necessary, and transform the event into an config event to be send to the application using Config::sendEvent().

Parameters:
eventthe received window system event.
Returns:
true when the event was handled, false if not.
Version:
1.0
void eq::Window::releaseFrame ( const uint32_t  frameNumber) [protected]

Signal the completion of a frame to the parent.

Parameters:
frameNumberthe frame to end.
Version:
1.0
void eq::Window::releaseFrameLocal ( const uint32_t  frameNumber) [protected]

Signal the release of the local synchronization to the parent.

Parameters:
frameNumberthe frame to release.
Version:
1.0
void eq::Window::setSharedContextWindow ( Window sharedContextWindow) [inline]

Set the window with which this window shares the OpenGL context.

By default it is set to the first window of the pipe in the window's constructor. The shared context window is used during initialization to setup the OpenGL context and util::ObjectManager.

Version:
1.0

Definition at line 137 of file include/eq/client/window.h.

Set the OS-specific window.

The SystemWindow implements the window-system-dependent part, e.g., the drawable creation. This window forwards certain calls, e.g., swapBuffers(), to the SystemWindow. The os-specific window has to be initialized.

Version:
1.0
void eq::Window::startFrame ( const uint32_t  frameNumber) [protected]

Start a frame by unlocking all child resources.

Parameters:
frameNumberthe frame to start.
Version:
1.0
virtual void eq::Window::swapBuffers ( ) [virtual]

Swap the front and back buffer of the window.

Version:
1.0

Reimplemented in eVolve::Window, and eqNbody::Window.

Referenced by eqNbody::Window::swapBuffers().

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file:
Generated on Fri Jun 8 2012 15:44:35 for Equalizer 1.2.1 by  doxygen 1.8.0