eq::WGLWindow Class Reference

Equalizer default implementation of a WGL window. More...

#include <wglWindow.h>

Inheritance diagram for eq::WGLWindow:

Inheritance graph
[legend]
Collaboration diagram for eq::WGLWindow:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 WGLWindow (Window *parent)
virtual void configExit ()
 De-initialize this OS window.
virtual void makeCurrent () const
 Make the OS window's rendering context and drawable current.
virtual void swapBuffers ()
 Swap the front and back buffer, for doublebuffered drawables.
virtual void joinNVSwapBarrier (const uint32_t group, const uint32_t barrier)
 Join a NV_swap_group.
virtual HWND getWGLWindowHandle () const
virtual HPBUFFERARB getWGLPBufferHandle () const
virtual HDC getWGLDC () const
virtual HGLRC getWGLContext () const
const WGLEventHandlergetWGLEventHandler () const
Data Access
virtual void setWGLWindowHandle (HWND handle)
 Set the Win32 window handle for this window.
virtual void setWGLPBufferHandle (HPBUFFERARB handle)
 Set the Win32 off screen pbuffer handle for this window.
virtual void setWGLContext (HGLRC context)
 Set the WGL rendering context for this window.
WGL/Win32 initialization
virtual bool configInit ()
 Initialize this window for the WGL window system.
virtual bool initWGLAffinityDC ()
 Create, if needed, an affinity device context for this window.
virtual void exitWGLAffinityDC ()
 Destroy the affinity device context.
virtual HDC getWGLAffinityDC ()
virtual HDC createWGLDisplayDC ()
 Create a device context for the display device of the window.
virtual int chooseWGLPixelFormat ()
 Choose a pixel format based on the window's attributes.
virtual bool configInitWGLDrawable (int pixelFormat)
 Initialize the window's drawable (pbuffer or window) and bind the WGL context.
virtual bool configInitWGLWindow (int pixelFormat)
 Initialize the window with an on-screen Win32 window.
virtual bool configInitWGLPBuffer (int pixelFormat)
 Initialize the window with an off-screen WGL PBuffer.
virtual bool configInitWGLFBO (int pixelFormat)
 Initialize the window for an off-screen FBO.
virtual HGLRC createWGLContext ()
 Create a WGL context.
virtual void initEventHandler ()
virtual void exitEventHandler ()
virtual bool processEvent (const WGLWindowEvent &event)

Protected Types

enum  WGLDCType {
  WGL_DC_NONE, WGL_DC_WINDOW, WGL_DC_PBUFFER, WGL_DC_AFFINITY,
  WGL_DC_DISPLAY
}
 The type of the Win32 device context. More...

Protected Member Functions

void setWGLDC (HDC dc, const WGLDCType type)
 Set new device context and release the old DC.
void leaveNVSwapBarrier ()
 Unbind a WGL_NV_swap_barrier.


Detailed Description

Equalizer default implementation of a WGL window.

Definition at line 55 of file wglWindow.h.


Member Enumeration Documentation

enum eq::WGLWindow::WGLDCType [protected]

The type of the Win32 device context.

Enumerator:
WGL_DC_NONE  No device context is set.
WGL_DC_WINDOW  The WGL DC belongs to a window.
WGL_DC_PBUFFER  The WGL DC belongs to a PBuffer.
WGL_DC_AFFINITY  The WGL DC is an affinity DC.
WGL_DC_DISPLAY  The WGL DC is a display DC.

Definition at line 214 of file wglWindow.h.


Member Function Documentation

void eq::WGLWindow::configExit (  )  [virtual]

De-initialize this OS window.

This function might be called on partially or uninitialized OS windows, and has therefore be tolerant enough to handle this.

Implements eq::OSWindow.

Definition at line 52 of file wglWindow.cpp.

References eq::OSWindow::configExitFBO(), EQINFO, eq::OSWindow::exitGLEW(), exitWGLAffinityDC(), getWGLContext(), getWGLPBufferHandle(), getWGLWindowHandle(), eq::Window::IATTR_HINT_FULLSCREEN, eq::Window::IATTR_HINT_SCREENSAVER, leaveNVSwapBarrier(), eq::ON, setWGLContext(), setWGLDC(), setWGLPBufferHandle(), setWGLWindowHandle(), and WGL_DC_NONE.

Referenced by configInit().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::WGLWindow::makeCurrent (  )  const [virtual]

Make the OS window's rendering context and drawable current.

This function invalidates the pipe's make current cache. If this function is not called, Pipe::setCurrent() has to be called appropriately.

Reimplemented from eq::OSWindow.

Definition at line 96 of file wglWindow.cpp.

Referenced by configInit().

Here is the caller graph for this function:

void eq::WGLWindow::swapBuffers (  )  [virtual]

Swap the front and back buffer, for doublebuffered drawables.

Implements eq::OSWindow.

Definition at line 102 of file wglWindow.cpp.

void eq::WGLWindow::joinNVSwapBarrier ( const uint32_t  group,
const uint32_t  barrier 
) [virtual]

