Sign in to follow this  

D3DXCreateEffectFromResource question

This topic is 4839 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
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

This topic is 4839 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.

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