Torque3D Documentation / _generateds / x86UNIXMain.cpp

x86UNIXMain.cpp

Engine/source/platformX86UNIX/x86UNIXMain.cpp

More...

Public Functions

int
main(int argc, const char ** argv)
bool
torque_engineinit(int argc, const char ** argv)
int
torque_unixmain(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_unixmain(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#include "platform/platform.h"
 25#include "platform/platformInput.h"
 26#include "console/console.h"
 27
 28#include "platformX86UNIX/platformX86UNIX.h"
 29#include "platformX86UNIX/x86UNIXStdConsole.h"
 30#include "platformX86UNIX/x86UNIXState.h"
 31
 32extern void InitWindowingSystem();
 33
 34//------------------------------------------------------------------------------
 35void Platform::init()
 36{
 37   StdConsole::create();
 38   stdConsole->enable(true);
 39
 40   // init process control stuff
 41   ProcessControlInit();
 42
 43   Con::printf("Initializing platform...");
 44
 45   // Set the platform variable for the scripts
 46   Con::setVariable( "$platform", "x86UNIX" );
 47#if defined(__linux__)
 48   Con::setVariable( "$platformUnixType", "Linux" );
 49#elif defined(__OpenBSD__)
 50   Con::setVariable( "$platformUnixType", "OpenBSD" );
 51#else
 52   Con::setVariable( "$platformUnixType", "Unknown" );
 53#endif
 54
 55   Input::init();
 56
 57   //installRedBookDevices();
 58
 59#ifndef TORQUE_DEDICATED
 60   // if we're not dedicated do more initialization
 61   InitWindowingSystem();
 62#endif
 63}
 64
 65//------------------------------------------------------------------------------
 66void Platform::shutdown()
 67{
 68   Cleanup();
 69}
 70
 71//------------------------------------------------------------------------------
 72
 73
 74extern "C"
 75{
 76   bool torque_engineinit(int argc, const char **argv);
 77   int  torque_enginetick();
 78   S32  torque_getreturnstatus();
 79   bool torque_engineshutdown();
 80
 81   int torque_unixmain(int argc, const char **argv)
 82   {
 83     if (!torque_engineinit(argc, argv))
 84         return 1;
 85
 86     while(torque_enginetick())
 87     {
 88
 89     }
 90
 91     torque_engineshutdown();
 92
 93     return torque_getreturnstatus();
 94
 95   }
 96}
 97
 98extern S32 TorqueMain(S32 argc, const char **argv);
 99
100#if !defined(TORQUE_SHARED)
101int main(int argc, const char **argv)
102{
103   return TorqueMain(argc, argv);
104}
105#endif
106