Skip to main content
GameDev.net gamedev.net
🔒 Locked

Dynamically grabbing Effect variables?

Started by hannibal84 Aug 21, 2006 at 3:58 PM 1 replies 600+ views
Original Post
hannibal84
hannibal84
Is there a way to dynamically get the variables from a Direct3D Effect? For instance, the effect has two matrices: worldMat and worldViewProjMat. Is there a way I can query the object to get these two variables (and their types)? Without parsing the file itself, preferably.
jollyjeffers
jollyjeffers
If you access it via the ID3DXEffect interface then you've got access to that sort of information. The D3DX loader/compiler will do the appropriate parsing for you - exposing the information through various Get**() calls (note that you need to check ID3DXBaseEffect's documentation for the full list).

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
hannibal84
hannibal84
I didn't think to check the C++ documentation (I'm using C#, which for some reason has poorly documented equivalents). But it still looks like I need to have a handle to the variable beforehand, either through knowing the variable's name or position in the file. But what if I don't know the structure of the file beforehand (i.e., I have no idea what variables exist beforehand)? Is there a way I can get a list of the variable names or even the number of variables in the file?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.