macMain.mm
Engine/source/platformMac/macMain.mm
Public Functions
bool
torque_engineinit(int argc, const char ** argv)
bool
int
int
torque_macmain(int argc, const char ** argv)
TorqueMain(S32 argc, const char ** argv)
Detailed Description
Public Functions
InitWindowingSystem()
main(int argc, const char ** argv)
torque_engineinit(int argc, const char ** argv)
torque_engineshutdown()
torque_enginetick()
torque_getreturnstatus()
torque_macmain(int argc, const char ** argv)
TorqueMain(S32 argc, const char ** argv)
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#import "app/mainLoop.h" 25#import "platform/platformInput.h" 26#import "console/console.h" 27 28extern void InitWindowingSystem(); 29 30//------------------------------------------------------------------------------ 31void Platform::init() 32{ 33 34 Con::printf("Initializing platform..."); 35 36 // Set the platform variable for the scripts 37 Con::setVariable( "$platform", "MacOSX" ); 38 39 Input::init(); 40 41 //installRedBookDevices(); 42 43#ifndef TORQUE_DEDICATED 44 // if we're not dedicated do more initialization 45 InitWindowingSystem(); 46#endif 47} 48 49//------------------------------------------------------------------------------ 50void Platform::shutdown() 51{ 52 53} 54 55//------------------------------------------------------------------------------ 56 57 58extern "C" 59{ 60 bool torque_engineinit(int argc, const char **argv); 61 int torque_enginetick(); 62 S32 torque_getreturnstatus(); 63 bool torque_engineshutdown(); 64 65 int torque_macmain(int argc, const char **argv) 66 { 67 if (!torque_engineinit(argc, argv)) 68 return 1; 69 70 while(torque_enginetick()) 71 { 72 73 } 74 75 torque_engineshutdown(); 76 77 return torque_getreturnstatus(); 78 79 } 80} 81 82extern S32 TorqueMain(S32 argc, const char **argv); 83 84#if !defined(TORQUE_SHARED) 85int main(int argc, const char **argv) 86{ 87 return TorqueMain(argc, argv); 88} 89#endif 90 91