Hi
The answer might just be "use platforminfo command" but I want to check...
If using a game for android and iOS and Desktop what is the best method for managing all when using addons like AndroidExtras etc.?
Is it platforminfo best or have a separate project or something else?
(p.s. can someone repost the gameloop code based on Dewitter loop? Looks like its gone from forum)
I think preprocessor commands is the best solution, because each platform can use the code they needs. You can create different executables with the same project.
?IF DEFINED(WIN32) OR DEFINED(LINUX)
// desktop code...
?ELSEIF DEFINED(IPHONE)
// Apple code...
?ELSEIF DEFINED(ANDROID)
// Android code...
?ELSE
?ERROR "Not supported platform"
?ENDIF
and uses functions as well, which can help very much instead using commands directly (as well DEFINED functions), example when doing GameController support.
Thanks will try this..!
not sure its fixed in v12, but eailer glbasic version was ANDROID not defined at all. But if its not fixed in this version (not tested), its can been done like this:
?DEFINE ANDROID
?IFDEF WIN32
?UNDEF ANDROID
?ENDIF
?IFDEF IPHONE
?UNDEF ANDROID
?ENDIF
?IFDEF OSXUNI
?UNDEF ANDROID
?ENDIF
?IFDEF WEBOS
?UNDEF ANDROID
?ENDIF
Top of your code, if the same issue happens.
Thanks Spacefractal!
Just tested it: ?IFDEF ANDROID seems to work, so your workaround is not needed spacefractal.
nice to hear. Its was in "just in case" issue.