Abstract interface for a canvas that represents an OpenGL buffer. More...
#include <icanvas_opengl.h>
Public Member Functions | |
virtual Sint32 | bind_opengl_context () const =0 |
Binds the OpenGL context to be used by the render mode to the calling thread. More... | |
virtual Sint32 | release_opengl_context () const =0 |
Releases the OpenGL context to be used by the render mode from the calling thread. More... | |
virtual Uint32 | get_texture_id () const =0 |
Returns the texture ID to be used by the render mode. More... | |
![]() | |
virtual Uint32 | get_resolution_x () const =0 |
Returns the resolution of the canvas in x direction. More... | |
virtual Uint32 | get_resolution_y () const =0 |
Returns the resolution of the canvas in y direction. More... | |
virtual const char * | get_type () const =0 |
Returns the pixel type used by the canvas. More... | |
virtual Uint32 | get_layers_size () const =0 |
Returns the number of layers this canvas has. More... | |
virtual Float32 | get_gamma () const =0 |
Returns the gamma value. More... | |
virtual void | set_gamma (Float32 gamma)=0 |
Sets the gamma value. More... | |
![]() | |
virtual Uint32 | retain () const =0 |
Increments the reference count. More... | |
virtual Uint32 | release () const =0 |
Decrements the reference count. More... | |
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
Acquires a const interface from another. More... | |
template<class T> | |
const T * | get_interface () const |
Acquires a const interface from another. More... | |
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
Acquires a mutable interface from another. More... | |
template<class T> | |
T * | get_interface () |
Acquires a mutable interface from another. More... | |
virtual Uuid | get_iid () const =0 |
Returns the interface ID of the most derived interface. More... | |
Additional Inherited Members | |
![]() | |
using | Self = Interface_declare< id1, ... > |
Own type. More... | |
using | IID = Uuid_t< id1, ... > |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
using | Self = Interface_declare< id1, ... > |
Own type. More... | |
using | IID = Uuid_t< id1, ... > |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
using | IID = Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface. More... | |
Abstract interface for a canvas that represents an OpenGL buffer.
The three methods below provide the interface for the render mode to directly interact with OpenGL resources to store the result of the rendering operation. Using this interface instead of mi::neuraylib::ICanvas allows the result of the rendering operation to remain on the GPU instead of transferring it back to main memory. From there it can be processed further, or can be simply displayed.
Note that, due to the way textures are stored in hardware, only pixel formats with 1, 2, or 4 components are supported. Also note that using full functionality will require that the OpenGL context used for this canvas is associated with a valid CUDA device.
|
pure virtual |
Binds the OpenGL context to be used by the render mode to the calling thread.
wglMakeCurrent()
. On Linux, glXMakeCurrent()
is typically used.
|
pure virtual |
Returns the texture ID to be used by the render mode.
The result of the rendering operation is written to the OpenGL buffer identified by this texture ID. The resolution and pixel type of the texture resource has to match the results of get_resolution_x(), get_resolution_y(), and get_type().
|
pure virtual |
Releases the OpenGL context to be used by the render mode from the calling thread.
wglMakeCurrent()
. On Linux, glXMakeCurrent()
is typically used.