Equalizer default implementation of a WGL window. More...
#include <wglWindow.h>


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 WGLEventHandler * | getWGLEventHandler () 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. | |
Equalizer default implementation of a WGL window.
Definition at line 59 of file wglWindow.h.
enum eq::WGLWindow::WGLDCType [protected] |
The type of the Win32 device context.
Definition at line 218 of file wglWindow.h.
| 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().


| 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().

| 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.
| group | the swap group name. | |
| barrier | the swap barrier name. |
Implements eq::OSWindow.
Definition at line 870 of file wglWindow.cpp.
| virtual HWND eq::WGLWindow::getWGLWindowHandle | ( | ) | const [inline, virtual] |
Implements eq::WGLWindowIF.
Definition at line 72 of file wglWindow.h.
Referenced by configExit().

| virtual HPBUFFERARB eq::WGLWindow::getWGLPBufferHandle | ( | ) | const [inline, virtual] |
Implements eq::WGLWindowIF.
Definition at line 75 of file wglWindow.h.
Referenced by configExit().

| virtual HDC eq::WGLWindow::getWGLDC | ( | ) | const [inline, virtual] |
Implements eq::WGLWindowIF.
Definition at line 78 of file wglWindow.h.
| virtual HGLRC eq::WGLWindow::getWGLContext | ( | ) | const [inline, virtual] |
Implements eq::WGLWindowIF.
Definition at line 81 of file wglWindow.h.
Referenced by configExit().

| const WGLEventHandler* eq::WGLWindow::getWGLEventHandler | ( | ) | const [inline] |
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().
| 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().


| 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().
| 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().


| 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.
| context | the WGL rendering context. |
Definition at line 118 of file wglWindow.cpp.
Referenced by configExit(), and configInit().

| 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().
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.

| bool eq::WGLWindow::initWGLAffinityDC | ( | ) | [virtual] |
Create, if needed, an affinity device context for this window.
Definition at line 515 of file wglWindow.cpp.
References eq::WGLPipe::createWGLAffinityDC().
Referenced by configInit().


| void eq::WGLWindow::exitWGLAffinityDC | ( | ) | [virtual] |
Destroy the affinity device context.
Definition at line 506 of file wglWindow.cpp.
Referenced by configExit(), and configInit().

| HDC eq::WGLWindow::getWGLAffinityDC | ( | ) | [virtual] |
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.
Definition at line 539 of file wglWindow.cpp.
References eq::WGLPipe::createWGLDisplayDC().
Referenced by configInitWGLPBuffer().


| 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.
Definition at line 551 of file wglWindow.cpp.
References eq::OSWindow::_window, and eq::Window::setErrorMessage().
Referenced by configInit().


| 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.
| pixelFormat | the window's target pixel format. |
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().


| bool eq::WGLWindow::configInitWGLWindow | ( | int | pixelFormat | ) | [virtual] |
Initialize the window with an on-screen Win32 window.
Sets the window handle on success.
| pixelFormat | the window's target pixel format. |
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().


| bool eq::WGLWindow::configInitWGLPBuffer | ( | int | pixelFormat | ) | [virtual] |
Initialize the window with an off-screen WGL PBuffer.
Sets the window handle on success.
| pixelFormat | the window's target pixel format. |
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().


| HGLRC eq::WGLWindow::createWGLContext | ( | ) | [virtual] |
Create a WGL context.
This method does not set the window's WGL context.
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().


| 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.
| 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().

| void eq::WGLWindow::leaveNVSwapBarrier | ( | ) | [protected] |
Unbind a WGL_NV_swap_barrier.
Definition at line 920 of file wglWindow.cpp.
Referenced by configExit().

0.9.1 by
1.6.1