#define's with MATERIAL*->effect ... doesn't work!

Posted By: HeelX

#define's with MATERIAL*->effect ... doesn't work! - 09/26/10 11:19

I am wondering why this doesn't work... I defined a string and use this define in a MATERIAL* definition. When I run the engine, I always get

Quote:
Malfunction W1550: Can't compile effect:
objMtlDeferredSwitch
D:\Projects\2010\Shaders\SSAO\main\demos\animatedSprite\memory(1,1): error X3000: unrecognized identifier 'OBJMTLDEFERREDSOLID_SHADER'.


Here is the code:

Code:
#define OBJMTLDEFERREDSOLID_SHADER "objDefSolid.fx"

MATERIAL* objMtlDeferredSwitch = {
   effect = OBJMTLDEFERREDSOLID_SHADER; // Doesn't work
   flags = ENABLE_RENDER;
   event = objMtlDeferredSwitch_ev;
}



Best regards,
-Christian

P.S: if I use a static char* or STRING*-string instead, it doesn't work either... frown
Posted By: Saturnus

Re: #define's with MATERIAL*->effect ... doesn't work! - 09/26/10 19:10

Probably this is the reason:
"#defines are valid within all subsequent code, but ignored within engine objects definitions, such as PANEL*, MATERIAL* etc."
http://www.conitec.net/beta/define.htm

Perhaps there's some kind of pre-pre-compiler for engine objects?
Posted By: HeelX

Re: #define's with MATERIAL*->effect ... doesn't work! - 09/26/10 19:48

Brah! My disregard for the manual was way too obvious this time smile

Thanks, pal!
Sorry, others!!
© 2023 lite-C Forums