Documentation/Shader library - PixieWiki

# Documentation/Shader library

### From PixieWiki

< Documentation

Pixie comes with a library that allows you to query a compiled shader for its parameter. SDR lib exports the following two functions:

    TSdrShader *sdrGet(const char *);

    void sdrDelete(TSdrShader *);

The first function is used to get the shader info i.e.: `sdrGet("matte.sdr")`. The second function can be used to free the structure returned be `sdrGet`. The structure `TSdrShader` contains the shader and parameter information. See the source code for "sdrinfo" for example usage.

The structure `TSdrShader` is defined as:

    typedef struct TSdrParameter {
    	char          *name;         // Name of the parameter
    	ESdrType      type;          // Type of the parameter
    	ESdrContainer container;     // Container class of the parameter
    	int           numItems;      // Number of items (the number of items if an array, 1 otherwise)
    	char          *space;        // The space that the default value is expressed in
    	UDefaultVal   defaultValue;  // The default value
    	struct TSdrParameter *next;  // The next parameter
    } TSdrParameter;

Retrieved from "http://www.george-graphics.co.uk/pixiewiki/Documentation/Shader_library"

Category: Documentation

##### Views

- Article
- Discussion
- Edit
- History

##### Personal tools

- Log in / create account

##### Search

##### Toolbox

- What links here
- Related changes
- Upload file
- Special pages
- Printable version
- Permanent link