Examples

Here are some simple program examples with sources that show how to use the AntTweakBar library.
Commented sources of the examples below can be found in the examples directory of the AntTweakBar library. Executables (compiled examples) can be found in the examples/bin32 and examples/bin64 directories.


To build the examples, please follow the installation instructions.


TwSimpleGLFW

A simple example using AntTweakBar with OpenGL and GLFW windowing system.

Source file

Screenshot


TwSimpleGLUT

A simple example using AntTweakBar with OpenGL and GLUT .

This example also demonstrates the use of quaternion and direction types. Quaternions are used to represent rotation, see the following link for a detailed description: http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

Source file

Screenshot


TwSimpleSDL

A simple example using AntTweakBar with OpenGL and SDL .

Source file

Screenshot


TwSimpleSFML

A simple example using AntTweakBar with OpenGL and SFML .

Source file

Screenshot


TwGLCoreSDL

A simple example using AntTweakBar with OpenGL Core Profile and SDL .

Source file

Screenshot


TwSimpleDX9

A simple example using AntTweakBar with DirectX9 .

Source file

Screenshot


TwSimpleDX10

A simple example using AntTweakBar with DirectX10. It requires a Windows version that supports at least DirectX10 (Vista, 7,...).

Source file

Screenshot


TwSimpleDX11

A simple example using AntTweakBar with DirectX11. It requires a Windows version that supports at least DirectX11 (Vista, 7,...).

Source files

Screenshot


TwAdvanced1

An example showing many features of AntTweakBar (including definition of custom structure type and variable accessed via callbacks). It also uses OpenGL and GLFW but could be easily adapted to other frameworks.

Source file

Screenshot


TwString

This example illustrates the different ways to handle String variables. It also uses OpenGL and GLUT but could be easily adapted to other frameworks.

Source file

Screenshot


TwDualGLUT

This example illustrates multi-window support. The function TwSetCurrentWindow is used to switch between window contexts.

Source file

Screenshot