Jump to content
  • Advertisement
Sign in to follow this  

[DX9, HLSL] HLSL and preprocessor directives

This topic is 3093 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 all;

As the title says, I want to add my shaders' code some "#define"s. But I want to do it at runtime, and by using my Win32 D3D App.

For example, I want to use a code like that:





Can I pass that MY_PREDEFINITION thing from my Win32 app to the shader at runtime? I've looked at pDefines parameter of D3DXCreateEffectFromFile() (it's a D3DXMACRO type element) but couldn't understand anything.

Can anyone help me?

Thanks in advance.

Share this post

Link to post
Share on other sites
you need to send defines as array of types it's asking
like that
NULL,NULL - final closing tag
look here for more details http://msdn.microsoft.com/en-us/library/bb172910%28v=VS.85%29.aspx

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!