Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

FindNextValidTechnique and Textures problem

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 noatom   Members   

925
Like
0Likes
Like

Posted 10 January 2013 - 10:47 AM

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:
D3DXHANDLE hTech;
anEffect->FindNextValidTechnique(NULL,&hTech);

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++){
anEffect->FindNextValidTechnique(NULL,hTech);
}

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?
aneEffect->SetTexture("text0",(LPDIRECT3DBASETEXTURE9)tex->pData);

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, 10 January 2013 - 11:27 AM.


#2 cozzie   Members   

4964
Like
0Likes
Like

Posted 10 January 2013 - 01:53 PM

Hi,
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 :)

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me


#3 noatom   Members   

925
Like
0Likes
Like

Posted 10 January 2013 - 03:38 PM

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 />




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.