mi_shader_if.h File Reference

#include <mi_raylib.h>
#include <mi_lib.h>
#include <mi_shader.h>

Go to the source code of this file.


Namespaces

namespace   mi
namespace   mi::shader

Classes

struct   mi::shader::Framebuffer
  Framebuffer class. More...
class   mi::shader::Access_fb
  Smart pointer to access Framebuffer class, no editing. More...
class   mi::shader::Edit_fb
  Smart pointer to access Framebuffer class for editing. More...
struct   mi::shader::Interface
  Top level C++ mental ray interface extensions. More...
struct   mi::shader::Options
  Access to string options. More...
class   mi::shader::LightIterator
  Iterate over shader or instance light lists. More...
class   mi::shader::LightList
  Light lists, used internally by LightIterator. More...

Functions

mi::shader::Interface mi_get_shader_interface (int version=mi_ray_interface_version)
  Acquire an instance of the mental ray C++ shader interface extensions.

Detailed Description

mental ray C++ shader interface extensions.

This is a new C++ interface for shaders which extends the existing C-style shader interface to mental ray. It is implemented as abstract interface classes which do not require symbol lookups across DLL boundaries.

The indirection through abstract interface classes and virtual member functions is needed in order to avoid symbol lookups across dynamically loaded libraries (like for example shaders) by using virtual function tables. It also makes it possible to provide new, incompatible versions of the interface later.

mi_shader_if.h is included from shader.h if the shader is compiled as C++ code; a shader does not need to include mi_shader_if.h directly.


Function Documentation

mi::shader::Interface* mi_get_shader_interface int  version = mi_ray_interface_version  ) 
 

Acquire an instance of the mental ray C++ shader interface extensions.

Parameters:
version  is the version number of the requested interface class and should usually be left at the default value. The passed version argument is used to support multiple different interface versions and should usually be the value of the variable mi_ray_interface_version in the defining header file. A future version of mental ray may optionally return a pointer to a newer version of the interface of a different type or in a different namespace, identified by a different version number.
Returns:
The returned pointer points to an object in mental ray which contains the interface functions as virtual methods (hence it is possible to call the interface routines from a dynamically loaded library without resolving the routine in a symbol table). The caller may not attempt to modify or delete the returned object but should call the mi::shader::Interface::release() method when done.



Copyright © 1986-2007 by mental images GmbH