Sign in to follow this  

FindNextValidTechnique and Textures problem

Recommended Posts

noatom    927
I don't have any experience with directx 9,so I'm not familiar with it's functions.

What I'm trying to do,is get all the valid techniques in an effect file.Now I know you can get them 1 by 1 like this:

What I want to know,is if DirectX keeps an internal pointer to the current technique in that effect,or if it just checks to see what it's the current technique used in hTech,and just increment it.

So finally,could I do this?

D3DXHANDLE hTech[15];

for(int i = 0;i<15;i++){

You can see that all I'm trying to do is just extract all the techniques that are in that effect file,and put each one of them in my array.

But is that possible? And if so,where is that internal pointer kept?

And the other problem:
This will probably sound dumb,but can I do this?

tex is a structure that contains some details about texture,like it's name etc.But it also contains the raw data of a texture,that is kept in a void*.In this case,pData is the pointer to void*.

So is the stuff I'm doing there,casting it to a (LPDIRECT3DBASETEXTURE9) correct? I can't compile now,I just want to know if it will throw errors and why. Edited by noatom

Share this post

Link to post
Share on other sites
cozzie    5029
That's a lot of questions in a short text :)

A few pointers to get you started;
- looping through the valid techniques might compile and run but will save only the last/ 15th technique, because you dont use an array of htech objects correct, use htech[i]
- why 15, not sure but i think there's a function to go to 'end of techniques' in the effect (there must be)
- set 2nd parameter of the settexture should be of type lpdirect3dtexture..., void won't work, if pdata would be a lpdirect3dtexture... It should work

Maybe not asked, but if you're starting with effects/shaders and you use d3d9, i'd first go play around since almost all of todays hardware with vs/ps 2.0 will accept your techniques (unless ofcourse youre working on the next cryengine or something :)

Share this post

Link to post
Share on other sites
noatom    927
well I am casting the data to a lpdirect3dtexture<br /><br />And I put 15 because I don't think you'll have over 15 techniques in a single effect file,it's just there.For the end version I could use a vector&lt;D3DXHANDLE&gt;<br /><br />

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this