
Water Test
This water simulation demonstrates using GameTune to control a program, as opposed to using it as a property sheet. The buttons in the Water panel generate variable sized waves and splashes, which are calculated and displayed by the main window. Notice in the Console Panel that the program is displaying an error in red. The console provides complete control of colors and styles.
Code Example
The following is the code that polls the buttons and generates waves with appropriate sizes and velocities. Callback notification is another option for responding to changes to the interface.
// Idents
enum
{
GT_DROP_SIZE = 1000,
GT_DROP_WATER = 1001,
GT_WAVE_SIZE = 1002,
GT_HORZ_WAVE = 1003,
GT_VERT_WAVE = 1004,
GT_RESET = 1005,
};
// Check tuners for button presses.
if ( gtGetInt( GT_DROP_WATER ) )
PlaceWater( rect( 4.5, 4.5, 5.5, 5.5 ), gtGetFloat( GT_DROP_SIZE ), vector2d( 0, 0 ), 0 );
if ( gtGetInt( GT_HORZ_WAVE ) )
PlaceWater( rect( 0, 0, 10, 1 ), gtGetFloat( GT_WAVE_SIZE ), vector2d( 0, 0.13 ), 0 );
if ( gtGetInt( GT_VERT_WAVE ) )
PlaceWater( rect( 0, 0, 1, 10 ), gtGetFloat( GT_WAVE_SIZE ), vector2d( 0.13, 0 ), 0 );
if ( gtGetInt( GT_RESET ) )
InitWater();
That's all, you don't need to do anything else to use GameTune aside from two
calls to initialize the library and create the GameTune window, and one to shut
everything down.
Water Panel

Graphics Panel

Camera Panel

Console Panel
