Jump to content
  • Advertisement
Sign in to follow this  
tsz

D3DXCreateEffectFromResource question

This topic is 5055 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. Does anybody know how to use the preprocessor when loading an effect file? I am talking about the "const D3DXMACRO *pDefines" parameter. Thanks alot Tom

Share this post


Link to post
Share on other sites
Advertisement
Sure. It's pretty easy, though the docs aren't real clear. Just declare an array of D3DXMACRO objects, and set the last one to {NULL, NULL}. The loaders will go through each element to get macro assignments:

D3DXMACRO mac[ 2 ] =
{
{ "MATRIX_PALETTE_SIZE_DEFAULT", "35" },
{ "NUMBER_OF_LIGHTS," "3" },
{ NULL, NULL }
};

hr = D3DXCreateEffectFromResource( m_pDevice,
NULL,
sFxFile,
& mac,
NULL,
dwShaderFlags,
NULL,
& m_pEffect,
NULL );

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
thank you very much.

the preprocessor is kinda like a text replacement, right?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!