Equalizer default implementation of an AGL window. More...
#include <aglWindow.h>


Public Member Functions | |
| AGLWindow (Window *parent) | |
| Create a new AGL window for the given eq::Window. | |
| virtual | ~AGLWindow () |
| Destruct the AGL window. | |
| 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 AGLContext | getAGLContext () const |
| virtual WindowRef | getCarbonWindow () const |
| virtual AGLPbuffer | getAGLPBuffer () const |
| virtual bool | processEvent (const AGLWindowEvent &event) |
| Process an event. | |
Data Access | |
| virtual void | setAGLContext (AGLContext context) |
| Set the AGL rendering context for this window. | |
| virtual void | setCarbonWindow (WindowRef window) |
| Set the carbon window to be used with the current AGL context. | |
| virtual void | setAGLPBuffer (AGLPbuffer pbuffer) |
| Set the AGL PBuffer object to be used with the current AGL context. | |
AGL/Carbon initialization | |
| virtual bool | configInit () |
| Initialize this window for the AGL window system. | |
| virtual AGLPixelFormat | chooseAGLPixelFormat () |
| Choose a pixel format based on the window's attributes. | |
| virtual void | destroyAGLPixelFormat (AGLPixelFormat pixelFormat) |
| Destroy a pixel format obtained with chooseAGLPixelFormat(). | |
| virtual AGLContext | createAGLContext (AGLPixelFormat pixelFormat) |
| Create an AGL context. | |
| virtual bool | configInitAGLDrawable () |
| Initialize the window's drawable (fullscreen, pbuffer or window) and bind the AGL context. | |
| virtual bool | configInitAGLFullscreen () |
| Initialize the window with a fullscreen Carbon window. | |
| virtual bool | configInitAGLWindow () |
| Initialize the window with a normal Carbon window. | |
| virtual bool | configInitAGLPBuffer () |
| Initialize the window with an offscreen AGL PBuffer. | |
| virtual void | initEventHandler () |
| Set up an AGLEventHandler, called by setCarbonWindow(). | |
| virtual void | exitEventHandler () |
| Destroy the AGLEventHandler, called by setCarbonWindow(). | |
Equalizer default implementation of an AGL window.
Definition at line 55 of file aglWindow.h.
| eq::AGLWindow::AGLWindow | ( | Window * | parent | ) |
Create a new AGL window for the given eq::Window.
Definition at line 40 of file aglWindow.cpp.
| eq::AGLWindow::~AGLWindow | ( | ) | [virtual] |
Destruct the AGL window.
Definition at line 49 of file aglWindow.cpp.
| void eq::AGLWindow::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 53 of file aglWindow.cpp.
References eq::GLWindow::configExitFBO(), eq::Global::enterCarbon(), EQINFO, eq::GLWindow::exitGLEW(), getAGLContext(), getAGLPBuffer(), getCarbonWindow(), eq::Window::IATTR_HINT_FULLSCREEN, eq::Global::leaveCarbon(), eq::ON, setAGLContext(), setAGLPBuffer(), and setCarbonWindow().

| void eq::AGLWindow::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 95 of file aglWindow.cpp.
Referenced by configInit().

| void eq::AGLWindow::swapBuffers | ( | ) | [virtual] |
Swap the front and back buffer, for doublebuffered drawables.
Implements eq::OSWindow.
Definition at line 106 of file aglWindow.cpp.
| void eq::AGLWindow::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 111 of file aglWindow.cpp.
References EQWARN.
| virtual AGLContext eq::AGLWindow::getAGLContext | ( | ) | const [inline, virtual] |
Implements eq::AGLWindowIF.
Definition at line 71 of file aglWindow.h.
Referenced by configExit(), configInitAGLFullscreen(), configInitAGLPBuffer(), and configInitAGLWindow().

| virtual WindowRef eq::AGLWindow::getCarbonWindow | ( | ) | const [inline, virtual] |
Implements eq::AGLWindowIF.
Definition at line 74 of file aglWindow.h.
Referenced by configExit().

