Equalizer  1.13.0
Parallel Rendering Framework
eq::x11::Window Class Reference

A system window for CPU rendering on X11. More...

#include <window.h>

+ Inheritance diagram for eq::x11::Window:
+ Collaboration diagram for eq::x11::Window:

Public Member Functions

 Window (NotifierInterface &parent, const WindowSettings &settings, Display *xDisplay)
 
bool configInit () override
 Initialize this system window. More...
 
void configExit () override
 De-initialize this system window. More...
 
void makeCurrent (bool) const override
 Make the system window rendering context and drawable current. More...
 
void doneCurrent () const override
 This results in no context being current in the current thread. More...
 
void bindFrameBuffer () const override
 Bind the window's FBO, if it uses an FBO drawable. More...
 
void bindDrawFrameBuffer () const override
 Bind the window's draw FBO, used for multisampling. More...
 
void updateFrameBuffer () const override
 Update the window's FBO from the multisampled FBO. More...
 
void swapBuffers () override
 Swap the front and back buffer. More...
 
void joinNVSwapBarrier (const uint32_t, const uint32_t) override
 Join a NV_swap_group. More...
 
void queryDrawableConfig (eq::DrawableConfig &drawableConfig) override
 Set up the given drawable based on the current context. More...
 
void flush () override
 Flush all command buffers. More...
 
void finish () override
 Finish execution of all commands. More...
 
virtual Display * getXDisplay ()
 
virtual XID getXDrawable () const
 
- 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...
 
virtual const GLEWContext * glewGetContext () const
 Get the GLEW context for this window. 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
 
virtual const util::FrameBufferObjectgetFrameBufferObject () const
 
virtual util::FrameBufferObjectgetFrameBufferObject ()
 

Data Access

virtual void setXDrawable (XID drawable)
 Set the X11 drawable ID for this window. More...
 

Detailed Description

A system window for CPU rendering on X11.

Example usage:

/* Copyright (c) 2009-2015, Stefan.Eilemann@epfl.ch
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of Eyescale Software GmbH nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "window.h"
#include <eq/glx/pipe.h>
#include <eq/x11/window.h>
#include <eq/pipe.h>
namespace eqCpu
{
Window::Window( eq::Pipe* parent )
: eq::Window( parent )
{
}
bool Window::configInitSystemWindow( const eq::uint128_t& initID )
{
eq::Pipe* pipe = getPipe();
eq::glx::Pipe* glxPipe = dynamic_cast< eq::glx::Pipe* >(
pipe->getSystemPipe( ));
if( !glxPipe )
eq::x11::Window* systemWindow =
new eq::x11::Window( *this, getSettings(), glxPipe->getXDisplay( ));
if( !systemWindow->configInit( ))
{
delete systemWindow;
return false;
}
setSystemWindow( systemWindow );
return true;
}
}
Version
1.9

Definition at line 39 of file x11/window.h.

Member Function Documentation

void eq::x11::Window::bindDrawFrameBuffer ( ) const
inlineoverridevirtual

Bind the window's draw FBO, used for multisampling.

Version
1.9

Implements eq::SystemWindow.

Definition at line 50 of file x11/window.h.

void eq::x11::Window::bindFrameBuffer ( ) const
inlineoverridevirtual

Bind the window's FBO, if it uses an FBO drawable.

Version
1.0

Implements eq::SystemWindow.

Definition at line 49 of file x11/window.h.

void eq::x11::Window::configExit ( )
overridevirtual

De-initialize this system window.

This function might be called on partially or uninitialized system windows, and the implemenation has therefore be tolerant enough to handle this case.

Version
1.0

Implements eq::SystemWindow.

bool eq::x11::Window::configInit ( )
overridevirtual

Initialize this system window.

This method should take into account all attributes of the parent Window.

Returns
true if the window was correctly initialized, false on any error.
Version
1.0

Implements eq::SystemWindow.

void eq::x11::Window::doneCurrent ( ) const
inlineoverridevirtual

This results in no context being current in the current thread.

This function resets the pipe's make current cache.

Version
1.10

Implements eq::SystemWindow.

Definition at line 48 of file x11/window.h.

void eq::x11::Window::finish ( )
inlineoverridevirtual

Finish execution of all commands.

Version
1.5.2

Implements eq::SystemWindow.

Definition at line 56 of file x11/window.h.

References flush().

+ Here is the call graph for this function:

void eq::x11::Window::flush ( )
overridevirtual

Flush all command buffers.

Version
1.5.2

Implements eq::SystemWindow.

Referenced by finish().

+ Here is the caller graph for this function:

virtual Display* eq::x11::Window::getXDisplay ( )
virtual
Returns
the X11 display connection
virtual XID eq::x11::Window::getXDrawable ( ) const
inlinevirtual
Returns
the X11 drawable ID.

Definition at line 62 of file x11/window.h.

void eq::x11::Window::joinNVSwapBarrier ( const uint32_t  group,
const uint32_t  barrier 
)
inlineoverridevirtual

Join a NV_swap_group.

See WGL or GLX implementation and OpenGL extension for details on how to implement this function.

Parameters
groupthe swap group name.
barrierthe swap barrier name.
Version
1.0

Implements eq::SystemWindow.

Definition at line 53 of file x11/window.h.

void eq::x11::Window::makeCurrent ( bool  cache) const
inlineoverridevirtual

Make the system window rendering context and drawable current.

This function invalidates the pipe's make current cache.

Version
1.0

Implements eq::SystemWindow.

Definition at line 47 of file x11/window.h.

void eq::x11::Window::queryDrawableConfig ( eq::DrawableConfig &  dc)
overridevirtual

Set up the given drawable based on the current context.

Version
1.0

Implements eq::SystemWindow.

virtual void eq::x11::Window::setXDrawable ( XID  drawable)
inlinevirtual

Set the X11 drawable ID for this window.

This function should only be called from configInit() or configExit().

Parameters
drawablethe X11 drawable ID.

Definition at line 74 of file x11/window.h.

void eq::x11::Window::swapBuffers ( )
inlineoverridevirtual

Swap the front and back buffer.

Version
1.0

Implements eq::SystemWindow.

Definition at line 52 of file x11/window.h.

void eq::x11::Window::updateFrameBuffer ( ) const
inlineoverridevirtual

Update the window's FBO from the multisampled FBO.

Version
1.9

Implements eq::SystemWindow.

Definition at line 51 of file x11/window.h.


The documentation for this class was generated from the following file: