Game Development Community

MinApp (Sample Code Enclosed)

by Jeremy Easoz · in Torque Game Engine Advanced · 12/10/2008 (1:06 pm) · 2 replies

Disclaimer: Minimum Application has a different meaning to different people.
To me a minimum application is TGEA processing a window, simple as that.
-----------------------------------------------------------------------------------------------

I have been messing with TGEA 1.7.1 and 1.8 beta.
I started with a clean slate pretty much to test some things out.
So I started working on a minimum application.

All that is required to run this is a TGEA executable
and the shader directory.
Simple put the code below into main.cs and drop it in the same
directory as the TGEA executable.

$appName = "TGETestbed";            // Set application name

new GuiControlProfile(GuiDefaultProfile);
new GuiCanvas(Canvas);

Explanation:

Yep, a whole 3 lines of code.
A TGEA Canvas requires a GUIDefaultProfile.

Simple as that.

To be of any use you really need a console with the above min app.

//-----------------------------------------------------------------------------
// Global Settings
$appName = "TGETestbed";                // Set application name
$defaultGame = "scriptsAndAssets";   // Game Directory
$logMode = 6;                                     // Engine Log File Mode
$winConsole = true;                           // Win Console

//-----------------------------------------------------------------------------
// Functions
setLogMode($logMode);
enableWinConsole($winConsole);

new GuiControlProfile(GuiDefaultProfile);
new GuiCanvas(Canvas);

I like using the windows console over the ingame console because 90% of the time
you are developing your game in a window anyway so instead of covering the game I can
pull the console off to the side.

After you execute either app you will notice that TGEA is using your main directory for the
font cache directory.
Just set the $Gui::fontCacheDirectory engine global to whatever directory you would like to
save your font cache.

#2
12/10/2008 (2:35 pm)
Yeah, now that's what I call minimal -- good job!