eq::AGLWindow Class Reference

Equalizer default implementation of an AGL window. More...

#include <aglWindow.h>

Inheritance diagram for eq::AGLWindow:
Inheritance graph
[legend]
Collaboration diagram for eq::AGLWindow:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Equalizer default implementation of an AGL window.

Definition at line 55 of file aglWindow.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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

Here is the call graph for this function:

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

Here is the caller graph for this function:

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.

Parameters:
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]
Returns:
the AGL rendering context.

Implements eq::AGLWindowIF.

Definition at line 71 of file aglWindow.h.

Referenced by configExit(), configInitAGLFullscreen(), configInitAGLPBuffer(), and configInitAGLWindow().

Here is the caller graph for this function:

virtual WindowRef eq::AGLWindow::getCarbonWindow (  )  const [inline, virtual]
Returns:
the carbon window reference.

Implements eq::AGLWindowIF.

Definition at line 74 of file aglWindow.h.

Referenced by configExit().

Here is the caller graph for this function:

virtual AGLPbuffer eq::AGLWindow::getAGLPBuffer (  )  const [inline, virtual]
Returns:
the AGL PBuffer object.

Implements eq::AGLWindowIF.

Definition at line 77 of file aglWindow.h.

Referenced by configExit().

Here is the caller graph for this function:

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.

Parameters:
context the AGL rendering context.

Definition at line 124 of file aglWindow.cpp.

Referenced by configExit(), and configInit().

Here is the caller graph for this function:

void eq::AGLWindow::setCarbonWindow ( WindowRef  window  )  [virtual]

Set the carbon window to be used with the current AGL context.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::AGLWindow::setAGLPBuffer ( AGLPbuffer  pbuffer  )  [virtual]

Set the AGL PBuffer object to be used with the current AGL context.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
true if the initialization was successful, false otherwise.

Implements eq::OSWindow.

Definition at line 133 of file aglWindow.cpp.

References chooseAGLPixelFormat(), configInitAGLDrawable(), createAGLContext(), destroyAGLPixelFormat(), eq::GLWindow::initGLEW(), makeCurrent(), and setAGLContext().

Here is the call graph for this function:

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.

Returns:
a pixel format, or 0 if no pixel format was found.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
pixelFormat a pixel format.

Definition at line 315 of file aglWindow.cpp.

References eq::Global::enterCarbon(), and eq::Global::leaveCarbon().

Referenced by configInit().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
pixelFormat the pixel format for the context.
Returns:
the context, or 0 if context creation failed.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
true if the drawable was created, false otherwise.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Returns:
true if the window was created, false otherwise.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Returns:
true if the window was created, false otherwise.

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::AGLWindow::configInitAGLPBuffer (  )  [virtual]

Initialize the window with an offscreen AGL PBuffer.

Sets the window's AGL PBuffer on success.

Returns:
true if the PBuffer was created, false otherwise.

Definition at line 397 of file aglWindow.cpp.

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

Referenced by configInitAGLDrawable().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::AGLWindow::initEventHandler (  )  [virtual]

Set up an AGLEventHandler, called by setCarbonWindow().

Definition at line 606 of file aglWindow.cpp.

Referenced by setCarbonWindow().

Here is the caller graph for this function:

void eq::AGLWindow::exitEventHandler (  )  [virtual]

Destroy the AGLEventHandler, called by setCarbonWindow().

Definition at line 612 of file aglWindow.cpp.

Referenced by setCarbonWindow().

Here is the caller graph for this function:

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.


The documentation for this class was generated from the following files:
Generated on Sat Feb 6 13:02:24 2010 for Equalizer 0.9.1 by  doxygen 1.6.1