Equalizer  1.6.1
Public Member Functions | Protected Types | Protected Member Functions | List of all members
eq::wgl::Window Class Reference

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

#include <window.h>

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

Public Member Functions

 Window (eq::Window *parent)
 Create a new WGL window for the given eq::Window. More...
 
virtual ~Window ()
 Destruct the WGL window. More...
 
Data Access
virtual void setWGLContext (HGLRC context)
 Set the WGL rendering context for this window. More...
 
virtual void setWGLWindowHandle (HWND handle)
 Set the Win32 window handle for this window. More...
 
virtual void setWGLPBufferHandle (HPBUFFERARB handle)
 Set the Win32 off screen pbuffer handle for this window. More...
 
virtual HWND getWGLWindowHandle () const
 
virtual HPBUFFERARB getWGLPBufferHandle () const
 
virtual HDC getWGLDC () const
 
virtual HGLRC getWGLContext () const
 
const EventHandlergetWGLEventHandler () const
 
WGL/Win32 initialization
virtual bool configInit ()
 Initialize this window for the WGL window system. More...
 
virtual void configExit ()
 
virtual bool initWGLAffinityDC ()
 Create, if needed, an affinity device context for this window. More...
 
virtual void exitWGLAffinityDC ()
 Destroy the affinity device context. More...
 
virtual HDC getWGLAffinityDC ()
 
virtual HDC createWGLDisplayDC ()
 Create a device context for the display device of the window. More...
 
virtual int chooseWGLPixelFormat ()
 Choose a pixel format based on the window's attributes. More...
 
virtual bool configInitWGLDrawable (int pixelFormat)
 Initialize the window's drawable (pbuffer or window) and bind the WGL context. More...
 
virtual bool configInitWGLWindow (int pixelFormat)
 Initialize the window with an on-screen Win32 window. More...
 
virtual bool configInitWGLPBuffer (int pixelFormat)
 Initialize the window with an off-screen WGL PBuffer. More...
 
virtual bool configInitWGLFBO (int pixelFormat)
 Initialize the window for an off-screen FBO.
 
virtual HGLRC createWGLContext ()
 Create a WGL context. More...
 
virtual void destroyWGLContext (HGLRC context)
 Destroy the given WGL context. More...
 
virtual void initEventHandler ()
 Set up an WGLEventHandler, called by setWGLWindowHandle(). More...
 
virtual void exitEventHandler ()
 Destroy the WGLEventHandler, called by setWGLWindowHandle(). More...
 
Operations.
virtual void makeCurrent (const bool cache=true) const
 
virtual void swapBuffers ()
 
virtual void joinNVSwapBarrier (const uint32_t group, const uint32_t barrier)
 Join the WGL_NV_swap_group. More...
 
void leaveNVSwapBarrier ()
 Unbind a WGL_NV_swap_barrier. More...
 
virtual bool processEvent (const WindowEvent &event)
 
- Public Member Functions inherited from eq::wgl::WindowIF
 WindowIF (eq::Window *parent)
 Construct a new WGL window for the given eq::Window. More...
 
virtual ~WindowIF ()
 Destruct the WGL window. More...
 
- Public Member Functions inherited from eq::GLWindow
 GLWindow (Window *parent)
 Construct a new OpenGL window. More...
 
virtual ~GLWindow ()
 Destruct a new OpenGL window. More...
 
bool isCurrent () const
 
virtual void initGLEW ()
 Initialize the GLEW context for this window. More...
 
virtual void exitGLEW ()
 De-initialize the GLEW context. More...
 
virtual const GLEWContext * glewGetContext () const
 Get the GLEW context for this window. More...
 
virtual void queryDrawableConfig (DrawableConfig &)
 Set up the drawable config by querying the current context. More...
 
virtual void bindFrameBuffer () const
 Bind the window's FBO, if it uses an FBO drawable. More...
 
virtual void flush ()
 Flush all command buffers. More...
 
virtual void finish ()
 Finish execution of all commands. More...
 
virtual bool configInitFBO ()
 Build and initialize the FBO. More...
 
virtual void configExitFBO ()
 Destroy the FBO. More...
 
virtual const
util::FrameBufferObject
getFrameBufferObject () const
 
- Public Member Functions inherited from eq::SystemWindow
 SystemWindow (Window *parent)
 Create a new SystemWindow for the given eq::Window. More...
 
virtual ~SystemWindow ()
 Destroy the SystemWindow. More...
 
void setError (const int32_t error)
 Set an error code why the last operation failed. More...
 
eq::fabric::Error getError () const
 
virtual bool processEvent (const Event &event)
 Process an event. More...
 
bool configInitFBO ()
 Build and initialize the FBO. More...
 
void configExitFBO ()
 Destroy FBO. More...
 
WindowgetWindow ()
 
const WindowgetWindow () const
 
PipegetPipe ()
 
const PipegetPipe () const
 
NodegetNode ()
 
const NodegetNode () const
 
ConfiggetConfig ()
 
const ConfiggetConfig () const
 
int32_t getIAttribute (const Window::IAttribute attr) const
 

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. More...
 
WGLEWContext * wglewGetContext ()
 
PipegetWGLPipe ()
 

Detailed Description

Equalizer default implementation of a WGL window.

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

