Equalizer
1.6.1
|
A Window represents an on-screen or off-screen drawable. More...
#include <window.h>
Public Types | |
typedef eq::ObjectManager | ObjectManager |
The per-window OpenGL object manager. More... | |
typedef BitmapFont | Font |
Fonts used for overlays. More... | |
Public Types inherited from eq::fabric::Window< Pipe, Window, Channel > | |
typedef std::vector< C * > | Channels |
A vector of pointers to channels. More... | |
typedef ElementVisitor< W, LeafVisitor< C > > | Visitor |
The Window visitor type. More... | |
enum | IAttribute |
Window attributes. More... | |
Public Types inherited from eq::fabric::Object | |
enum | DirtyBits { DIRTY_NAME = Serializable::DIRTY_CUSTOM << 0, DIRTY_USERDATA = Serializable::DIRTY_CUSTOM << 1, DIRTY_ERROR = Serializable::DIRTY_CUSTOM << 2, DIRTY_TASKS = Serializable::DIRTY_CUSTOM << 3, DIRTY_REMOVED = Serializable::DIRTY_CUSTOM << 4, DIRTY_SERIAL = Serializable::DIRTY_CUSTOM << 5, DIRTY_CUSTOM = Serializable::DIRTY_CUSTOM << 6, DIRTY_OBJECT_BITS = DIRTY_NAME | DIRTY_USERDATA | DIRTY_ERROR } |
The changed parts of the object since the last pack(). More... | |
Public Member Functions | |
Window (Pipe *parent) | |
Construct a new window. More... | |
virtual | ~Window () |
Destruct the window. More... | |
Data Access | |
co::CommandQueue * | getPipeThreadQueue () |
co::CommandQueue * | getCommandThreadQueue () |
uint32_t | getCurrentFrame () const |
const Node * | getNode () const |
Node * | getNode () |
const Config * | getConfig () const |
Config * | getConfig () |
ClientPtr | getClient () |
ServerPtr | getServer () |
bool | isRunning () const |
bool | isStopped () const |
bool | getRenderContext (const int32_t x, const int32_t y, RenderContext &context) const |
Get the last rendering context at the x, y position. More... | |
OpenGL context handling and sharing | |
void | setSharedContextWindow (Window *sharedContextWindow) |
Set the window with which this window shares the OpenGL context. More... | |
const Window * | getSharedContextWindow () const |
Window * | getSharedContextWindow () |
ObjectManager * | getObjectManager () |
const ObjectManager * | getObjectManager () const |
const Font * | getSmallFont () |
const Font * | getMediumFont () |
const GLEWContext * | glewGetContext () const |
Get the GLEW context for this window. More... | |
const GLEWContext * | getTransferGlewContext () |
uint32_t | getColorFormat () const |
SystemWindow interface | |
void | setSystemWindow (SystemWindow *window) |
Set the OS-specific window. More... | |
const SystemWindow * | getSystemWindow () const |
SystemWindow * | getSystemWindow () |
const SystemPipe * | getSystemPipe () const |
SystemPipe * | getSystemPipe () |
bool | createTransferWindow () |
void | deleteTransferSystemWindow () |
Public Member Functions inherited from eq::fabric::Window< Pipe, Window, Channel > | |
EQFABRIC_INL WindowPath | getPath () const |
void | init () |
const P * | getPipe () const |
P * | getPipe () |
const Channels & | getChannels () const |
const DrawableConfig & | getDrawableConfig () const |
const PixelViewport & | getPixelViewport () const |
const Viewport & | getViewport () const |
virtual EQFABRIC_INL void | setPixelViewport (const PixelViewport &pvp) |
Set the window's pixel viewport wrt its parent pipe. More... | |
EQFABRIC_INL void | setViewport (const Viewport &vp) |
Set the window's viewport wrt its parent pipe. More... | |
bool | hasFixedViewport () const |
EQFABRIC_INL VisitorResult | accept (Visitor &visitor) |
Perform a depth-first traversal of this window. More... | |
EQFABRIC_INL VisitorResult | accept (Visitor &visitor) const |
Const-version of accept(). More... | |
virtual EQFABRIC_INL void | backup () |
virtual EQFABRIC_INL void | restore () |
void | create (C **channel) |
void | release (C *channel) |
virtual void | output (std::ostream &) const |
virtual EQFABRIC_INL uint128_t | commit (const uint32_t incarnation=CO_COMMIT_NEXT) |
void | setIAttribute (const IAttribute attr, const int32_t value) |
Set a window attribute. More... | |
int32_t | getIAttribute (const IAttribute attr) const |
Public Member Functions inherited from eq::fabric::Object | |
virtual bool | isDirty () const |
void | setName (const std::string &name) |
Set the name of the object. More... | |
const std::string & | getName () const |
void | setUserData (co::Object *userData) |
Set user-specific data. More... | |
co::Object * | getUserData () |
const co::Object * | getUserData () const |
void | setError (const int32_t error) |
Set an error code why the last operation failed. More... | |
eq::fabric::Error | getError () const |
uint32_t | getTasks () const |
Return the set of tasks this channel might execute in the worst case. More... | |
uint32_t | getSerial () const |
Protected Member Functions | |
virtual void | attach (const UUID &id, const uint32_t instanceID) |
Protected Member Functions inherited from eq::fabric::Window< Pipe, Window, Channel > | |
Window (P *parent) | |
virtual EQFABRIC_INL void | serialize (co::DataOStream &os, const uint64_t dirtyBits) |
virtual EQFABRIC_INL void | deserialize (co::DataIStream &is, const uint64_t dirtyBits) |
virtual EQFABRIC_INL void | notifyDetach () |
virtual EQFABRIC_INL void | setDirty (const uint64_t bits) |
void | _setDrawableConfig (const DrawableConfig &drawableConfig) |
virtual ChangeType | getChangeType () const |
C * | _findChannel (const UUID &id) |
virtual uint64_t | getRedistributableBits () const |
Protected Member Functions inherited from eq::fabric::Object | |
Object () | |
Construct a new Object. More... | |
virtual | ~Object () |
Destruct the object. More... | |
virtual bool | hasMasterUserData () |
virtual uint32_t | getUserDataLatency () const |
void | setTasks (const uint32_t tasks) |
void | postRemove (Object *child) |
virtual void | removeChild (const UUID &) |
template<class C , class S > | |
void | commitChild (C *child, S *sender, uint32_t cmd, const uint32_t incarnation) |
template<class C > | |
void | commitChild (C *child, const uint32_t incarnation) |
template<class C , class S > | |
void | commitChildren (const std::vector< C * > &children, S *sender, uint32_t cmd, const uint32_t incarnation) |
template<class C > | |
void | commitChildren (const std::vector< C * > &children, uint32_t cmd, const uint32_t incarnation) |
template<class C > | |
void | commitChildren (const std::vector< C * > &children, const uint32_t incarnation) |
template<class C > | |
void | syncChildren (const std::vector< C * > &children) |
template<class P , class C > | |
void | releaseChildren (const std::vector< C * > &children) |
bool | _cmdSync (co::ICommand &command) |
Friends | |
class | Pipe |
class | Channel |
Actions | |
virtual void | flush () const |
Flush outstanding rendering requests. More... | |
virtual void | finish () const |
Finish outstanding rendering requests. More... | |
virtual void | swapBuffers () |
Swap the front and back buffer of the window. More... | |
virtual void | drawFPS () |
Render the current framerate as on overlay. More... | |
float | getFPS () const |
virtual void | makeCurrent (const bool cache=true) const |
Make the window's drawable and context current. More... | |
void | makeCurrentTransfer (const bool cache=true) const |
virtual void | bindFrameBuffer () const |
virtual void | notifyViewportChanged () |
void | startFrame (const uint32_t frameNumber) |
Start a frame by unlocking all child resources. More... | |
void | releaseFrame (const uint32_t frameNumber) |
Signal the completion of a frame to the parent. More... | |
void | releaseFrameLocal (const uint32_t frameNumber) |
Signal the release of the local synchronization to the parent. More... | |
Callbacks | |
The callbacks are called by Equalizer during rendering to execute various actions. | |
virtual bool | processEvent (const Event &event) |
Process a received event. More... | |
virtual bool | configInit (const uint128_t &initID) |
Initialize this window. More... | |
virtual bool | configInitSystemWindow (const uint128_t &initID) |
Initialize the OS-specific window. More... | |
virtual bool | configInitGL (const uint128_t &initID) |
Initialize the OpenGL state for this window. More... | |
virtual bool | configExit () |
Exit this window. More... | |
virtual bool | configExitSystemWindow () |
De-initialize the OS-specific window. More... | |
virtual bool | configExitGL () |
De-initialize the OpenGL state for this window. More... | |
virtual void | frameStart (const uint128_t &frameID, const uint32_t frameNumber) |
Start rendering a frame. More... | |
virtual void | frameFinish (const uint128_t &frameID, const uint32_t frameNumber) |
Finish rendering a frame. More... | |
virtual void | frameDrawFinish (const uint128_t &frameID, const uint32_t frameNumber) |
Finish drawing. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from eq::fabric::Window< Pipe, Window, Channel > | |
static EQFABRIC_INL const std::string & | getIAttributeString (const IAttribute attr) |
Protected Types inherited from eq::fabric::Window< Pipe, Window, Channel > | |
enum | DirtyBits |
A Window represents an on-screen or off-screen drawable.
A drawable is a 2D rendering surface, typically attached to an OpenGL context. A window uses an SystemWindow implementation to manage the operating system specific handling of window and context creation.
A Window is a child of a Pipe. The task methods for all windows of a pipe are executed in the same pipe thread. All window and subsequent channel task methods are executed in the order the windows are defined on the pipe, with the exception of the swap and finish tasks, which are executed after all windows have been updated. This ensures that all windows of a given pipe swap at the same time.
The default window initialization methods initialize all windows of the same pipe with a shared context, so that OpenGL objects can be reused between them for optimal GPU memory usage. The window facilitates OpenGL object management by providing an ObjectManager for allocating and sharing OpenGL objects.
Please note that each window potentially has its own OpenGL command buffer, thus glFlush is needed to synchronize the state of OpenGL objects between windows. Therefore, Equalizer calls flush() at the end of each frame for each window.
Definition at line 63 of file include/eq/client/window.h.
typedef BitmapFont eq::Window::Font |
The per-window OpenGL object manager.
Definition at line 67 of file include/eq/client/window.h.
eq::Window::Window | ( | Pipe * | parent | ) |
Construct a new window.
|
virtual |
Destruct the window.
Reimplemented from eq::fabric::Window< Pipe, Window, Channel >.
Reimplemented in eqPly::Window, and eVolve::Window.
|
protectedvirtual |
Exit this window.
|
inlineprotectedvirtual |
De-initialize the OpenGL state for this window.
Reimplemented in eqPly::Window.
Definition at line 382 of file include/eq/client/window.h.
Referenced by eqPly::Window::configExitGL().
|
protectedvirtual |
De-initialize the OS-specific window.
Referenced by eqPly::Window::configInitSystemWindow().
|
protectedvirtual |
Initialize this window.
initID | the init identifier. |
Reimplemented in eVolve::Window, and eqPixelBench::Window.
Referenced by eqPixelBench::Window::configInit(), and eVolve::Window::configInit().
|
protectedvirtual |
Initialize the OpenGL state for this window.
initID | the init identifier. |
true
if the initialization was successful, false
if not. Reimplemented in eqAsync::Window, eqPly::Window, and eVolve::Window.
Referenced by eqAsync::Window::configInitGL(), and eqPly::Window::configInitGL().
|
protectedvirtual |
Initialize the OS-specific window.
Reimplemented in eqPly::Window.
Referenced by eqPly::Window::configInitSystemWindow().
|
virtual |
Render the current framerate as on overlay.
|
virtual |
Finish outstanding rendering requests.
Called before a software swap barrier to ensure that the window will swap directly after the barrier is left.
|
virtual |
Flush outstanding rendering requests.
Called at the end of each frame from frameFinish() to ensure timely execution of pending rendering requests.
|
protectedvirtual |
Finish drawing.
Called once per frame after the last draw operation. Typically releases the local node thread synchronization for this frame.
frameID | the per-frame identifier. |
frameNumber | the frame to finished with draw. |
|
protectedvirtual |
Finish rendering a frame.
Called once at the end of each frame, to do per-frame updates of window-specific data. This method has to call releaseFrame(). The default implementation also flushes all rendering commands. This light-weight call ensures that all outstanding rendering commands for the window's context are being executed in a timely fashion.
frameID | the per-frame identifier. |
frameNumber | the frame to finish. |
|
protectedvirtual |
Start rendering a frame.
Called once at the beginning of each frame, to do per-frame updates of window-specific data. This method has to call startFrame().
frameID | the per-frame identifier. |
frameNumber | the frame to start. |
Reimplemented in eqPly::Window.
Referenced by eqPly::Window::frameStart().
const Config* eq::Window::getConfig | ( | ) | const |
Referenced by eqPly::Window::configInitGL().
|
inline |
Definition at line 231 of file include/eq/client/window.h.
const Font* eq::Window::getMediumFont | ( | ) |
|
inline |
Definition at line 154 of file include/eq/client/window.h.
Referenced by eqPly::Window::configInitGL().
|
inline |
Definition at line 157 of file include/eq/client/window.h.
bool eq::Window::getRenderContext | ( | const int32_t | x, |
const int32_t | y, | ||
RenderContext & | context | ||
) | const |
Get the last rendering context at the x, y position.
If no render context is found on the given position, false is returned and context is not modified.
|
inline |
Definition at line 144 of file include/eq/client/window.h.
|
inline |
Definition at line 151 of file include/eq/client/window.h.
const Font* eq::Window::getSmallFont | ( | ) |
const SystemPipe* eq::Window::getSystemPipe | ( | ) | const |
SystemPipe* eq::Window::getSystemPipe | ( | ) |
|
inline |
Definition at line 270 of file include/eq/client/window.h.
|
inline |
Definition at line 273 of file include/eq/client/window.h.
const GLEWContext* eq::Window::glewGetContext | ( | ) | const |
Get the GLEW context for this window.
The glew context is provided and initialized by the SystemWindow, and provides access to OpenGL extensions. This function does not follow the Equalizer naming conventions, since GLEW uses a function of this name to automatically resolve OpenGL function entry points. Therefore, any OpenGL function support by the driver can be directly called from any method of an initialized window.
Referenced by eVolve::Window::configInitGL().
|
inline |
Definition at line 106 of file include/eq/client/window.h.
|
inline |
Definition at line 112 of file include/eq/client/window.h.
|
virtual |
Make the window's drawable and context current.
GL drivers tend to behave sub-optimally if too many makeCurrent calls happen in a multi-threaded program. When caching is enabled, this method will only call SystemWindow::makeCurrent if it has not been done before for this window on this thread.
|
virtual |
Process a received event.
The task of this method is to update the window as necessary, and transform the event into an config event to be send to the application using Config::sendEvent().
event | the received window system event. |
|
protected |
Signal the completion of a frame to the parent.
frameNumber | the frame to end. |
|
protected |
Signal the release of the local synchronization to the parent.
frameNumber | the frame to release. |
|
inline |
Set the window with which this window shares the OpenGL context.
By default it is set to the first window of the pipe in the window's constructor. The shared context window is used during initialization to setup the OpenGL context and util::ObjectManager.
Definition at line 137 of file include/eq/client/window.h.
void eq::Window::setSystemWindow | ( | SystemWindow * | window | ) |
Set the OS-specific window.
The SystemWindow implements the window-system-dependent part, e.g., the drawable creation. This window forwards certain calls, e.g., swapBuffers(), to the SystemWindow. The os-specific window has to be initialized.
|
protected |
Start a frame by unlocking all child resources.
frameNumber | the frame to start. |
|
virtual |
Swap the front and back buffer of the window.
Reimplemented in eVolve::Window.
Referenced by eVolve::Window::swapBuffers().