Platform

More...

Enumerations

enum
MBButtons {
  Ok 
  OkCancel 
  RetryCancel 
  SaveDontSave 
  SaveDontSaveCancel 
}

Which buttons to display on a message box.

enum
MBIcons {
  Information 
  Warning 
  Stop 
  Question 
}

What icon to show on a message box.

enum
MBReturnVal {
  OK 
  Cancelled 
  Retry 
  DontSave 
}

Return value for messageBox() indicating which button was pressed by the user.

Functions

void

Close our startup splash window.

bool
displaySplashWindow(string path)

Display a startup splash window suitable for showing while the engine still starts up.

string

Return the current local time as: weekday month day year hour min sec.

int

Return the current real time in milliseconds.

int

Sim time is time since the game started.

bool

Test whether Torque is running in web-deployment mode.

void
gotoWebPage(string address)

Open the given URL or file in the user's web browser.

bool

Test whether the engine has been compiled with TORQUE_DEBUG, i.e. if it includes debugging functionality.

bool

Test whether the engine has been compiled with TORQUE_SHIPPING, i.e. in a form meant for final release.

bool

Test whether the engine has been compiled with TORQUE_TOOLS, i.e. if it includes tool-related functionality.

int
messageBox(string title, string message, MBButtons buttons, MBIcons icons)

Display a modal message box using the platform's native message box implementation.

void
playJournal(string filename)

Begin playback of a journal from a specified field.

void
quit()

Shut down the engine and exit its process.

void
quitWithErrorMessage(string message, int status)

Display an error message box showing the given message and then shut down the engine and exit its process.

void
quitWithStatus(int status)

Shut down the engine and exit its process.

void
saveJournal(string filename)

Save the journal to the specified file.

Variables

int

Controls processor time usage when the game window is out of focus.

int

Controls processor time usage when the game window is in focus.

Detailed Description

Enumerations

MBButtons

Enumerator

Ok
OkCancel
RetryCancel
SaveDontSave
SaveDontSaveCancel

Which buttons to display on a message box.

MBIcons

Enumerator

Information
Warning
Stop

Stops the spin sequence at its current position.

Stop the sound source spawned last by this playlist. Then proceed.

Question

What icon to show on a message box.

MBReturnVal

Enumerator

OK
Cancelled
Retry
DontSave

Return value for messageBox() indicating which button was pressed by the user.

Functions

closeSplashWindow()

Close our startup splash window.

note:

This is currently only implemented on Windows.

displaySplashWindow(string path)

Display a startup splash window suitable for showing while the engine still starts up.

note:

This is currently only implemented on Windows.

Parameters:
path

relative path to splash screen image to display.

return:

True if the splash window could be successfully initialized.

getLocalTime()

Return the current local time as: weekday month day year hour min sec.

Local time is platform defined.

getRealTime()

Return the current real time in milliseconds.

Real time is platform defined; typically time since the computer booted.

getSimTime()

Sim time is time since the game started.

Return the current sim time in milliseconds.

getWebDeployment()

Test whether Torque is running in web-deployment mode.

In this mode, Torque will usually run within a browser and certain restrictions apply (e.g. Torque will not be able to enter fullscreen exclusive mode).

return:

True if Torque is running in web-deployment mode.

gotoWebPage(string address)

Open the given URL or file in the user's web browser.

Parameters:

address

The address to open. If this is not prefixed by a protocol specifier ("...://"), then the function checks whether the address refers to a file or directory and if so, prepends "file://" to adress; if the file check fails, "http://" is prepended to address.

gotoWebPage( "http://www.garagegames.com" );

isDebugBuild()

Test whether the engine has been compiled with TORQUE_DEBUG, i.e. if it includes debugging functionality.

return:

True if this is a debug build; false otherwise.

isShippingBuild()

Test whether the engine has been compiled with TORQUE_SHIPPING, i.e. in a form meant for final release.

return:

True if this is a shipping build; false otherwise.

isToolBuild()

Test whether the engine has been compiled with TORQUE_TOOLS, i.e. if it includes tool-related functionality.

return:

True if this is a tool build; false otherwise.

messageBox(string title, string message, MBButtons buttons, MBIcons icons)

Display a modal message box using the platform's native message box implementation.

Parameters:

title

The title to display on the message box window.

message

The text message to display in the box.

buttons

Which buttons to put on the message box.

icons

Which icon to show next to the message.

return:

One of $MROK, $MRCancel, $MRRetry, and $MRDontSave identifying the button that the user pressed.

messageBox( "Error", "" );

playJournal(string filename)

Begin playback of a journal from a specified field.

Parameters:

filename

Name and path of file journal file

quit()

Shut down the engine and exit its process.

This function cleanly uninitializes the engine and then exits back to the system with a process exit status indicating a clean exit.

quitWithErrorMessage(string message, int status)

Display an error message box showing the given message and then shut down the engine and exit its process.

This function cleanly uninitialized the engine and then exits back to the system with a process exit status indicating an error.

Parameters:

message

The message to log to the console and show in an error message box.

status

The status code to return to the OS.

see:

quitWithStatus(int status)

Shut down the engine and exit its process.

This function cleanly uninitializes the engine and then exits back to the system with a given return status code.

Parameters:

status

The status code to return to the OS.

saveJournal(string filename)

Save the journal to the specified file.

Variables

int backgroundSleepTime 

Controls processor time usage when the game window is out of focus.

int timeManagerProcessInterval 

Controls processor time usage when the game window is in focus.