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)
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 ()
virtual void exitEventHandler ()


Detailed Description

Equalizer default implementation of an AGL window.

Definition at line 52 of file aglWindow.h.


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 has therefore be tolerant enough to handle this.

Implements eq::OSWindow.

Definition at line 53 of file aglWindow.cpp.

References eq::OSWindow::configExitFBO(), eq::Global::enterCarbon(), EQINFO, eq::OSWindow::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::OSWindow.

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 102 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 107 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 65 of file aglWindow.h.

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

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 68 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 71 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 120 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 545 of file aglWindow.cpp.

References eq::OSWindow::_window, eq::Global::enterCarbon(), EQINFO, eq::Window::IATTR_HINT_DECORATION, eq::Global::leaveCarbon(), eq::OFF, eq::Window::setPixelViewport(), and eq::PixelViewport::y.

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 576 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 129 of file aglWindow.cpp.

References chooseAGLPixelFormat(), configInitAGLDrawable(), createAGLContext(), destroyAGLPixelFormat(), eq::OSWindow::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 147 of file aglWindow.cpp.

References eq::OSWindow::_window, eq::AUTO, eq::Global::enterCarbon(), eq::AGLPipe::getCGDisplayID(), eq::Pipe::getOSPipe(), 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 311 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 321 of file aglWindow.cpp.

References eq::OSWindow::_window, eq::AUTO, eq::Global::enterCarbon(), EQINFO, 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 370 of file aglWindow.cpp.

References configInitAGLFullscreen(), configInitAGLPBuffer(), configInitAGLWindow(), eq::OSWindow::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 426 of file aglWindow.cpp.

References eq::OSWindow::_window, eq::Global::enterCarbon(), EQWARN, getAGLContext(), eq::Window::getPixelViewport(), eq::Pipe::getPixelViewport(), eq::PixelViewport::h, eq::PixelViewport::isValid(), eq::Global::leaveCarbon(), eq::Window::setErrorMessage(), eq::Window::setPixelViewport(), and eq::PixelViewport::w.

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 460 of file aglWindow.cpp.

References eq::OSWindow::_window, eq::Global::enterCarbon(), getAGLContext(), eq::Window::getName(), eq::Window::getPixelViewport(), eq::PixelViewport::h, eq::Window::IATTR_HINT_DECORATION, eq::Global::leaveCarbon(), eq::OFF, setCarbonWindow(), eq::Window::setErrorMessage(), eq::PixelViewport::w, eq::PixelViewport::x, and eq::PixelViewport::y.

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 394 of file aglWindow.cpp.

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

Referenced by configInitAGLDrawable().

Here is the call graph for this function:

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 112 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 Mon Aug 10 18:58:42 2009 for Equalizer 0.9 by  doxygen 1.5.8