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)
 Process an event received from WGL.

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 59 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 218 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 the implemenation has therefore be tolerant enough to handle this case.

Implements eq::OSWindow.

Definition at line 61 of file wglWindow.cpp.

References eq::GLWindow::configExitFBO(), EQINFO, eq::GLWindow::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::GLWindow.

Definition at line 105 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 113 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 870 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 72 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 75 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 78 of file wglWindow.h.

virtual HGLRC eq::WGLWindow::getWGLContext (  )  const [inline, virtual]
Returns:
the WGL rendering context.

Implements eq::WGLWindowIF.

Definition at line 81 of file wglWindow.h.

Referenced by configExit().

Here is the caller graph for this function:

const WGLEventHandler* eq::WGLWindow::getWGLEventHandler (  )  const [inline]
Returns:
the WGL event handler.

Definition at line 84 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 123 of file wglWindow.cpp.

References eq::OSWindow::_window, eq::Window::setPixelViewport(), setWGLDC(), WGL_DC_NONE, and WGL_DC_WINDOW.

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 157 of file wglWindow.cpp.

References eq::OSWindow::_window, eq::Window::setPixelViewport(), setWGLDC(), 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 118 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 230 of file wglWindow.cpp.

References eq::OSWindow::_window, eq::AUTO, chooseWGLPixelFormat(), configExit(), eq::GLWindow::configInitFBO(), configInitWGLDrawable(), createWGLContext(), EQWARN, exitWGLAffinityDC(), eq::FBO, eq::Window::IATTR_HINT_DRAWABLE, eq::Window::IATTR_HINT_SWAPSYNC, eq::GLWindow::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 515 of file wglWindow.cpp.

References eq::WGLPipe::createWGLAffinityDC().

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 506 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 530 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 539 of file wglWindow.cpp.

References eq::WGLPipe::createWGLDisplayDC().

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 551 of file wglWindow.cpp.

References eq::OSWindow::_window, and eq::Window::setErrorMessage().

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 291 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 352 of file wglWindow.cpp.

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

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 473 of file wglWindow.cpp.

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

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 812 of file wglWindow.cpp.

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

Referenced by configInit().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::WGLWindow::processEvent ( const WGLWindowEvent event  )  [virtual]

Process an event received from WGL.

Reimplemented from eq::WGLWindowIF.

Definition at line 855 of file wglWindow.cpp.

References eq::Event::type, and eq::Event::WINDOW_EXPOSE.

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 183 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 920 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 Sat Feb 6 13:07:05 2010 for Equalizer 0.9.1 by  doxygen 1.6.1