NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::ICanvas_opengl Class Referenceabstract

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

Inheritance diagram for mi::neuraylib::ICanvas_opengl:
Inheritance graph
[legend]

Public Member Functions

virtual Sint32  bind_opengl_context ()=0
  Binds the OpenGL context to be used by the render mode to the calling thread. More...
 
virtual Sint32  release_opengl_context ()=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...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x44e76f87, 0x36ba, 0x4f61, 0x90, 0x8d, 0x35, 0x9e, 0x15, 0x49, 0x70, 0x01, neuraylib::ICanvas_base >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
neuraylib::ICanvas_base
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x44e76f87, 0x36ba, 0x4f61, 0x90, 0x8d, 0x35, 0x9e, 0x15, 0x49, 0x70, 0x01, neuraylib::ICanvas_base >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. 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 transfering it back to main memory. From there it can be processed further, or can be simply displayed.

Member Function Documentation

virtual Sint32 mi::neuraylib::ICanvas_opengl::bind_opengl_context ( )
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
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().

virtual Sint32 mi::neuraylib::ICanvas_opengl::release_opengl_context ( )
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