🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

letting the script know a constant value in a #define macro

Started by
1 comment, last by jal_ 16 years ago
Hi, I simply want to let the script know some constant values defined in macros (y'know, #define BLAH 5). I don't see it in the manual and I fail at doing it using RegisterGlobalProperty. Any hint for this? I can always change the way they are defined in the code, but I thought I could ask first. Thnx in advance.
Advertisement
A #define macro is replaced with the value it's define to everywhere it's used at preprocessor time. This means it doesn't really exist anywhere in memory, so AngelScript doesn't have anything to bind to. To be able to bind it as a global, you need it to be in a variable (like "static const int blah = 5" or so).

Hope that helps :)
Ye, thought so. I'll register them as enums I guess.

This topic is closed to new replies.

Advertisement