SilverScreen Solid Modeler

get_texture_path

get_texture_path

Previous topic Next topic  

get_texture_path

Previous topic Next topic JavaScript is required for the print function  

 

SilverScreenAPI

 

int get_texture_path ( int td_flags, char *texture_path )

 

int  td_flags;        // A TEXTURE_DATA 'Flags' value

char *texture_path;   // A pointer to a character buffer

 

 




Synopsis

#include "silver.h"

 

The get_texture_path function will retrieve the file path of a texture that is specified by td_flags.

 

 

Parameters

td_flags is a TEXTURE_DATA 'Flags' value, or one formatted with MAKE_TEXTURE_FLAG.

 

texture_path is a pointer to a character buffer that will receive the full path of the texture specified by td_flags.

 

 

Return Value

get_texture_path returns TRUE if td_flags is associated with a texture and texture_path is not NULL, otherwise it returns FALSE

 

 

Remarks

If the texture index associated with td_flags is zero, then there is no texture associated with the TEXTURE_DATA from which it came.

 

 

See Also

MAKE_TEXTURE_FLAG, TEXTURE_DATA

 

 

Example

Assuming that TEXTURE_DATA is properly set, the following code will get the path associated with the texture and report it in an error message:

C / C++ Code

 

 #include "silver.h"

 #include "ssnodes.h"

 

 TEXTURE_DATA td;

 char         texture_path[_MAX_PATH];

 

 

 // td would be assigned here . . .

 

 

 if ( get_texture_path(td.Flags, texture_path) )

    error_message("The path of texture %d is %s",

                  TEXTURE_INDEX(td.Flags),

                  texture_path);