RixInterfaces

RixInterfaces are RenderMan interface extensions.

An RixInterface is simply a C++ class that provides a collection of related methods. For example, the RixMessages class provides a standardized way to report errors and warnings with optional suppression of duplicate messages.

An interface is obtained by calling the GetRixInterface method of a context with an identifier from the RixInterfaceId enum. For example, in a shader plugin:

    RixMessages* msgs = (RixMessages*) rslCtx->GetRixInterface(k_RixMessages);
    msgs->Warning("Are you sure about this?");
The generic interface that is returned must be cast to the appropriate type before use.

From a procedural plugin, first call RxGetRixContext to obtain a context:

    RixContext* context = RxGetRixContext();
    RixMessages* msgs = (RixMessages*) context->GetRixInterface(k_RixMessages);
Not all interfaces are available from a given context. For example, the global RixContext does not permit access to per-thread data.

Interfaces should never be deleted. Most interfaces are thread safe and can be used indefinitely. For example, rather than fetching the RixMessages interface each time a warning is printed, a plugin can store the interface in a global variable and reuse it as needed. Some interfaces are transient, however: in particular, an RixStorage interface for per-thread or local data can be used only in the context from which it was obtained.

For more information, browse the documentation for these classes:


Generated on Wed May 10 11:00:40 2006 for PRManHeaders by  doxygen 1.4.6