Equalizer  1.10.1
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

EQ_API Window (NotifierInterface &parent, const WindowSettings &settings, Pipe &pipe)
 Create a new WGL window for the given eq::Window. More...
 
virtual EQ_API ~Window ()
 Destruct the WGL window. More...
 
Data Access
virtual EQ_API void setWGLContext (HGLRC context)
 Set the WGL rendering context for this window. More...
 
virtual EQ_API void setWGLWindowHandle (HWND handle)
 Set the Win32 window handle for this window. More...
 
virtual EQ_API void setWGLPBufferHandle (HPBUFFERARB handle)
 Set the Win32 off screen pbuffer handle for this window. More...
 
virtual EQ_API HWND getWGLWindowHandle () const
 
virtual EQ_API HPBUFFERARB getWGLPBufferHandle () const
 
virtual EQ_API HDC getWGLDC () const
 
virtual EQ_API HGLRC getWGLContext () const
 
EQ_API const EventHandlergetWGLEventHandler () const
 
WGL/Win32 initialization
virtual EQ_API bool configInit ()
 Initialize this window for the WGL window system. More...
 
virtual EQ_API void configExit ()
 
virtual EQ_API bool initWGLAffinityDC ()
 Create, if needed, an affinity device context for this window. More...
 
virtual EQ_API void exitWGLAffinityDC ()
 Destroy the affinity device context. More...
 
virtual EQ_API HDC getWGLAffinityDC ()
 
virtual EQ_API HDC createWGLDisplayDC ()
 Create a device context for the display device of the window. More...
 
virtual EQ_API int chooseWGLPixelFormat ()
 Choose a pixel format based on the window's attributes. More...
 
virtual EQ_API bool configInitWGLDrawable (int pixelFormat)
 Initialize the window's drawable (pbuffer or window) and bind the WGL context. More...
 
virtual EQ_API bool configInitWGLWindow (int pixelFormat)
 Initialize the window with an on-screen Win32 window. More...
 
virtual EQ_API bool configInitWGLPBuffer (int pixelFormat)
 Initialize the window with an off-screen WGL PBuffer. More...
 
virtual EQ_API bool configInitWGLFBO (int pixelFormat)
 Initialize the window for an off-screen FBO.
 
virtual EQ_API HGLRC createWGLContext ()
 Create a WGL context. More...
 
virtual EQ_API void destroyWGLContext (HGLRC context)
 Destroy the given WGL context. More...
 
virtual EQ_API void initEventHandler ()
 Set up an WGLEventHandler, called by setWGLWindowHandle(). More...
 
virtual EQ_API void exitEventHandler ()
 Destroy the WGLEventHandler, called by setWGLWindowHandle(). More...
 
Operations.
virtual EQ_API void makeCurrent (const bool cache=true) const
 
virtual EQ_API void doneCurrent () const
 
virtual EQ_API void swapBuffers ()
 
virtual EQ_API 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 EQ_API bool processEvent (const WindowEvent &event)
 
- Public Member Functions inherited from eq::wgl::WindowIF
 WindowIF (NotifierInterface &parent, const WindowSettings &settings)
 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
EQ_API GLWindow (NotifierInterface &parent, const WindowSettings &settings)
 Construct a new OpenGL window. More...
 
virtual EQ_API ~GLWindow ()
 Destruct a new OpenGL window. More...
 
EQ_API bool isCurrent () const
 
virtual EQ_API void initGLEW ()
 Initialize the GLEW context for this window. More...
 
virtual EQ_API void exitGLEW ()
 De-initialize the GLEW context. More...
 
EQ_API const GLEWContext * glewGetContext () const override
 Get the GLEW context for this window. More...
 
EQ_API void queryDrawableConfig (DrawableConfig &) override
 Set up the drawable config by querying the current context. More...
 
EQ_API void bindFrameBuffer () const override
 Bind the window's FBO, if it uses an FBO drawable. More...
 
EQ_API void bindDrawFrameBuffer () const override
 Bind the window's draw FBO, used for multisampling. More...
 
