ExternalOpenGLDisplay Class Reference

A specialized type of display able to render into an externally created OpenGL window. More...

Inheritance diagram for ExternalOpenGLDisplay:

Display

Public Member Functions

bool  initialize (Error &err=Error::Default())

Initialize the external OpenGL display.

bool  render (int width, int height, Error &err=Error::Default())

Updates the external OpenGL display with the newest image available.

bool  notifyWindowClosed (Error &err=Error::Default())

Notifies the display component that the window was closed.

- Public Member Functions inherited from Display
bool  displayBuffer (const std::shared_ptr< ic4::ImageBuffer > &buffer, Error &err=Error::Default())

Displays a specific image buffer.

bool  setRenderPosition (DisplayRenderPosition pos, int left=-1, int top=-1, int width=-1, int height=-1, Error &err=Error::Default())

Configure the image scaling and alignment options for a display.

DisplayStatistics  statistics (Error &err=Error::Default())

Queries display statistics.

NotificationToken  eventAddWindowClosed (WindowClosedHandler cb, Error &err=Error::Default())

Registers a new window-closed event handler.

bool  eventRemoveWindowClosed (NotificationToken token, Error &err=Error::Default())

Unregisters a window-closed event handler.

Static Public Member Functions

static std::shared_ptr< ExternalOpenGLDisplay >  create (Error &err=Error::Default())

Creates a new external OpenGL display.

- Static Public Member Functions inherited from Display
static std::shared_ptr< Display >  create (DisplayType type, WindowHandle hParent, Error &err=Error::Default())

Creates a new display.

Additional Inherited Members

- Public Types inherited from Display
using  WindowClosedHandler = std::function< void(Display &display)>

Function prototype for window-closed event handlers.

using  NotificationToken = void *

Represents a registered callback.

Detailed Description

A specialized type of display able to render into an externally created OpenGL window.

Member Function Documentation

◆ create()

static std::shared_ptr< ExternalOpenGLDisplay > create ( Error &  err = Error::Default())
inlinestatic

Creates a new external OpenGL display.

Parameters
errReference to an error handler. See Error Handling for details.
Returns
The new display, or nullptr if an error occurs.

◆ initialize()

bool initialize ( Error &  err = Error::Default())
inline

Initialize the external OpenGL display.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
true on success, otherwise false.
Remarks
This function must be called with the OpenGL context activated for the executing thread (e.g. makeCurrent).

◆ notifyWindowClosed()

bool notifyWindowClosed ( Error &  err = Error::Default())
inline

Notifies the display component that the window was closed.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
true on success, otherwise false.

◆ render()

bool render ( int  width,
int  height,
Error &  err = Error::Default() 
)
inline

Updates the external OpenGL display with the newest image available.

Parameters
[in]widthWidth of the display window in physical pixels
[in]heightHeight of the display window in physical pixels
[out]errReference to an error handler. See Error Handling for details.
Returns
true on success, otherwise false.
Remarks
This function must be called with the OpenGL context activated for the executing thread (e.g. makeCurrent).