Iray SDK API nvidia_logo_transpbg.gif Up
mi::neuraylib::ICanvas_opengl Class Referenceabstract

Abstract interface for a canvas that represents an OpenGL buffer. More...

#include <icanvas_opengl.h>

Inheritance diagram for mi::neuraylib::ICanvas_opengl:

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...
 
- Public Member Functions inherited from mi::neuraylib::ICanvas_base
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...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_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 IInterfaceget_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

- Public Types inherited from mi::base::Interface_declare< 0x44e76f87, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x649fc7bd, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x44e76f87, ... >
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 Public Member Functions inherited from mi::base::Interface_declare< 0x649fc7bd, ... >
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 Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

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.

Member Function Documentation

 bind_opengl_context()

virtual Sint32 mi::neuraylib::ICanvas_opengl::bind_opengl_context ( ) const
pure virtual

Binds the OpenGL context to be used by the render mode to the calling thread.

Note
The implementation of this method depends on the operating system and/or the libraries used to interact with OpenGL. On Windows, the implementation of this method usually calls wglMakeCurrent(). On Linux, glXMakeCurrent() is typically used.
See also
release_opengl_context()
Returns
0 in case of success, -1 in case of failure

 get_texture_id()

virtual Uint32 mi::neuraylib::ICanvas_opengl::get_texture_id ( ) const
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().

 release_opengl_context()

virtual Sint32 mi::neuraylib::ICanvas_opengl::release_opengl_context ( ) const
pure virtual

Releases the OpenGL context to be used by the render mode from the calling thread.

Note
The implementation of this method depends on the operating system and/or the libraries used to interact with OpenGL. On Windows, the implementation of this method usually calls wglMakeCurrent(). On Linux, glXMakeCurrent() is typically used.
See also
bind_opengl_context()
Returns
0 in case of success, -1 in case of failure