C
Christopher
Is it possible to dynamically create a data structure?
Not that it matters, but just for understanding, I am working with
video shaders, these shaders use thier own language (HLSL) which you
compile at runtime and run for rendering. The HLSL can contain many
differant types of variables and expect your application to set them.
The library provides the ability to query for
number of variables
thier names
thier types
and provides a method for setting them that is depedent on the type
My goal is to package them, no matter what they are, into a single
material class, that can be used no matter what the HLSL it
corresponds to looks like.
So, I want the same data structure that is capable of setting, for
example, two floats in one case, a float and a string in another case,
7 floats and an array of UDTs in another case, etc.
My first thought was to create a class that had a one map for every
possible type, but I am not sure that is the best.
I was also thinking of making seperate "Material Property" classes
that could be added and removed from a "Material", but its fuzzy.
Any ideas?
Not that it matters, but just for understanding, I am working with
video shaders, these shaders use thier own language (HLSL) which you
compile at runtime and run for rendering. The HLSL can contain many
differant types of variables and expect your application to set them.
The library provides the ability to query for
number of variables
thier names
thier types
and provides a method for setting them that is depedent on the type
My goal is to package them, no matter what they are, into a single
material class, that can be used no matter what the HLSL it
corresponds to looks like.
So, I want the same data structure that is capable of setting, for
example, two floats in one case, a float and a string in another case,
7 floats and an array of UDTs in another case, etc.
My first thought was to create a class that had a one map for every
possible type, but I am not sure that is the best.
I was also thinking of making seperate "Material Property" classes
that could be added and removed from a "Material", but its fuzzy.
Any ideas?