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

string to D3DENUMTYPE

Started by Pipo DeClown Apr 26, 2004 at 3:06 PM 2 replies 350+ views
Original Post
Pipo DeClown
Pipo DeClown
I''m trying to write a scripting engine for D3D. I was wondering if there was a handy function that converts strings to types(ints)? For example: handyFunction( "D3D_CULLMODE" ); // 22. -- You''re Welcome, Rick Wong - sitting in his chair doing the most time-consuming thing..
RenderTarget
RenderTarget
Not exactly. But, look at the Effects framework. It might fit in really well with your engine, and handle things like that.

I like pie.
[sub]My spoon is too big.[/sub]
Pipo DeClown
Pipo DeClown
I will take a look. Thank you very much!

[after searching..]
Where is the file you're pointing to?


--
You're Welcome,
Rick Wong

- sitting in his chair doing the most time-consuming thing..

[edited by - Pipo DeClown on April 27, 2004 10:22:53 AM]
Muhammad Haggag
Muhammad Haggag
- The effects framework is part of D3DX. Search for Effects framework or ID3DXEffect in the docs. They're not exactly what you're looking for. They're what you're trying to do, kind of. They're text files that you can use to 'script' all the pipeline state changes and setups.

- You can use a std::map with string keys and integer values. Then at initialization, insert all your "state names" coupled with their D3DENUM value. After that, you'll be able to do things like:
D3DRENDERSTATETYPE rs = rsTable["D3DRS_LIGHTING"];  


Muhammad Haggag,
Optimize
Bitwise account: MHaggag -
[edit]Correction

[edited by - Coder on April 27, 2004 3:11:36 PM]

Topic Locked

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

Sign in to reply to this topic.