Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17063

Registering #define values with engine

$
0
0

I'm registering methods that use #defines for default parameter values , ex: 

#define IO_HIGH     1
#define IO_LOW      0

Registration is successful, but the values are undefined when the script is compiled. I'm guessing b/c #defines are just macro substitutions by the preprocessor. I can use the #define value directly in the Registration call. That works fine, but of course is a bit error prone for the future.  The only other thing I can think of is to create an enum of #defines that are parameter defaults and register those. Is there a more maintainable solution?


Viewing all articles
Browse latest Browse all 17063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>