Sign in to follow this  

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

This topic is 3463 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
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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this