Join a NV_swap_group.

See WGL or GLX implementation and OpenGL extension for details on how to implement this function.

Parameters:
group the swap group name.
barrier the swap barrier name.

Implements eq::OSWindow.

Definition at line 786 of file wglWindow.cpp.

References EQINFO, and EQWARN.

virtual HWND eq::WGLWindow::getWGLWindowHandle (  )  const [inline, virtual]

Returns:
the Win32 window handle.

Implements eq::WGLWindowIF.

Definition at line 68 of file wglWindow.h.

Referenced by configExit().

Here is the caller graph for this function:

virtual HPBUFFERARB eq::WGLWindow::getWGLPBufferHandle (  )  const [inline, virtual]

Returns:
the Win32 off screen PBuffer handle.

Implements eq::WGLWindowIF.

Definition at line 71 of file wglWindow.h.

Referenced by configExit().

Here is the caller graph for this function:

virtual HDC eq::WGLWindow::getWGLDC (  )  const [inline, virtual]

Returns:
the Win32 device context used for the current drawable.

Implements eq::WGLWindowIF.

Definition at line 74 of file wglWindow.h.

virtual HGLRC eq::WGLWindow::getWGLContext (  )  const [inline, virtual]

Returns:
the WGL rendering context.

Implements eq::WGLWindowIF.

Definition at line 77 of file wglWindow.h.

Referenced by configExit(), and createWGLContext().

Here is the caller graph for this function:

const WGLEventHandler* eq::WGLWindow::getWGLEventHandler (  )  const [inline]

Returns:
the WGL event handler.

Definition at line 80 of file wglWindow.h.

void eq::WGLWindow::setWGLWindowHandle ( HWND  handle  )  [virtual]

Set the Win32 window handle for this window.

This function should only be called from configInit() or configExit().

Parameters:
handle the window handle.

Definition at line 112 of file wglWindow.cpp.

References eq::OSWindow::_window, eq::PixelViewport::h, eq::Window::setPixelViewport(), setWGLDC(), eq::PixelViewport::w, WGL_DC_NONE, WGL_DC_WINDOW, eq::PixelViewport::x, and eq::PixelViewport::y.

Referenced by configExit(), and configInitWGLWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::WGLWindow::setWGLPBufferHandle ( HPBUFFERARB  handle  )  [virtual]

Set the Win32 off screen pbuffer handle for this window.

This function should only be called from configInit() or configExit().

Parameters:
handle the pbuffer handle.

Definition at line 146 of file wglWindow.cpp.

References eq::OSWindow::_window, eq::PixelViewport::h, eq::Window::setPixelViewport(), setWGLDC(), eq::PixelViewport::w, WGL_DC_NONE, and WGL_DC_PBUFFER.

Referenced by configExit(), and configInitWGLPBuffer().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::WGLWindow::setWGLContext ( HGLRC  context  )  [virtual]

Set the WGL rendering context for this window.

This function should only be called from configInit() or configExit(). The context has to be set to 0 before it is destroyed.

Parameters:
context the WGL rendering context.

Definition at line 107 of file wglWindow.cpp.

Referenced by configExit(), and configInit().

Here is the caller graph for this function:

bool eq::WGLWindow::configInit (  )  [virtual]

Initialize this window for the WGL window system.

This method first calls createWGLAffinityDC(), then chooses a pixel format with chooseWGLPixelFormat(), then creates a drawable using configInitWGLDrawable() and finally creates the context using createWGLContext().

Returns:
true if the initialization was successful, false otherwise.

Implements eq::OSWindow.

Definition at line 219 of file wglWindow.cpp.

References eq::OSWindow::_window, eq::AUTO, chooseWGLPixelFormat(), configExit(), eq::OSWindow::configInitFBO(), configInitWGLDrawable(), createWGLContext(), EQWARN, exitWGLAffinityDC(), eq::FBO, eq::Window::IATTR_HINT_DRAWABLE, eq::Window::IATTR_HINT_SWAPSYNC, eq::OSWindow::initGLEW(), initWGLAffinityDC(), makeCurrent(), eq::OFF, eq::Window::setErrorMessage(), setWGLContext(), setWGLDC(), and WGL_DC_NONE.

Here is the call graph for this function:

bool eq::WGLWindow::initWGLAffinityDC (  )  [virtual]

Create, if needed, an affinity device context for this window.

Returns:
false on error, true otherwise

Definition at line 499 of file wglWindow.cpp.

References eq::WGLPipe::createWGLAffinityDC(), and eq::Pipe::getOSPipe().

Referenced by configInit().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::WGLWindow::exitWGLAffinityDC (  )  [virtual]

Destroy the affinity device context.

Definition at line 490 of file wglWindow.cpp.

Referenced by configExit(), and configInit().

Here is the caller graph for this function:

HDC eq::WGLWindow::getWGLAffinityDC (  )  [virtual]

Returns:
the affinity device context.

Reimplemented from eq::WGLWindowIF.

Definition at line 514 of file wglWindow.cpp.