| virtual AGLPbuffer eq::AGLWindow::getAGLPBuffer | ( | ) | const [inline, virtual] |
Implements eq::AGLWindowIF.
Definition at line 77 of file aglWindow.h.
Referenced by configExit().

| void eq::AGLWindow::setAGLContext | ( | AGLContext | context | ) | [virtual] |
Set the AGL 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 AGL rendering context. |
Definition at line 124 of file aglWindow.cpp.
Referenced by configExit(), and configInit().

| void eq::AGLWindow::setCarbonWindow | ( | WindowRef | window | ) | [virtual] |
Set the carbon window to be used with the current AGL context.
| window | the window reference. |
Definition at line 548 of file aglWindow.cpp.
References eq::OSWindow::_window, eq::Global::enterCarbon(), EQINFO, exitEventHandler(), eq::Window::IATTR_HINT_DECORATION, initEventHandler(), eq::Global::leaveCarbon(), eq::OFF, and eq::Window::setPixelViewport().
Referenced by configExit(), and configInitAGLWindow().


| void eq::AGLWindow::setAGLPBuffer | ( | AGLPbuffer | pbuffer | ) | [virtual] |
Set the AGL PBuffer object to be used with the current AGL context.
| pbuffer | the PBuffer. |
Definition at line 579 of file aglWindow.cpp.
References eq::OSWindow::_window, EQINFO, and eq::Window::setPixelViewport().
Referenced by configExit(), and configInitAGLPBuffer().


| bool eq::AGLWindow::configInit | ( | ) | [virtual] |
Initialize this window for the AGL window system.
This method first call chooseAGLPixelFormat(), then createAGLContext() with the chosen pixel format, destroys the pixel format using destroyAGLPixelFormat() and finally creates a drawable using configInitAGLDrawable().
Implements eq::OSWindow.
Definition at line 133 of file aglWindow.cpp.
References chooseAGLPixelFormat(), configInitAGLDrawable(), createAGLContext(), destroyAGLPixelFormat(), eq::GLWindow::initGLEW(), makeCurrent(), and setAGLContext().

| AGLPixelFormat eq::AGLWindow::chooseAGLPixelFormat | ( | ) | [virtual] |
Choose a pixel format based on the window's attributes.
The returned pixel format has to be destroyed using destroyAGLPixelFormat() to avoid memory leaks.
This method uses Global::enterCarbon() and Global::leaveCarbon() to protect the calls to AGL/Carbon.
Definition at line 151 of file aglWindow.cpp.
References eq::OSWindow::_window, eq::AUTO, eq::Global::enterCarbon(), eq::AGLPipe::getCGDisplayID(), eq::Window::IATTR_HINT_DOUBLEBUFFER, eq::Window::IATTR_HINT_DRAWABLE, eq::Window::IATTR_HINT_FULLSCREEN, 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::Global::leaveCarbon(), eq::ON, eq::Window::setErrorMessage(), and eq::WINDOW.
Referenced by configInit().


| void eq::AGLWindow::destroyAGLPixelFormat | ( | AGLPixelFormat | pixelFormat | ) | [virtual] |
Destroy a pixel format obtained with chooseAGLPixelFormat().
This method uses Global::enterCarbon() and Global::leaveCarbon() to protect the calls to AGL/Carbon.
| pixelFormat | a pixel format. |
Definition at line 315 of file aglWindow.cpp.
References eq::Global::enterCarbon(), and eq::Global::leaveCarbon().
Referenced by configInit().


