Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL: tnlPlatform.h File Reference

# tnlPlatform.h File Reference

`#include <string.h>`
`#include <stdlib.h>`
`#include "tnlTypes.h"`

## Namespaces

namespace | TNL
namespace | TNL::Platform

## Defines

#define | TIME_BLOCK(name, block) { S64 st = Platform::getHighPrecisionTimerValue(); {block} S64 delta = Platform::getHighPrecisionTimerValue() - st; F64 ms = Platform::getHighPrecisionMilliseconds(delta); logprintf("Timer: %s Elapsed: %g ms", #name, ms); }
#define | TNL_DEBUGBREAK() Platform::debugBreak();
| Macro to do in-line debug breaks, used for asserts. Does inline assembly where appropriate.
#define | TNL_CHECK_HEAP() { bool status = TNL::Platform::checkHeap(); if(!status) TNL_DEBUGBREAK(); }
#define | QSORT_CALLBACK FN_CDECL

## Functions

void | TNL::Platform::outputDebugString (const char *string)
| Prints a string to the OS specific debug log.
void | TNL::Platform::debugBreak ()
| Stops the program in the debugger, if it is being debugged.
void | TNL::Platform::forceQuit ()
| Forces the program to exit immediately.
void | TNL::Platform::AlertOK (const char *windowTitle, const char *message)
| Brings up a dialog window with a message and an "OK" button.
bool | TNL::Platform::AlertOKCancel (const char *windowTitle, const char *message)
| Brings up a dialog window with the message, and "OK" and "Cancel" buttons.
bool | TNL::Platform::AlertRetry (const char *windowTitle, const char *message)
| Brings up a dialog window with the message, and "Retry" and "Cancel" buttons.
U32 | TNL::Platform::getRealMilliseconds ()
| Elapsed time in milliseconds.
S64 | TNL::Platform::getHighPrecisionTimerValue ()
| Returns a high-precision time value, in a platform-specific time value.
F64 | TNL::Platform::getHighPrecisionMilliseconds (S64 timerDelta)
| Converts a high precision timer delta into milliseconds.
void | TNL::Platform::sleep (U32 msCount)
| Put the process to sleep for the specified millisecond interva.
bool | TNL::Platform::checkHeap ()
| checks the status of the memory allocation heap
bool | TNL::atob (const char *str)
| String to boolean conversion.
int | TNL::dSprintf (char *buffer, U32 bufferSize, const char *format,...)
| Printf into string with a buffer size.
int | TNL::dVsprintf (char *buffer, U32 bufferSize, const char *format, void *arglist)
| Vsprintf with buffer size argument. compiler independent.
char | TNL::dToupper (const char c)
| Converts an ASCII character to upper case.
char | TNL::dTolower (const char c)
| Converts an ASCII character to lower case.

## Define Documentation

#define TIME_BLOCK | ( | name,
|  | block |  | ) | { S64 st = Platform::getHighPrecisionTimerValue(); {block} S64 delta = Platform::getHighPrecisionTimerValue() - st; F64 ms = Platform::getHighPrecisionMilliseconds(delta); logprintf("Timer: %s Elapsed: %g ms", #name, ms); }

#define TNL_DEBUGBREAK | (

)
Platform::debugBreak();

Macro to do in-line debug breaks, used for asserts. Does inline assembly where appropriate.

#define TNL_CHECK_HEAP | ( |  | ) | { bool status = TNL::Platform::checkHeap(); if(!status) TNL_DEBUGBREAK(); }

#define QSORT_CALLBACK FN_CDECL