Member Enumeration Documentation

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 271 of file include/eq/client/wgl/window.h.

Constructor & Destructor Documentation

eq::wgl::Window::Window ( eq::Window parent)

Create a new WGL window for the given eq::Window.

Version
1.0
virtual eq::wgl::Window::~Window ( )
virtual

Destruct the WGL window.

Version
1.0

Member Function Documentation

virtual int eq::wgl::Window::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.
Version
1.0
virtual void eq::wgl::Window::configExit ( )
virtual
Version
1.0

Implements eq::SystemWindow.

virtual bool eq::wgl::Window::configInit ( )
virtual

Initialize this window for the WGL window system.

This method first calls initWGLAffinityDC, 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.
Version
1.0

Implements eq::SystemWindow.

virtual bool eq::wgl::Window::configInitWGLDrawable ( int  pixelFormat)
virtual

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

Sets the window handle on success.

Parameters
pixelFormatthe window's target pixel format.
Returns
true if the drawable was created, false otherwise.
Version
1.0
virtual bool eq::wgl::Window::configInitWGLPBuffer ( int  pixelFormat)
virtual

Initialize the window with an off-screen WGL PBuffer.

Sets the window handle on success.

Parameters
pixelFormatthe window's target pixel format.
Returns
true if the drawable was created, false otherwise.
Version
1.0
virtual bool eq::wgl::Window::configInitWGLWindow ( int  pixelFormat)
virtual

Initialize the window with an on-screen Win32 window.

Sets the window handle on success.

Parameters
pixelFormatthe window's target pixel format.
Returns
true if the drawable was created, false otherwise.
Version
1.0
virtual HGLRC eq::wgl::Window::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.
Version
1.0
virtual HDC eq::wgl::Window::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.
Version
1.0
virtual void eq::wgl::Window::destroyWGLContext ( HGLRC  context)
virtual

Destroy the given WGL context.

Version
1.0
virtual void eq::wgl::Window::exitEventHandler ( )
virtual

Destroy the WGLEventHandler, called by setWGLWindowHandle().

Version
1.0
virtual void eq::wgl::Window::exitWGLAffinityDC ( )
virtual

Destroy the affinity device context.

Version
1.0
virtual HDC eq::wgl::Window::getWGLAffinityDC ( )
virtual
Returns
the affinity device context.
Version
1.0

Reimplemented from eq::wgl::WindowIF.

virtual HGLRC eq::wgl::Window::getWGLContext ( ) const
inlinevirtual
Returns
the WGL rendering context.
Version
1.0

Implements eq::wgl::WindowIF.

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

virtual HDC eq::wgl::Window::getWGLDC ( ) const
inlinevirtual
Returns
the Win32 device context used for the current drawable.
Version
1.0

Implements eq::wgl::WindowIF.

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

const EventHandler* eq::wgl::Window::getWGLEventHandler ( ) const
inline
Returns
the WGL event handler.
Version
1.0

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

virtual HPBUFFERARB eq::wgl::Window::getWGLPBufferHandle ( ) const
inlinevirtual
Returns
the Win32 off screen PBuffer handle.
Version
1.0

Implements eq::wgl::WindowIF.

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

Pipe* eq::wgl::Window::getWGLPipe ( )
protected
Returns
the WGL OS parent pipe.
virtual HWND eq::wgl::Window::getWGLWindowHandle ( ) const
inlinevirtual
Returns
the Win32 window handle.
Version
1.0

Implements eq::wgl::WindowIF.

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

virtual void eq::wgl::Window::initEventHandler ( )
virtual

Set up an WGLEventHandler, called by setWGLWindowHandle().

Version
1.0
virtual bool eq::wgl::Window::initWGLAffinityDC ( )
virtual

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

Returns
false on error, true otherwise
Version
1.0
virtual void eq::wgl::Window::joinNVSwapBarrier ( const uint32_t  group,
const uint32_t  barrier 
)
virtual

Join the WGL_NV_swap_group.

Version
1.0

Implements eq::SystemWindow.

void eq::wgl::Window::leaveNVSwapBarrier ( )

Unbind a WGL_NV_swap_barrier.

Version
1.0
virtual void eq::wgl::Window::makeCurrent ( const bool  cache = true) const
virtual
Version
1.0

Reimplemented from eq::GLWindow.

virtual bool eq::wgl::Window::processEvent ( const WindowEvent event)
virtual
Version
1.0

Implements eq::wgl::WindowIF.

virtual void eq::wgl::Window::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
contextthe WGL rendering context.
Version
1.0
void eq::wgl::Window::setWGLDC ( HDC  dc,
const WGLDCType  type 
)
protected

Set new device context and release the old DC.

Parameters
dcthe new DC.
typethe type of the new DC.
virtual void eq::wgl::Window::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
handlethe pbuffer handle.
Version
1.0
virtual void eq::wgl::Window::setWGLWindowHandle ( HWND  handle)
virtual

Set the Win32 window handle for this window.

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

Parameters
handlethe window handle.
Version
1.0
virtual void eq::wgl::Window::swapBuffers ( )
virtual
Version
1.0

Implements eq::SystemWindow.

WGLEWContext* eq::wgl::Window::wglewGetContext ( )
protected
Returns
the generic WGL function table for the window's pipe.

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