A basic version of the new resource data interface is available now in the svn repository.
The following functions were added:
Code:
int getResourceElemCount( ResHandle res, int elem );
int getResourceParamI( ResHandle res, int elem, int elemIdx, int param );
bool setResourceParamI( ResHandle res, int elem, int elemIdx, int param, int value );
float getResourceParamF( ResHandle res, int elem, int elemIdx, int param, int compIdx );
bool setResourceParamF( ResHandle res, int elem, int elemIdx, int param, int compIdx, float value );
const char *getResourceParamStr( ResHandle res, int elem, int elemIdx, int param );
bool setResourceParamStr( ResHandle res, int elem, int elemIdx, int param, const char *value );
void *mapResourceStream( ResHandle res, int elem, int elemIdx, int stream, bool read, bool write );
bool unmapResourceStream( ResHandle res );
The enums indicate the type now and look like this:
Code:
struct MaterialResData
{
enum List
{
E_Material = 400,
E_Sampler,
E_Uniform,
PS_MatClass,
PI_MatLink,
PI_MatShader,
PS_SamplerName,
PI_SamplerTexRes,
PS_UniformName,
P4F_UniformValue
};
};
As always, feedback, criticism and improvement suggestions are welcome!