Game Development Community

Setting Up Platform Specific Code in T2D

by Demolishun · in Torque 2D Beginner · 02/04/2017 (9:59 am) · 0 replies

I am reading through the T2D code trying to understand how to setup some platform specific code. For my purposes I want to have some code specific to Android platform and specific to PC/Mac/Linux platform for the same feature. The feature is midi input and output to devices, however the feature could be anything.

So I am going to assume I want Android code in the directory platformAndroid and I will assume for now since I am using a cross platform library for PC/Mac?Linux that my other version of the same code would be in the platform directory and have specific excludes for platforms it does not support.

What I am guessing at next is that I will have a generic say midi_functions.h file that contains the boilerplate interface. Then on the other relevant platforms have a midi_functions.cpp in the platform specific directories. That would make the most sense to me.

Am I on the right track here? Its been a while since I messed with Torque code.

About the author

I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67