References WGL_DC_AFFINITY.

HDC eq::WGLWindow::createWGLDisplayDC (  )  [virtual]

Create a device context for the display device of the window.

The returned device context has to be released using DeleteDC. The window's error message is set if an error occured.

Returns:
the DC, or 0 upon error.

Definition at line 523 of file wglWindow.cpp.

References eq::WGLPipe::createWGLDisplayDC(), and eq::Pipe::getOSPipe().

Referenced by configInitWGLPBuffer().

Here is the call graph for this function:

Here is the caller graph for this function:

int eq::WGLWindow::chooseWGLPixelFormat (  )  [virtual]

Choose a pixel format based on the window's attributes.

Uses the currently set DC (if any) and sets the chosen pixel format on it.

Returns:
a pixel format, or 0 if no pixel format was found.

Definition at line 535 of file wglWindow.cpp.

References eq::OSWindow::_window, eq::AUTO, EQWARN, eq::FBO, eq::Window::IATTR_HINT_DOUBLEBUFFER, eq::Window::IATTR_HINT_DRAWABLE, eq::Window::IATTR_HINT_STEREO, eq::Window::IATTR_PLANES_ACCUM, eq::Window::IATTR_PLANES_ACCUM_ALPHA, eq::Window::IATTR_PLANES_ALPHA, eq::Window::IATTR_PLANES_COLOR, eq::Window::IATTR_PLANES_DEPTH, eq::Window::IATTR_PLANES_SAMPLES, eq::Window::IATTR_PLANES_STENCIL, eq::ON, eq::PBUFFER, eq::RGBA16F, eq::RGBA32F, eq::Window::setErrorMessage(), and eq::WINDOW.

Referenced by configInit().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::WGLWindow::configInitWGLDrawable ( int  pixelFormat  )  [virtual]

Initialize the window's drawable (pbuffer or window) and bind the WGL context.

Sets the window handle on success.

Parameters:
pixelFormat the window's target pixel format.
Returns:
true if the drawable was created, false otherwise.

Definition at line 280 of file wglWindow.cpp.

References configInitWGLFBO(), configInitWGLPBuffer(), configInitWGLWindow(), EQWARN, eq::FBO, eq::Window::IATTR_HINT_DRAWABLE, eq::PBUFFER, eq::UNDEFINED, and eq::WINDOW.

Referenced by configInit().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::WGLWindow::configInitWGLWindow ( int  pixelFormat  )  [virtual]

Initialize the window with an on-screen Win32 window.

Sets the window handle on success.

Parameters:
pixelFormat the window's target pixel format.
Returns:
true if the drawable was created, false otherwise.

Definition at line 340 of file wglWindow.cpp.

References eq::OSWindow::_window, eq::Window::getPixelViewport(), eq::Window::IATTR_HINT_SCREENSAVER, eq::ON, eq::Window::setErrorMessage(), and setWGLWindowHandle().

Referenced by configInitWGLDrawable().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::WGLWindow::configInitWGLPBuffer ( int  pixelFormat  )  [virtual]

Initialize the window with an off-screen WGL PBuffer.

Sets the window handle on success.

Parameters:
pixelFormat the window's target pixel format.
Returns:
true if the drawable was created, false otherwise.

Definition at line 458 of file wglWindow.cpp.

References eq::OSWindow::_window, createWGLDisplayDC(), eq::Window::getPixelViewport(), eq::PixelViewport::h, eq::PixelViewport::isValid(), eq::Window::setErrorMessage(), setWGLPBufferHandle(), and eq::PixelViewport::w.

Referenced by configInitWGLDrawable().

Here is the call graph for this function:

Here is the caller graph for this function:

HGLRC eq::WGLWindow::createWGLContext (  )  [virtual]

Create a WGL context.

This method does not set the window's WGL context.

Returns:
the context, or 0 if context creation failed.

Definition at line 727 of file wglWindow.cpp.

References eq::OSWindow::_window, EQWARN, eq::Window::getOSWindow(), eq::Window::getSharedContextWindow(), getWGLContext(), and eq::Window::setErrorMessage().

Referenced by configInit().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::WGLWindow::setWGLDC ( HDC  dc,
const WGLDCType  type 
) [protected]

Set new device context and release the old DC.

Parameters:
dc the new DC.
type the type of the new DC.

Definition at line 172 of file wglWindow.cpp.

References WGL_DC_AFFINITY, WGL_DC_DISPLAY, WGL_DC_NONE, WGL_DC_PBUFFER, and WGL_DC_WINDOW.

Referenced by configExit(), configInit(), configInitWGLFBO(), setWGLPBufferHandle(), and setWGLWindowHandle().

Here is the caller graph for this function:

void eq::WGLWindow::leaveNVSwapBarrier (  )  [protected]

Unbind a WGL_NV_swap_barrier.

Definition at line 836 of file wglWindow.cpp.

Referenced by configExit().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Aug 10 18:58:43 2009 for Equalizer 0.9 by  doxygen 1.5.8