TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

Functions
Windows Platform
Function Categories

## Functions
void | enableWinConsole (enable)
void | getWinNTVersion ()
void | GLEnableLogging (enable)
void | GLEnableMetrics (enable)
void | GLEnableOutline (bool)
void | mathInit (extension)
void | openFolder (folder)
Boolean | shellExecute (executable, [args]?, [directory]?)
int | shellExecuteBlocking (executable, [args]?, [directory]?)

## Detailed Description

## Function Documentation

void enableWinConsole | ( | enable |  | ) |

Use the enableWinConsole function to tell TGB to create an external console window, either as a separate DOS window or as a new window under OSX/Linux/*NIX. Subsequent calls to this function do nothing. Only one external console is allowed

Parameters

  enable | A boolean. If this value is set to true, a new console window will be created.

Returns
  No return value.

void getWinNTVersion | ( |  | ) |

void GLEnableLogging | ( | enable |  | ) |

Use the GLEnableLogging function to enable/disable the gathering of OpenGL metrics. For this to work, the engine must have been compiled with either TORQUE_DEBUG or INTERNAL_RELEASE defined. Always be sure to do a disable after an enable to flush the last log data to the log file.

Parameters

  enable | A boolean value. If set to true, the engine will gather various OpenGL metrics and dump them to a file named gl_log.txt. If set to false, logging is stopped, the last writes to the log are flushed, and the file is closed.

Returns
  No return value.

See also
  GLEnableMetrics, metrics

void GLEnableMetrics | ( | enable |  | ) |

Use the GLEnableMetrics function to enable or disable logging of OpenGL texture and video metrics. For this to work, the engine must have been compiled with either TORQUE_DEBUG or INTERNAL_RELEASE defined. Use the metrics function to get at this information. Also, once this feature is enabled, the following globals will be available for inspection/examination: <OpenGL::triCount0 ? Terrain triangles, OpenGL::triCount1? DIF triangles, OpenGL::triCount2 ? DTS triangles, OpenGL::triCount3 ? Uncategorized triangles, OpenGL::primCount0 - Terrain primitives, OpenGL::primCount1 ? DIF primitives, OpenGL::primCount2 ? DTS primitives, OpenGL::primCount3 ? Uncategorized primitives>

Parameters

  enable | A boolean value. When this is set to true, texture and video (triangles and primitives) logging is enabled and dumped as part of calls to certain metrics.

Returns
  No return value.

See also
  GLEnableLogging, metrics

void GLEnableOutline | ( | bool |  | ) |

Enables outlines with OpenGL

Parameters

  enable | Boolean value representing whether or not outlines should be enabled.

Returns
  No Return Value.

void mathInit | ( | extension |  | ) |

Use the MathInit function to install a specified math extensions, or to detect and enable all extensions. Generally speaking, the best extension choice is to used detect. This will automatically detected and enable all extensions supported by the current processor. It will also print out a list of the extension that were enabled to the console

Parameters

  extension | Can be any of these:detect ? Detect all supported extensions and enable.C - Enable standard C extensions.FPU - Enable floating-point-unit extensions.MMX - Enable Intel MMX extensions.3DNOW - Enable AMD 3DNOW extensions.SSE - Enable Intel SSE extensions.

Returns
  No return value.

void openFolder | ( | folder |  | ) |

Opens a folder of the platform

Boolean shellExecute | ( | executable | ,
|  | [args] ? | ,
|  | [directory] ? |
| ) |  |

Executes a process

Parameters

  executable | The program to execute
  args | Arguments to pass to the executable
  directory | The directory in which the program is located

Returns
  Returns true on success, false otherwise

int shellExecuteBlocking | ( | executable | ,
|  | [args] ? | ,
|  | [directory] ? |
| ) |  |

Parameters

  executable | The program to execute
  args | Arguments to pass to the executable
  directory | The directory in which the program is located

Returns
  Returns true on success, false otherwise