EQ_API void updateFrameBuffer () const override
 Update the window's FBO from the multisampled FBO. More...
 
EQ_API void flush () override
 Flush all command buffers. More...
 
EQ_API void finish () override
 Finish execution of all commands. More...
 
virtual EQ_API bool configInitFBO ()
 Build and initialize the FBO. More...
 
virtual EQ_API void configExitFBO ()
 Destroy the FBO. More...
 
EQ_API const
util::FrameBufferObject
getFrameBufferObject () const override
 
EQ_API util::FrameBufferObjectgetFrameBufferObject () override
 
- Public Member Functions inherited from eq::SystemWindow
EQ_API SystemWindow (NotifierInterface &parent, const WindowSettings &settings)
 Create a new SystemWindow for the given eq::Window. More...
 
virtual EQ_API ~SystemWindow ()
 Destroy the SystemWindow. More...
 
EQ_API EventOCommand sendError (const uint32_t error)
 Send a window error event to the application node. More...
 
virtual EQ_API bool processEvent (const Event &event)
 Process an event. More...
 
EQ_API void setPixelViewport (const PixelViewport &pvp)
 Set the window's pixel viewport wrt its parent pipe. More...
 
EQ_API const PixelViewport & getPixelViewport () const
 
EQ_API uint32_t getColorFormat () const
 
EQ_API void setName (const std::string &name)
 Set the window's name. More...
 
EQ_API const std::string & getName () const
 
EQ_API int32_t getIAttribute (const WindowSettings::IAttribute attr) const
 
EQ_API const SystemWindowgetSharedContextWindow () const
 

Protected Member Functions

EQ_API WGLEWContext * wglewGetContext ()
 

Detailed Description

Equalizer default implementation of a WGL window.

Definition at line 66 of file wgl/window.h.

Constructor & Destructor Documentation

EQ_API eq::wgl::Window::Window ( NotifierInterface parent,
const WindowSettings settings,
Pipe pipe 
)

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

Version
1.7.2
virtual EQ_API eq::wgl::Window::~Window ( )
virtual

Destruct the WGL window.

Version
1.0

Member Function Documentation

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

Implements eq::SystemWindow.

virtual EQ_API 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 EQ_API 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 EQ_API 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 EQ_API 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 EQ_API 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 EQ_API 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 EQ_API void eq::wgl::Window::destroyWGLContext ( HGLRC  context)
virtual

Destroy the given WGL context.

Version
1.0
virtual EQ_API void eq::wgl::Window::doneCurrent ( ) const
virtual
Version
1.10

Reimplemented from eq::GLWindow.

virtual EQ_API void eq::wgl::Window::exitEventHandler ( )
virtual

Destroy the WGLEventHandler, called by setWGLWindowHandle().

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

Destroy the affinity device context.

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

Reimplemented from eq::wgl::WindowIF.

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

Implements eq::wgl::WindowIF.

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

Implements eq::wgl::WindowIF.

EQ_API const EventHandler* eq::wgl::Window::getWGLEventHandler ( ) const
Returns
the WGL event handler.
Version
1.0
virtual EQ_API HPBUFFERARB eq::wgl::Window::getWGLPBufferHandle ( ) const
virtual
Returns
the Win32 off screen PBuffer handle.
Version
1.0

Implements eq::wgl::WindowIF.

virtual EQ_API HWND eq::wgl::Window::getWGLWindowHandle ( ) const
virtual
Returns
the Win32 window handle.
Version
1.0

Implements eq::wgl::WindowIF.

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

Set up an WGLEventHandler, called by setWGLWindowHandle().

Version
1.0
virtual EQ_API 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 EQ_API 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 EQ_API void eq::wgl::Window::makeCurrent ( const bool  cache = true) const
virtual
Version
1.0

Reimplemented from eq::GLWindow.

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

Implements eq::wgl::WindowIF.

virtual EQ_API 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
virtual EQ_API 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 EQ_API 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 EQ_API void eq::wgl::Window::swapBuffers ( )
virtual
Version
1.0

Implements eq::SystemWindow.

EQ_API 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: