Multi Device Management

Previous topic - Next topic

MrPlow

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)

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

hardyx

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.

Code (glbasic) Select

?IF DEFINED(WIN32) OR DEFINED(LINUX)
    // desktop code...
?ELSEIF DEFINED(IPHONE)
    // Apple code...
?ELSEIF DEFINED(ANDROID)
    // Android code...
?ELSE
    ?ERROR "Not supported platform"
?ENDIF


spacefractal

and uses functions as well, which can help very much instead using commands directly (as well DEFINED functions), example when doing GameController support.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Thanks will try this..!
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#4
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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Thanks Spacefractal!
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

kanonet

Just tested it: ?IFDEF ANDROID seems to work, so your workaround is not needed spacefractal.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

spacefractal

nice to hear. Its was in "just in case" issue.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/