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

examples/TwSimpleGLFW.c

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

examples/TwSimpleGLUT.c

Screenshot


TwSimpleSDL

A simple example using AntTweakBar with OpenGL and SDL .

Source file

examples/TwSimpleSDL.c

Screenshot


TwSimpleSFML

A simple example using AntTweakBar with OpenGL and SFML .

Source file

examples/TwSimpleSFML.cpp

Screenshot


TwGLCoreSDL

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

Source file

examples/TwGLCoreSDL.c

Screenshot


TwSimpleDX9

A simple example using AntTweakBar with DirectX9 .

Source file

examples/TwSimpleDX9.cpp

Screenshot


TwSimpleDX10

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

Source file

examples/TwSimpleDX10.cpp

Screenshot


TwSimpleDX11

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

Source files

examples/TwSimpleDX11.cpp
examples/TwSimpleDX11.hlsl

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

examples/TwAdvanced1.cpp

Screenshot


TwString

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

Source file

examples/TwString.cpp

Screenshot


TwDualGLUT

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

Source file

examples/TwDualGLUT.c

Screenshot