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

D3DXCreateEffectFromResource question

Started by tsz Sep 15, 2004 at 4:57 PM 2 replies 2.6k views
Original Post
tsz
tsz
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
RenderTarget
RenderTarget
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 );
[sub]My spoon is too big.[/sub]
Muhammad Haggag
Muhammad Haggag
Quote:
Original post by Anonymous Poster
thank you very much.

the preprocessor is kinda like a text replacement, right?

You can say so.

Topic Locked

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

Sign in to reply to this topic.