Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] Conditional build

Author
Message
marvin944
10
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 17th Nov 2019 22:55
Is there an option to add paltform conditions into the software? E.g. can I skip certain code when it runs on certain platform. Skipping plugins or otherwise things I don't need in Android or iOS.
Dutch

The author of this post has marked a post as an answer.

Go to answer

SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 17th Nov 2019 23:23
This post has been marked by the post author as the answer.
In-code, you can check the 'GetDeviceBaseName()', other parameters, and even which rendering API is being used to selectively activate or deactivate code. And I highly recommend doing that so you can work from one consistent codebase for easier project management across multiple platforms.

Unfortunately, you can't do this with plugins and will only receive an error message if a plugin isn't available for the platform you are running on. This is one of the biggest drawbacks to plugins and why it's best to try and avoid them if you want your project to be more cross-platform. Plugins typically lack support for the same platforms that AppGameKit does support, often only supporting one platform and sometimes only one bit format on that platform, so they are inherently more restrictive/limited for projects. You also risk introducing runtime dependencies with plugins that would otherwise not be required for your project, unless the plugin is properly compiled to avoid it.

So try to do as much in AppGameKit code as you can or if possible, work with plugins that support all of the platforms you intend to target.
marvin944
10
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 18th Nov 2019 09:50
I cannot avoid using the plugin as is solves an issue AppGameKit has with Window Titles. Fortunately I only have to disable two lines of code before deploying to Android, but it would be awesome if the APK would be able to ignore some code during runtime...
Dutch

Login to post a reply

Server time is: 2024-04-13 16:19:44
Your offset time is: 2024-04-13 16:19:44