| AGLContext eq::AGLWindow::createAGLContext | ( | AGLPixelFormat | pixelFormat | ) | [virtual] |
Create an AGL context.
This method does not set the window's AGL context.
This method uses Global::enterCarbon() and Global::leaveCarbon() to protect the calls to AGL/Carbon.
| pixelFormat | the pixel format for the context. |
Definition at line 325 of file aglWindow.cpp.
References eq::OSWindow::_window, eq::AUTO, eq::Global::enterCarbon(), EQINFO, eq::AGLWindowIF::getAGLContext(), eq::Window::getOSWindow(), eq::Window::getSharedContextWindow(), eq::Window::IATTR_HINT_SWAPSYNC, eq::Global::leaveCarbon(), eq::OFF, and eq::Window::setErrorMessage().
Referenced by configInit().


| bool eq::AGLWindow::configInitAGLDrawable | ( | ) | [virtual] |
Initialize the window's drawable (fullscreen, pbuffer or window) and bind the AGL context.
Sets the window's carbon window on success. Calls configInitAGLFullscreen() or configInitAGLWindow().
Definition at line 373 of file aglWindow.cpp.
References configInitAGLFullscreen(), configInitAGLPBuffer(), configInitAGLWindow(), eq::GLWindow::configInitFBO(), EQWARN, eq::FBO, eq::Window::IATTR_HINT_DRAWABLE, eq::Window::IATTR_HINT_FULLSCREEN, eq::ON, eq::PBUFFER, eq::UNDEFINED, and eq::WINDOW.
Referenced by configInit().


| bool eq::AGLWindow::configInitAGLFullscreen | ( | ) | [virtual] |
Initialize the window with a fullscreen Carbon window.
Sets the window's carbon window on success.
This method uses Global::enterCarbon() and Global::leaveCarbon() to protect the calls to AGL/Carbon.
Definition at line 429 of file aglWindow.cpp.
References eq::OSWindow::_window, eq::Global::enterCarbon(), EQWARN, getAGLContext(), eq::Window::getPixelViewport(), eq::Pipe::getPixelViewport(), eq::PixelViewport::isValid(), eq::Global::leaveCarbon(), eq::Window::setErrorMessage(), and eq::Window::setPixelViewport().
Referenced by configInitAGLDrawable().


| bool eq::AGLWindow::configInitAGLWindow | ( | ) | [virtual] |
Initialize the window with a normal Carbon window.
Sets the window's carbon window on success.
This method uses Global::enterCarbon() and Global::leaveCarbon() to protect the calls to AGL/Carbon.
Definition at line 463 of file aglWindow.cpp.
References eq::OSWindow::_window, eq::Global::enterCarbon(), getAGLContext(), eq::Window::getName(), eq::Window::getPixelViewport(), eq::Window::IATTR_HINT_DECORATION, eq::Global::leaveCarbon(), eq::OFF, setCarbonWindow(), and eq::Window::setErrorMessage().
Referenced by configInitAGLDrawable().


| bool eq::AGLWindow::configInitAGLPBuffer | ( | ) | [virtual] |
Initialize the window with an offscreen AGL PBuffer.
Sets the window's AGL PBuffer on success.
Definition at line 397 of file aglWindow.cpp.
References eq::OSWindow::_window, getAGLContext(), eq::Window::getPixelViewport(), setAGLPBuffer(), and eq::Window::setErrorMessage().
Referenced by configInitAGLDrawable().


| void eq::AGLWindow::initEventHandler | ( | ) | [virtual] |
Set up an AGLEventHandler, called by setCarbonWindow().
Definition at line 606 of file aglWindow.cpp.
Referenced by setCarbonWindow().

| void eq::AGLWindow::exitEventHandler | ( | ) | [virtual] |
Destroy the AGLEventHandler, called by setCarbonWindow().
Definition at line 612 of file aglWindow.cpp.
Referenced by setCarbonWindow().

| bool eq::AGLWindow::processEvent | ( | const AGLWindowEvent & | event | ) | [virtual] |
Process an event.
Reimplemented from eq::AGLWindowIF.
Definition at line 116 of file aglWindow.cpp.
References eq::Event::type, and eq::Event::WINDOW_RESIZE.
0.9.1 by
1.6.1