Advertisement Jump to content
Sign in to follow this  
jal_

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

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

Share this post


Link to post
Share on other sites
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 :)

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!