diff --git a/.cproject b/.cproject
new file mode 100644
index 0000000..7a4e8cc
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.project b/.project
new file mode 100644
index 0000000..fe7e73d
--- /dev/null
+++ b/.project
@@ -0,0 +1,27 @@
+
+
+ SteerSuite_Release
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/build/build.sh b/build/build.sh
index 19e4bad..d2e79e4 100755
--- a/build/build.sh
+++ b/build/build.sh
@@ -141,7 +141,7 @@ GLFW_LINK=""
QT_LINK=""
QT_INCLUDES=""
-ANT_TWEAK_LINK="-L../../external/AntTweakBar/lib -lAntTweakBar"
+# ANT_TWEAK_LINK="-L../../external/AntTweakBar/lib -lAntTweakBar"
if [ "$ENABLE_GLFW_GUI" == "true" -o "$ENABLE_QT_GUI" == "true" ]; then
@@ -201,7 +201,7 @@ if [ "$BUILD_PLATFORM" == "osx" ]; then
BUILD_SCRIPT_DEFINES="-D_OSX $GUI_DEFINES"
STEERLIB_LFLAGS="$BASIC_LFLAGS $OSX_DYLIB_LFLAGS $OPENGL_LINK -lpthread -ldl $UTIL_LINK"
STEERBENCH_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $STEERLIB_LINK $UTIL_LINK"
- STEERSIM_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $OPENGL_LINK $QT_LINK $UTIL_LINK $STEERLIB_LINK $GLFW_LINK $ANT_TWEAK_LINK $PPR_LINK $ORCA_LINK $FOOTSTEP_LINK $CC_LINK "
+ STEERSIM_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $OPENGL_LINK $QT_LINK $UTIL_LINK $STEERLIB_LINK $GLFW_LINK $PPR_LINK $ORCA_LINK $FOOTSTEP_LINK $CC_LINK "
STEERTOOL_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $STEERLIB_LINK $UTIL_LINK"
SIMPLEAI_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $OSX_DYLIB_LFLAGS $STEERLIB_LINK $UTIL_LINK"
@@ -218,7 +218,7 @@ elif [ "$BUILD_PLATFORM" == "linux" ]; then
echo "Building SteerSuite for Linux"
RPATH_LFLAGS="-Wl,-rpath,$LIB_DIR" # -L$MODULES_DIR"
- ANT_TWEAK_LINK="$ANT_TWEAK_LINK -lX11 -lXxf86vm -lXext"
+ # ANT_TWEAK_LINK="$ANT_TWEAK_LINK -lX11 -lXxf86vm -lXext"
BASIC_CFLAGS="$BASIC_CFLAGS -ggdb -g"
BASIC_LFLAGS="$BASIC_LFLAGS -ggdb -g"
@@ -239,7 +239,7 @@ elif [ "$BUILD_PLATFORM" == "linux" ]; then
STEERLIB_INCLUDES="$BASIC_INCLUDES $UTIL_INCLUDE"
STEERBENCH_INCLUDES="$BASIC_INCLUDES $STEERLIB_INCLUDE $UTIL_INCLUDE"
- STEERSIM_INCLUDES="$BASIC_INCLUDES $STEERLIB_INCLUDE $QT_INCLUDES $ANT_TWEAK_LINK $UTIL_INCLUDE $PPR_INCLUDE $ORCA_INCLUDE $CC_INCLUDE"
+ STEERSIM_INCLUDES="$BASIC_INCLUDES $STEERLIB_INCLUDE $QT_INCLUDES $UTIL_INCLUDE $PPR_INCLUDE $ORCA_INCLUDE $CC_INCLUDE"
STEERTOOL_INCLUDES="$BASIC_INCLUDES $STEERLIB_INCLUDE $UTIL_INCLUDE"
SIMPLEAI_INCLUDES="$BASIC_INCLUDES $STEERLIB_INCLUDE $UTIL_INCLUDE"
@@ -255,7 +255,7 @@ elif [ "$BUILD_PLATFORM" == "linux" ]; then
BUILD_SCRIPT_DEFINES="-D_LINUX $GUI_DEFINES"
STEERLIB_LFLAGS="$BASIC_LFLAGS $OPENGL_LINK -lpthread -ldl $UTIL_LINK"
STEERBENCH_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $STEERLIB_LINK $UTIL_LINK"
- STEERSIM_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $UTIL_LINK $GLFW_LINK $OPENGL_LINK $QT_LINK $STEERLIB_LINK $ANT_TWEAK_LINK $PPR_LINK $ORCA_LINK $CC_LINK "
+ STEERSIM_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $UTIL_LINK $GLFW_LINK $OPENGL_LINK $QT_LINK $STEERLIB_LINK $PPR_LINK $ORCA_LINK $CC_LINK "
STEERTOOL_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $STEERLIB_LINK $UTIL_LINK"
SIMPLEAI_LFLAGS="$BASIC_LFLAGS $RPATH_LFLAGS $UTIL_LINK"
@@ -410,21 +410,6 @@ if [[ "$ENABLE_GLFW_GUI" == "true" && $BUILD_MODULE == "all" || "$ENABLE_GLFW_GU
popd > /dev/null
fi
-if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "anttweakbar" ]]; then
- echo "==================================="
- echo "Building AntTweakBar (external dependency)"
- echo "==================================="
- pushd ../external/AntTweakBar/src > /dev/null
- if [ "$BUILD_PLATFORM" == "osx" ]; then
- $MAKE -f MakeFile.osx
- AntTweak_BUILD_RETURN_CODE=$?
- else
- $MAKE
- AntTweak_BUILD_RETURN_CODE=$?
- fi
- popd > /dev/null
-fi
-
if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "util" ]]; then
echo "==================================="
@@ -550,18 +535,6 @@ if [ "$ENABLE_GLFW_GUI" == "true" ]; then
fi
fi
-if [ $AntTweak_BUILD_RETURN_CODE == 0 ]; then
- if [ "$BUILD_PLATFORM" == "osx" ]; then
- echo "copying libAntTweakBar.dylib to $LIB_DIR"
- cp ../external/AntTweakBar/lib/libAntTweakBar.dylib $LIB_DIR
- AntTweak_INSTALL_RETURN_CODE=$?
- else
- echo "copying libAntTweakBar.so to $LIB_DIR"
- cp ../external/AntTweakBar/lib/libAntTweakBar.so $LIB_DIR
- AntTweak_INSTALL_RETURN_CODE=$?
- fi
-fi
-
if [ $STEERLIB_BUILD_RETURN_CODE == 0 ]; then
echo "copying libsteer.so to $LIB_DIR"
cp ../steerlib/build/libsteer.so $LIB_DIR
@@ -632,16 +605,6 @@ if [ "$ENABLE_GLFW_GUI" == "true" ]; then
fi
-if [ $AntTweak_BUILD_RETURN_CODE != 0 ]; then
- echo "* AntTweakBar did not build properly."
-else
- if [ $AntTweak_INSTALL_RETURN_CODE != 0 ]; then
- echo "* AntTweakBar built successfully, but could not be installed to $LIB_DIR."
- else
- echo " AntTweakBar built and installed successfully."
- fi
-fi
-
if [ $STEERLIB_BUILD_RETURN_CODE != 0 ]; then
echo "* SteerLib did not build properly."
else
diff --git a/build/clean.sh b/build/clean.sh
index 8fa347a..446512d 100755
--- a/build/clean.sh
+++ b/build/clean.sh
@@ -99,34 +99,36 @@ fi
echo "Cleaning lib/"
if [ -d lib/ ]; then
- if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "steertool" ]]; then
+ if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "steertool" ]]; then
rm -f lib/libsteer.so
fi
- if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "util" ]]; then
+
+ if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "util" ]]; then
rm -f lib/libutil.so
fi
+
if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "steersim" ]]; then
rm -f lib/libsteersim.so
fi
+
if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "glfw" ]]; then
rm -f lib/libglfw.so
rm -f lib/libglfw.dylib
- fi
- if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "anttweakbar" ]]; then
- rm -f lib/libAntTweakBar.so
- rm -f lib/libAntTweakBar.dylib
- fi
+ fi
+
if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "pprAI" ]]; then
rm -f lib/libpprAI.so
rm -f lib/pprAI.o
fi
+
if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "rvo2dAI" ]]; then
rm -f lib/librvo2dAI.so
rm -f lib/rvo2dAI.o
fi
+
if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "sfAI" ]]; then
rm -f lib/libsfAI.so
- rm -f lib/sfAI.o
+ rm -f lib/sfAI.o
fi
rmdir lib/
fi
@@ -152,15 +154,6 @@ if [ -d modules/ ]; then
rmdir modules/
fi
-if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "anttweakbar" ]]; then
- echo "Cleaning AntTweakBar"
- pushd ../external/AntTweakBar/src > /dev/null
- $MAKE -f MakeFile.osx clean
- $MAKE clean
- popd > /dev/null
-fi
-
-
if [[ $BUILD_MODULE == "all" || $BUILD_MODULE == "glfw" ]]; then
echo "Cleaning GLFW"
pushd ../external/glfw > /dev/null
diff --git a/build/win32/steersuite.sln b/build/win32/steersuite.sln
index 3677f30..5803149 100644
--- a/build/win32/steersuite.sln
+++ b/build/win32/steersuite.sln
@@ -43,8 +43,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rvo2dAI", "..\..\rvo2AI\bui
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "..\..\util\build\win32\util.vcxproj", "{48C8DD57-0195-44A5-AB09-C2756165768A}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AntTweakBar", "..\..\external\AntTweakBar\src\AntTweakBar.vcxproj", "{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfAI", "..\..\socialForcesAI\build\win32\sfAI.vcxproj", "{F9169E40-B72E-4A09-B85C-9EE1389225E5}"
ProjectSection(ProjectDependencies) = postProject
{4559341E-D53D-45E5-A67C-43D7C5956636} = {4559341E-D53D-45E5-A67C-43D7C5956636}
diff --git a/external/AntTweakBar/.cproject b/external/AntTweakBar/.cproject
deleted file mode 100644
index 6697796..0000000
--- a/external/AntTweakBar/.cproject
+++ /dev/null
@@ -1,927 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/external/AntTweakBar/.project b/external/AntTweakBar/.project
deleted file mode 100644
index 85330b4..0000000
--- a/external/AntTweakBar/.project
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
- AntTweakBar
-
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.genmakebuilder
- clean,full,incremental,
-
-
- ?name?
-
-
-
- org.eclipse.cdt.make.core.append_environment
- true
-
-
- org.eclipse.cdt.make.core.autoBuildTarget
- all
-
-
- org.eclipse.cdt.make.core.buildArguments
-
-
-
- org.eclipse.cdt.make.core.buildCommand
- make
-
-
- org.eclipse.cdt.make.core.buildLocation
- ${workspace_loc:/AntTweakBar/Debug}
-
-
- org.eclipse.cdt.make.core.cleanBuildTarget
- clean
-
-
- org.eclipse.cdt.make.core.contents
- org.eclipse.cdt.make.core.activeConfigSettings
-
-
- org.eclipse.cdt.make.core.enableAutoBuild
- false
-
-
- org.eclipse.cdt.make.core.enableCleanBuild
- true
-
-
- org.eclipse.cdt.make.core.enableFullBuild
- true
-
-
- org.eclipse.cdt.make.core.fullBuildTarget
- all
-
-
- org.eclipse.cdt.make.core.stopOnError
- true
-
-
- org.eclipse.cdt.make.core.useDefaultBuildCmd
- true
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
- full,incremental,
-
-
-
-
-
- org.eclipse.cdt.core.cnature
- org.eclipse.cdt.core.ccnature
- org.eclipse.cdt.managedbuilder.core.managedBuildNature
- org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
-
-
diff --git a/external/AntTweakBar/AntTweakBar_Doc.url b/external/AntTweakBar/AntTweakBar_Doc.url
deleted file mode 100644
index 3c8bd45..0000000
--- a/external/AntTweakBar/AntTweakBar_Doc.url
+++ /dev/null
@@ -1,7 +0,0 @@
-[InternetShortcut]
-URL=http://anttweakbar.sourceforge.net/doc
-Modified=C043A0DCA0FFC801E7
-HotKey=0
-IDList=
-[{000214A0-0000-0000-C000-000000000046}]
-Prop3=19,2
diff --git a/external/AntTweakBar/ChangeLog.txt b/external/AntTweakBar/ChangeLog.txt
deleted file mode 100644
index e34167a..0000000
--- a/external/AntTweakBar/ChangeLog.txt
+++ /dev/null
@@ -1,226 +0,0 @@
---- AntTweakBar library change log ---
-
-* Version 1.16 (2013/03/21)
-
- - Moved AntTweakBar documentation to sourceforge, available at:
- http://anttweakbar.sourceforge.net/doc
- - AntTweakBar source code repository is now on sourceforge too at:
- http://sourceforge.net/projects/anttweakbar
- - Fixed several issues with the core profile on OSX 10.8 (Thanks to
- Christoph G., George P. and Robert H. for their help).
- - Fixed unwanted repeated key pressed (Thanks to Alec J. for the patch).
- - Added Visual Studio 2012 projects to the repository.
- - Memory representation of std::string has changed again with Visual Studio
- 2012. Handled it.
- - Modified Linux and OSX Makefiles to build also static version of the library
- in addition to dynamic library (Thanks to Luigi R.).
- - Fonts can be scaled globally through the "fontscaling" parameter, may be
- useful for high density display (Suggested by Eric RH.).
- - Fixed compilation issue with different system locale (Reported by Arnaud M.)
-
-* Version 1.15 (2012/07/22)
-
- - Added support for OpenGL Core Profile (3.2 and higher); it is enabled by
- setting the TwGraphAPI parameter of the TwInit function to TW_OPENGL_CORE
- (Thanks to Oystein E. and Arnaud M. for their contribution).
- - Added a simple example that uses OpenGL Core Profile and SDL; see
- TwGLCoreSDL.c .
- - Added helper function TwEventX11 to handle native X11 events (Thanks to
- Greg P. for the code).
- - Added builtin fixed-width font for tweak bars; it is enabled through
- the fontstyle bar parameter; it is not resizable (Thanks to Jay D. for
- the font).
- - Store and restore states of OpenGL vertex attribute arrays (Thanks to
- Jerry J. and Eduard B.).
- - Fixed memory access violation caused by the popup bar (Thanks to Matthias R.
- for reporting it).
- - Added code to overcome issue caused by the memory representation change
- of std::string that occurs between Visual Studio 2008 and 2010.
-
-* Version 1.14 (2011/03/26)
-
- - Added 64 bit version of the library.
- - Added multiple windows support (Inspired by comments and code from Evan F.
- and Ivo H.)
- - Better MacOSX support (Thanks to Alexis DH., Fabrice N., Diederick H.,
- Alec J.).
- - Improved readability of overlapped transparent bars. Content of overlapped
- regions is clipped and not drawn. This behavior can be disabled using
- the bar parameter "overlap".
- - Added support for Direct3D11 (Thanks to Jorge H., Lukasz M., Se1zen).
- - Added an example based on DirectX 11.
- - Added support for SDL 1.3 integration in addition to SDL 1.2.
- ABI modification: TwEventSDL takes SDL version as an additional parameter.
- - Added support for SFML 1.6 integration.
- - Added support for GLFW 2.7 integration in addition to GLFW 2.6. This may
- imply changing the calling convention of event callbacks. Can be done by
- defining GLFW_CDECL before including AntTweakBar.h if needed.
- - Added function TwKeyTest that checks if a key event would be processed by
- AntTweakBar but without processing it. Needed to fix bad handling report of
- WM_KEYUP and WM_KEYDOWN in TwEventWin (Thanks to Ryan DB. for reporting it).
- - Added check sign for vars of type boolean.
- - Added new bar parameter "buttonalign" to center or left-align buttons
- (Suggested by Michael R.).
- - Allowed values column width to be adjusted to fit its content. This is done
- by setting the bar parameter valueswidth=fit (Requested by Koshmaar and
- Michael R.). The user can also click in the left or right area near the
- value width slider to fit column content.
- - Added new helper function TwDefineEnumFromString to ease the defining of an
- enum through a string of comma-separated enum values (Thanks to Bruno L.
- for the suggestion and code).
- - Fixed compilation issues with gcc4 (missing includes, warnings).
- - Fixes for the fedora package maintained by Sean Middleditch.
- - Fixed rotation widget display and interaction issues when the library is
- compiled with gcc -O3 (Thanks to Ares L. for reporting this).
- - Fixed SDL key event SDLK_RETURN handling after a bar is minimized (Thanks
- to Sean M. for reporting this).
- - Fixed issue with SDL_ShowCursor (Thanks to Hugues M. for reporting it).
- - Fixed DirectX10 resource issue.
- - Store and restore GL_TEXTURE_COORD_ARRAY state (Thanks to Jerry J. for
- reporting this).
- - Fixed mouse click repetition issue with passive event loop (Thanks to
- Bruno L. for reporting it).
- - Fixed issue with mouse button event when glut windows doesn't have focus
- (Thanks to Scott J. for the fix).
- - Reset enum content each time the var parameter "enum" is set using TwDefine
- or TwSetParam (Following Carsten W. and Sulaiman remarks).
- - Fixed memory corruption when more than one std_string are defined in a
- custom struct (Thanks to Sulaiman for reporting it).
- - Fixed mouse position issue with Direct3D9 fullscreen mode in TwSimpleDX9
- (Thanks to Paolo S. for pointing this out).
- - Fixed ignored double-click in TwEvenWin (Thanks to H. Seungho for this).
-
-* Version 1.13 (2009/04/19)
-
- - Now compiles on Mac OSX (Many thanks to Evan F. for rewriting the OS
- specific code, and to Tyler S. and Konstantin L. for their feedback).
- - Added functions TwGetBarCount, TwGetBarByIndex, TwGetBarByName,
- TwRefreshBar.
- - Fixed bug related to var of type TW_TYPE_STDSTRING on Windows: Microsoft
- implementation of std::string does not have the same size in Debug and
- Release mode (hidden member added for debugging), which caused a crash when
- mixing the Release version of AntTweakBar with a program compiled in Debug
- mode (Thanks to Minh D. for reporting it).
- - Added function TwGetParam and TwSetParam to allow access to the parameters
- defining the behavior of bars and variables.
- - Changed the bar/var parameters without value (like "show"/"hide") to
- parameters with value ("visible=true or false") to be compatible with the
- new TwGetParam and TwSetParam functions (the old syntax is still kept
- for backward compatibility).
- - Arrow keys and Return key can now be used to navigate and tweak values.
- - Bars can now be moved partly outside of the window. They can still be
- constrained to be fully contained in the window by setting the parameter
- "contained=true".
- - Added another way to move a bar by pressing mouse middle button in the bar.
-
-* Version 1.12 (2008/09/27)
-
- - Added new var types TW_TYPE_QUAT* and TW_TYPE_DIR* allowing for the
- interactive tweaking of rotations (through quaternions) and 3D vectors
- (directions).
- - Better management of transparent tweak bars. New bar parameters added:
- alpha=n text=dark/light.
- - Default color scheme changed (now transparent by default). To reactivate the
- previous scheme, call TwDefine("GLOBAL colorscheme=0") before creating bars.
- - Added paramters to manage the bar behavior: resizable, movable, iconifiable,
- fontresizable, alwaystop, alwaysbottom, visible, iconified (following
- Jeppe F. B. feedback).
- - Added functions TwSetBottomBar and TwGetBottomBar.
- - The library can now be recompiled without requiring to install GLUT, GLFW
- and SDL.
- - New var parameters arrow, arrowcolor, axisx, axusy, axisz and showval added
- for quaternion and direction types.
- - Msvc specific keyword removed from PrefTimer (thanks to Tim J. for pointing
- this out).
- - Fixed bug related to popup behavior when the help bar is visible.
- - GL_TEXTURE_RECTANGLE_ARB/EXT state is now saved and restored by TwDraw
- (thanks to Cyril C. for suggesting this).
- - glBlendFunc and glBlendEquationEXT are now saved and restored by TwDraw
- (thanks to Sebastion B. for reporting the problem).
- - Fixed bug related cursor visibility state with SDL (Thanks to Jeppe F. B.
- for reporting it).
-
-* Version 1.11 (2007/12/10)
-
- - Now DirectX10 is also supported in addition to OpenGL and DirectX9.
- Initialization of AntTweakBar with DX10: TwInit(TW_DIRECT3D10, d3d10Device).
- - A new example that uses DirectX10 has been added: see TwSimpleDX10 in the
- examples directory.
- - Recap for string variables added to the doc. See
- http://anttweakbar.sourceforge.net/doc/tools:anttweakbar:varstring
- - An example that illustrates the use of the different types of string
- variables has been added. See TwString in the examples directory.
- - Added some code for multi-thread safety (thanks to Daniel 'DrUiD' B. for
- the tip).
- - Cleanup of the Help bar. Now only variables having help are displayed in
- the Help bar.
- - Function TwHandleErrors documented.
- - Separators don't require a name anymore.
- - Var parameter 'order' becomes 'colororder', and its values become 'rgba' and
- 'argb' (order=ogl and order=dx still exist but are deprecated).
- - A small icon added for variables of type bool.
- - Function TwCopyCDStringToLibrary added.
- - The keyword 'GLOBAL' has been added for TwDefine commands that don't apply
- to a specific tweak bar (suggested by Koshmaar).
- - TwEventWin32 becomes TwEventWin (a #define has been added to keep
- compatibility with previous applications).
- - TwWindowSize(0,0) now releases graphics resources allocated by AntTweakBar
- (may be useful for Direct3D applications, before resizing for instance).
- - A wrong assert removed from TwMgr.cpp (thanks to Chris W. for reporting it).
- - Some slight cosmetic changes (again).
-
-* Version 1.10 (2007/08/31)
-
- - Variable values can now also be entered and edited via keyboard input
- (implementation based on modifications made by Laury M., thank you Laury).
- - Variables of type string are now handled: 3 types of string added
- TW_TYPE_CSSTRING, TW_TYPE_CDSTRING and TW_STDSTRING.
- - Text selection and copy/paste added.
- - Position of bar icons is modifiable (cf. TwBar paramters iconPos, iconAlign
- and iconMargin).
- - Separators can be added in a bar (TwAddSeparator).
- - OpenGL: states related to 3D textures and multitexturing are now saved and
- restored by TwDraw (thanks to Dylan D. for pointing this out).
- - Selected element of a listbox now highlighted.
- - ReadOnly and ReadWrite behavior of buttons revisited.
- - Documentation improved (examples for TwType, new functions documented,...).
- - Some slight cosmetic changes.
-
-* Version 1.05 (2007/03/01)
-
- - Listbox and rotoslider buttons added.
- - Icon resources (AntTweakBar.rc) no more required for static linkage (thanks
- to Joe C. for pointing this out).
- - Fixed a rotoslider precision problem when mouse button is released.
-
-* Version 1.04 (2006/12/16)
-
- - OpenGL: Vertex buffer object state and Vertex/fragment program and object
- states are now reset and restored by TwDraw (thanks to Dylan D. and Siva K.
- for pointing this out).
- - Fixed problem that occurs when an initialized variable of type float/double
- is displayed.
-
-* Version 1.03 (2006/10/28)
-
- - Medium font antialiased.
- - Now also compiles on 64 bits x86 platform (thanks to Herling G. for this).
- - Slight changes to avoid visual 8 secure crt warnings.
- - Corrected behaviour if min/max values are not defined.
- - Modif to avoid looping to max value when reaching zero with unsigned types.
- - Min/max/step parameters for type TW_TYPE_CHAR now read ascii codes (not
- characters).
- - Added FPU precision control (because DirectX changes it).
- - Fixed problem that occurs when the lib is initialized/uninitialized more
- than once (thanks Lukasz P. for reporting it).
- - Distribution follows Savannah's recommendations.
-
-* Version 1.02 (2006/09/27)
-
- - Library sources released.
-
-* Version 1.01 (2006/09/14)
-
- - First official release.
-
-
\ No newline at end of file
diff --git a/external/AntTweakBar/Clean.bat b/external/AntTweakBar/Clean.bat
deleted file mode 100644
index 3e0196e..0000000
--- a/external/AntTweakBar/Clean.bat
+++ /dev/null
@@ -1,23 +0,0 @@
-RMDIR /S /Q src\debug32
-RMDIR /S /Q src\debug64
-RMDIR /S /Q src\release32
-RMDIR /S /Q src\release64
-RMDIR /S /Q src\ipch
-CD src
-DEL *.ncb *.aps *.o *.bak *.user *.sdf
-DEL /A:h *.suo
-CD ..
-RMDIR /S /Q lib\debug
-RMDIR /S /Q examples\debug32
-RMDIR /S /Q examples\debug64
-RMDIR /S /Q examples\tmp
-DEL lib\*.exp
-CD examples
-DEL *.ncb *.aps *.o *.bak *.user *.sdf
-DEL /A:h *.suo
-DEL /S BuildLog.htm
-CD ..
-
-PAUSE
-
-
diff --git a/external/AntTweakBar/License.txt b/external/AntTweakBar/License.txt
deleted file mode 100644
index 4f6d9ca..0000000
--- a/external/AntTweakBar/License.txt
+++ /dev/null
@@ -1,22 +0,0 @@
---- AntTweakBar license ---
-
-Copyright (C) 2005-2013 Philippe Decaudin
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the
-use of this software.
-
-Permission is granted to anyone to use this software for any purpose, including
-commercial applications, and to alter it and redistribute it freely, subject to
-the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim
-that you wrote the original software. If you use this software in a product,
-an acknowledgment in the product documentation would be appreciated but is not
-required.
-
-2. Altered source versions must be plainly marked as such, and must not be
-misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source distribution.
-
diff --git a/external/AntTweakBar/Readme.txt b/external/AntTweakBar/Readme.txt
deleted file mode 100644
index 7d555e8..0000000
--- a/external/AntTweakBar/Readme.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-AntTweakBar development library
--------------------------------
-
-
-AntTweakBar is a small and easy-to-use C/C++ library that allows programmers
-to quickly add a light and intuitive GUI into OpenGL and DirectX based
-graphic programs to interactively tweak parameters.
-
-This package includes the development version of the AntTweakBar library
-for Windows, GNU/Linux and OSX, and some program examples (sources + binaries).
-
-For installation and documentation please refer to:
-http://anttweakbar.sourceforge.net/doc
-
-
diff --git a/external/AntTweakBar/dependancies/ubuntu.txt b/external/AntTweakBar/dependancies/ubuntu.txt
deleted file mode 100644
index 8fa81e6..0000000
--- a/external/AntTweakBar/dependancies/ubuntu.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-sudo apt-get install libxrandr-dev libsdl1.2-dev libsdl1.2debian libx11-dev libxxf86vm1 libxxf86vm-dev
diff --git a/external/AntTweakBar/examples/Makefile b/external/AntTweakBar/examples/Makefile
deleted file mode 100644
index d1b648a..0000000
--- a/external/AntTweakBar/examples/Makefile
+++ /dev/null
@@ -1,105 +0,0 @@
-####### Compiler, tools and options
-
-
-#---- Release
-CXXCFG = -g -O2
-LFLAGS = -L../lib -L../../glfw/lib/x11 -L../../lib
-OUT_DIR = bin64
-#---- Debug
-# CXXCFG = -g -ggdb -D_DEBUG
-# LFLAGS = -L../lib/debug64
-# OUT_DIR = debug64
-
-
-CXX = g++
-CXXFLAGS = $(CXXCFG) -Wall -fno-strict-aliasing -fPIC -shared
-INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include
-LIBS = -L/usr/X11R6/lib -L../lib -lAntTweakBar -lGL -lGLU -LGLEW -lX11 -lXext -lXmu -lXrandr -lpthread -lm
-
-DEL_FILE = rm -f
-DEL_DIR = rmdir
-NO_STDERR = 2> /dev/null
-EXP_SH = '\#!/bin/sh'
-# EXP_PATH = 'export LD_LIBRARY_PATH=`dirname $$0`../../lib ; $$0.out'
-RPATH = -Wl,-rpath,/home/glenpb/playground/crowd-analysis/external/AntTweakBar/lib
-
-####### Files
-
-
-SRC_FILES = TwSimpleGLFW.c TwSimpleGLUT.c TwSimpleSDL.c TwAdvanced1.cpp TwString.cpp TwDualGLUT.c
-
-
-####### Build rules
-
-
-#first: depend all
-first: all
-
-all: Makefile $(SRC_FILES)
-
- @echo "===== Build TwSimpleGLUT ===="
- $(CXX) $(CXXFLAGS) $(INCPATH) -g TwSimpleGLUT.c $(LFLAGS) $(RPATH) -lglut $(LIBS) -o $(OUT_DIR)/TwSimpleGLUT.out
- @echo $(EXP_SH) > $(OUT_DIR)/TwSimpleGLUT
- @echo $(EXP_PATH) >> $(OUT_DIR)/TwSimpleGLUT
- @chmod +x $(OUT_DIR)/TwSimpleGLUT
- @echo "To execute the example, run " $(OUT_DIR)/TwSimpleGLUT
-
- @echo "===== Build TwSimpleSDL ===="
- $(CXX) $(CXXFLAGS) $(INCPATH) -g TwSimpleSDL.c $(LFLAGS) $(RPATH) -lSDL $(LIBS) -o $(OUT_DIR)/TwSimpleSDL.out
- @echo $(EXP_SH) > $(OUT_DIR)/TwSimpleSDL
- @echo $(EXP_PATH) >> $(OUT_DIR)/TwSimpleSDL
- @chmod +x $(OUT_DIR)/TwSimpleSDL
- @echo "To execute the example, run " $(OUT_DIR)/TwSimpleSDL
-
- @echo "===== Build TwSimpleGLFW ===="
- $(CXX) $(CXXFLAGS) $(INCPATH) -g TwSimpleGLFW.c $(LFLAGS) -lglfw $(LIBS) $(RPATH) -o $(OUT_DIR)/TwSimpleGLFW.out
- @echo $(EXP_SH) > $(OUT_DIR)/TwSimpleGLFW
- @echo $(EXP_PATH) >> $(OUT_DIR)/TwSimpleGLFW
- @chmod +x $(OUT_DIR)/TwSimpleGLFW
- @echo "To execute the example, run " $(OUT_DIR)/TwSimpleGLFW
-
- @echo "===== Build TwDualGLUT ===="
- $(CXX) $(CXXFLAGS) $(INCPATH) -g TwDualGLUT.c $(LFLAGS) -lglut $(LIBS) -o $(OUT_DIR)/TwDualGLUT.out
- @echo $(EXP_SH) > $(OUT_DIR)/TwDualGLUT
- @echo $(EXP_PATH) >> $(OUT_DIR)/TwDualGLUT
- @chmod +x $(OUT_DIR)/TwDualGLUT
- @echo "To execute the example, run " $(OUT_DIR)/TwDualGLUT
-
- @echo "===== Build TwAdvanced1 ===="
- $(CXX) $(CXXFLAGS) $(INCPATH) -g TwAdvanced1.cpp $(LFLAGS) -lglfw $(LIBS) -o $(OUT_DIR)/TwAdvanced1.out
- @echo $(EXP_SH) > $(OUT_DIR)/TwAdvanced1
- @echo $(EXP_PATH) >> $(OUT_DIR)/TwAdvanced1
- @chmod +x $(OUT_DIR)/TwAdvanced1
- @echo "To execute the example, run " $(OUT_DIR)/TwAdvanced1
-
- @echo "===== Build TwString ===="
- $(CXX) $(CXXFLAGS) $(INCPATH) -g TwString.cpp $(LFLAGS) -lglut $(LIBS) -o $(OUT_DIR)/TwString.out
- @echo $(EXP_SH) > $(OUT_DIR)/TwString
- @echo $(EXP_PATH) >> $(OUT_DIR)/TwString
- @chmod +x $(OUT_DIR)/TwString
- @echo "To execute the example, run " $(OUT_DIR)/TwString
-
-# append dependencies to this Makefile
-#depend:
-# @echo "===== Make dependencies ====="
-# makedepend -Y
-# makedepend -a -Y -- $(CXXFLAGS) $(INCPATH) -- $(SRC_FILES) $(NO_STDERR)
-
-
-# clean temporary files
-clean:
- @echo "===== Clean ====="
- -$(DEL_FILE) *.o
- -$(DEL_FILE) *~ core *.core *.stackdump
- -$(DEL_FILE) debug64/*
- -$(DEL_DIR) debug64
-
-
-####### DEPENDENCIES
-
-TwSimpleGLFW.o: ../include/AntTweakBar.h
-TwSimpleGLUT.o: ../include/AntTweakBar.h
-TwDualGLUT.o: ../include/AntTweakBar.h
-TwSimpleSDL.o: ../include/AntTweakBar.h
-TwAdvanced1.o: ../include/AntTweakBar.h
-TwString.o: ../include/AntTweakBar.h
diff --git a/external/AntTweakBar/examples/Makefile.osx b/external/AntTweakBar/examples/Makefile.osx
deleted file mode 100644
index 260ca6d..0000000
--- a/external/AntTweakBar/examples/Makefile.osx
+++ /dev/null
@@ -1,100 +0,0 @@
-####### Compiler, tools and options
-
-
-#---- Release
-CXXCFG = -O3
-LFLAGS = -L../lib
-OUT_DIR = bin64
-#---- Debug
-#CXXCFG = -g -D_DEBUG
-#LFLAGS = -Wl -L../lib/debug64
-#OUT_DIR = debug64
-
-
-#BASE = /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks
-CXX = g++
-CXXFLAGS = $(CXXCFG) -Wall -fno-strict-aliasing -D_MACOSX
-INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include
-#-I$(BASE)/OpenGL.framework/Headers/ -I$(BASE)/AppKit.framework/Headers/
-
-LIBS = ../lib/libAntTweakBar.dylib -lpthread -lm -framework AppKit -framework OpenGL
-
-DEL_FILE = rm -f
-DEL_DIR = rmdir
-NO_STDERR = 2> /dev/null
-EXP_PATH = 'export DYLD_LIBRARY_PATH=`dirname $$0`/../../lib ; $$0.out'
-
-
-####### Files
-
-
-SRC_FILES = TwSimpleGLUT.c TwSimpleSDL.c TwSimpleGLFW.c TwAdvanced1.cpp TwString.cpp TwDualGLUT.c TwGLCoreSDL.c
-
-
-####### Build rules
-
-
-#first: depend all
-first: all
-
-all: Makefile $(SRC_FILES)
-
- @echo "===== Build TwSimpleGLUT ===="
- $(CXX) $(CXXFLAGS) $(INCPATH) -I$(BASE)/GLUT.framework/Headers/ TwSimpleGLUT.c $(LFLAGS) $(LIBS) -framework GLUT -o $(OUT_DIR)/TwSimpleGLUT.out
- @echo $(EXP_PATH) > $(OUT_DIR)/TwSimpleGLUT
- @chmod +x $(OUT_DIR)/TwSimpleGLUT
- @echo "To execute the example, run " $(OUT_DIR)/TwSimpleGLUT
-
- @echo "===== Build TwDualGLUT ===="
- $(CXX) $(CXXFLAGS) $(INCPATH) -I$(BASE)/GLUT.framework/Headers/ TwDualGLUT.c $(LFLAGS) $(LIBS) -framework GLUT -o $(OUT_DIR)/TwDualGLUT.out
- @echo $(EXP_PATH) > $(OUT_DIR)/TwDualGLUT
- @chmod +x $(OUT_DIR)/TwDualGLUT
- @echo "To execute the example, run " $(OUT_DIR)/TwDualGLUT
-
- @echo "===== Build TwString ===="
- $(CXX) $(CXXFLAGS) $(INCPATH) -I$(BASE)/GLUT.framework/Headers/ TwString.cpp $(LFLAGS) $(LIBS) -framework GLUT -o $(OUT_DIR)/TwString.out
- @echo $(EXP_PATH) > $(OUT_DIR)/TwString
- @chmod +x $(OUT_DIR)/TwString
- @echo "To execute the example, run " $(OUT_DIR)/TwString
-
-# @echo "===== Build TwSimpleSDL ===="
-# $(CXX) $(CXXFLAGS) $(INCPATH) -I$(BASE)/SDL.framework/Headers/ TwSimpleSDL.c $(LFLAGS) -framework SDL $(LIBS) -o $(OUT_DIR)/TwSimpleSDL.out
-# @echo $(EXP_PATH) > $(OUT_DIR)/TwSimpleSDL
-# @chmod +x $(OUT_DIR)/TwSimpleSDL
-
-# @echo "===== Build TwSimpleGLFW ===="
-# $(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleGLFW.c $(LFLAGS) -lglfw -framework AGL -framework Carbon $(LIBS) -o $(OUT_DIR)/TwSimpleGLFW.out
-# @echo $(EXP_PATH) > $(OUT_DIR)/TwSimpleGLFW
-# @chmod +x $(OUT_DIR)/TwSimpleGLFW
-
-# @echo "===== Build TwAdvanced1 ===="
-# $(CXX) $(CXXFLAGS) $(INCPATH) TwAdvanced1.cpp $(LFLAGS) -lglfw -framework AGL -framework Carbon $(LIBS) -o $(OUT_DIR)/TwAdvanced1.out
-# @echo $(EXP_PATH) > $(OUT_DIR)/TwAdvanced1
-# @chmod +x $(OUT_DIR)/TwSimpleAdvanced1
-
-
-# append dependencies to this Makefile
-#depend:
-# @echo "===== Make dependencies ====="
-# makedepend -Y
-# makedepend -a -Y -- $(CXXFLAGS) $(INCPATH) -- $(SRC_FILES) $(NO_STDERR)
-
-
-# clean temporary files
-clean:
- @echo "===== Clean ====="
- -$(DEL_FILE) *.o
- -$(DEL_FILE) *~ core *.core *.stackdump
- -$(DEL_FILE) debug64/*
- -$(DEL_DIR) debug64
-
-
-####### DEPENDENCIES
-
-TwSimpleGLFW.o: ../include/AntTweakBar.h
-TwSimpleGLUT.o: ../include/AntTweakBar.h
-TwDualGLUT.o: ../include/AntTweakBar.h
-TwSimpleSDL.o: ../include/AntTweakBar.h
-TwAdvanced1.o: ../include/AntTweakBar.h
-TwString.o: ../include/AntTweakBar.h
-TwGLCoreSDL.o: ../include/AntTweakBar.h
diff --git a/external/AntTweakBar/examples/Readme.txt b/external/AntTweakBar/examples/Readme.txt
deleted file mode 100644
index 64362ef..0000000
--- a/external/AntTweakBar/examples/Readme.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Compiled versions of the examples for 32-bit and 64-bit systems can be found in
-the examples/bin32 and examples/bin64 directories.
-
-Under GNU/Linux and OSX, you may need to rebuild the library and the examples.
-To do so, under GNU/Linux, open a terminal, go in the src directory and type
-make, then go in the examples directory and type make. Under OSX do the same
-but type make -f Makefile.osx instead of make.
-
-To recompile the examples you also need the following external libraries
-(for convenience Windows versions are included in the examples directory).
-
-- GLFW : http://www.glfw.org
-
-- GLUT : http://opengl.org/resources/libraries/glut
- the windows version can be found at
- http://www.xmission.com/~nate/glut.html
-
-- SDL : http://www.libsdl.org
-
-- SFML : http://www.sfml-dev.org
-
-- DirectX SDK if you want to recompile the Windows library & DX examples
- http://msdn.microsoft.com/directx
- The path to the DirectX shader compiler fxc.exe (included in the DirectX SDK)
- must be listed in the VC++ directories.
-
diff --git a/external/AntTweakBar/examples/TwAdvanced1.cpp b/external/AntTweakBar/examples/TwAdvanced1.cpp
deleted file mode 100644
index 6d12cfb..0000000
--- a/external/AntTweakBar/examples/TwAdvanced1.cpp
+++ /dev/null
@@ -1,737 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwAdvanced1.cpp
-// @brief An example showing many features of AntTweakBar,
-// including variable accessed by callbacks and
-// the definition of a custom structure type.
-// It also uses OpenGL and GLFW windowing system
-// but could be easily adapted to other frameworks.
-//
-// AntTweakBar: http://anttweakbar.sourceforge.net/doc
-// OpenGL: http://www.opengl.org
-// GLFW: http://www.glfw.org
-//
-//
-// This example draws a simple scene that can be re-tesselated
-// interactively, and illuminated dynamically by an adjustable
-// number of moving lights.
-//
-//
-// @author Philippe Decaudin
-// @date 2006/05/20
-//
-// ---------------------------------------------------------------------------
-
-#include
-
-#define GLFW_DLL // use GLFW as a dynamically linked library
-#include "glfw.h"
-
-#include
-#include
-#include
-#include
-#if !defined(_WIN32) && !defined(_WIN64)
-# define _snprintf snprintf
-#endif
-
-const float FLOAT_2PI = 6.283185307f; // 2*PI
-
-
-// Light structure: embeds light parameters
-struct Light
-{
- bool Active; // light On or Off
- float Pos[4]; // light position (in homogeneous coordinates, ie. Pos[4]=1)
- float Color[4]; // light color (no alpha, ie. Color[4]=1)
- float Radius; // radius of the light influence area
- float Dist0, Angle0, Height0, Speed0; // light initial cylindrical coordinates and speed
- char Name[4]; // light short name (will be named "1", "2", "3",...)
- enum AnimMode { ANIM_FIXED, ANIM_BOUNCE, ANIM_ROTATE, ANIM_COMBINED };
- AnimMode Animation; // light animation mode
-};
-
-
-// Class that describes the scene and its methods
-class Scene
-{
-public:
- bool Wireframe; // draw scene in wireframe or filled
- int Subdiv; // number of subdivisions used to tessellate the scene
- int NumLights; // number of dynamic lights
- float BgColor0[3], BgColor1[3]; // top and bottom background colors
- float Ambient; // scene ambient factor
- float Reflection; // ground plane reflection factor (0=no reflection, 1=full reflection)
- double RotYAngle; // rotation angle of the scene around its Y axis (in degree)
- enum RotMode { ROT_OFF, ROT_CW, ROT_CCW };
- RotMode Rotation; // scene rotation mode (off, clockwise, counter-clockwise)
-
- Scene(); // constructor
- ~Scene(); // destructor
- void Init(bool changeLightPos); // (re)initialize the scene
- void Draw() const; // draw scene
- void Update(double time); // move lights
-
-private:
- void CreateBar(); // create a tweak bar for lights
-
- // Some drawing subroutines
- void DrawSubdivPlaneY(float xMin, float xMax, float y, float zMin, float zMax, int xSubdiv, int zSubdiv) const;
- void DrawSubdivCylinderY(float xCenter, float yBottom, float zCenter, float height, float radiusBottom, float radiusTop, int sideSubdiv, int ySubdiv) const;
- void DrawSubdivHaloZ(float x, float y, float z, float radius, int subdiv) const;
- void DrawHalos(bool reflected) const;
-
- GLuint objList, groundList, haloList; // OpenGL display list IDs
- int maxLights; // maximum number of dynamic lights allowed by the graphic card
- Light * lights; // array of lights
- TwBar * lightsBar; // pointer to the tweak bar for lights created by CreateBar()
-};
-
-
-// Constructor
-Scene::Scene()
-{
- // Set scene members.
- // The scene will be created by Scene::Init( )
- Wireframe = false;
- Subdiv = 20;
- NumLights = 0;
- BgColor0[0] = 0.9f;
- BgColor0[1] = 0.0f;
- BgColor0[2] = 0.0f;
- BgColor1[0] = 0.3f;
- BgColor1[1] = 0.0f;
- BgColor1[2] = 0.0f;
- Ambient = 0.2f;
- Reflection = 0.5f;
- RotYAngle = 0;
- Rotation = ROT_CCW;
- objList = 0;
- groundList = 0;
- haloList = 0;
- maxLights = 0;
- lights = NULL;
- lightsBar = NULL;
-}
-
-
-// Destructor
-Scene::~Scene()
-{
- // delete all lights
- if( lights )
- delete[] lights;
-}
-
-
-// Create the scene, and (re)initialize lights if changeLights is true
-void Scene::Init(bool changeLights)
-{
- // Get the max number of lights allowed by the graphic card
- glGetIntegerv(GL_MAX_LIGHTS, &maxLights);
- if( maxLights>16 )
- maxLights = 16;
-
- // Create the lights array
- if( lights==NULL && maxLights>0 )
- {
- lights = new Light[maxLights];
- NumLights = 3; // default number of lights
- if( NumLights>maxLights )
- NumLights = maxLights;
- changeLights = true; // force lights initialization
-
- // Create a tweak bar for lights
- CreateBar();
- }
-
- // (Re)initialize lights if needed (uses random values)
- if( changeLights )
- for(int i=0; ilights[i].Color[1]) ? 1.0f-lights[i].Color[1] : 1.0f-lights[i].Color[0];
- lights[i].Color[3] = 1;
- lights[i].Active = true;
- }
-
- // Initialize some OpenGL states
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_LIGHTING);
- glEnable(GL_CULL_FACE);
- glEnable(GL_NORMALIZE);
- glEnable(GL_COLOR_MATERIAL);
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
-
- // Create objects display list using the current Subdiv parameter to control the tesselation
- if( objList>0 )
- glDeleteLists(objList, 1); // delete previously created display list
- objList = glGenLists(1);
- glNewList(objList, GL_COMPILE);
- DrawSubdivCylinderY(-0.9f, 0, -0.9f, 1.4f, 0.15f, 0.12f, Subdiv/2+8, Subdiv);
- DrawSubdivCylinderY(+0.9f, 0, -0.9f, 1.4f, 0.15f, 0.12f, Subdiv/2+8, Subdiv);
- DrawSubdivCylinderY(+0.9f, 0, +0.9f, 1.4f, 0.15f, 0.12f, Subdiv/2+8, Subdiv);
- DrawSubdivCylinderY(-0.9f, 0, +0.9f, 1.4f, 0.15f, 0.12f, Subdiv/2+8, Subdiv);
- DrawSubdivCylinderY(0, 0, 0, 0.4f, 0.5f, 0.3f, Subdiv+16, Subdiv/8+1);
- DrawSubdivCylinderY(0, 0.4f, 0, 0.05f, 0.3f, 0.0f, Subdiv+16, Subdiv/16+1);
- glEndList();
-
- // Create ground display list
- if( groundList>0 )
- glDeleteLists(groundList, 1); // delete previously created display list
- groundList = glGenLists(1);
- glNewList(groundList, GL_COMPILE);
- DrawSubdivPlaneY(-1.2f, 1.2f, 0, -1.2f, 1.2f, (3*Subdiv)/2, (3*Subdiv)/2);
- glEndList();
-
- // Create display list to draw light halos
- if( haloList>0 )
- glDeleteLists(haloList, 1); // delete previously created display list
- haloList = glGenLists(1);
- glNewList(haloList, GL_COMPILE);
- DrawSubdivHaloZ(0, 0, 0, 1, 32);
- glEndList();
-}
-
-
-// Callback function associated to the 'Change lights' button of the lights tweak bar.
-void TW_CALL ReinitCB(void *clientData)
-{
- Scene *scene = static_cast(clientData); // scene pointer is stored in clientData
- scene->Init(true); // re-initialize the scene
-}
-
-
-// Create a tweak bar for lights.
-// New enum type and struct type are defined and used by this bar.
-void Scene::CreateBar()
-{
- // Create a new tweak bar and change its label, position and transparency
- lightsBar = TwNewBar("Lights");
- TwDefine(" Lights label='Lights TweakBar' position='580 16' alpha=0 help='Use this bar to edit the lights in the scene.' ");
-
- // Add a variable of type int to control the number of lights
- TwAddVarRW(lightsBar, "NumLights", TW_TYPE_INT32, &NumLights,
- " label='Number of lights' keyIncr=l keyDecr=L help='Changes the number of lights in the scene.' ");
-
- // Set the NumLights min value (=0) and max value (depends on the user graphic card)
- int zero = 0;
- TwSetParam(lightsBar, "NumLights", "min", TW_PARAM_INT32, 1, &zero);
- TwSetParam(lightsBar, "NumLights", "max", TW_PARAM_INT32, 1, &maxLights);
- // Note, TwDefine could also have been used for that pupose like this:
- // char def[256];
- // _snprintf(def, 255, "Lights/NumLights min=0 max=%d", maxLights);
- // TwDefine(def); // min and max are defined using a definition string
-
-
- // Add a button to re-initialize the lights; this button calls the ReinitCB callback function
- TwAddButton(lightsBar, "Reinit", ReinitCB, this,
- " label='Change lights' key=c help='Random changes of lights parameters.' ");
-
- // Define a new enum type for the tweak bar
- TwEnumVal modeEV[] = // array used to describe the Scene::AnimMode enum values
- {
- { Light::ANIM_FIXED, "Fixed" },
- { Light::ANIM_BOUNCE, "Bounce" },
- { Light::ANIM_ROTATE, "Rotate" },
- { Light::ANIM_COMBINED, "Combined" }
- };
- TwType modeType = TwDefineEnum("Mode", modeEV, 4); // create a new TwType associated to the enum defined by the modeEV array
-
- // Define a new struct type: light variables are embedded in this structure
- TwStructMember lightMembers[] = // array used to describe tweakable variables of the Light structure
- {
- { "Active", TW_TYPE_BOOLCPP, offsetof(Light, Active), " help='Enable/disable the light.' " }, // Light::Active is a C++ boolean value
- { "Color", TW_TYPE_COLOR4F, offsetof(Light, Color), " noalpha help='Light color.' " }, // Light::Color is represented by 4 floats, but alpha channel should be ignored
- { "Radius", TW_TYPE_FLOAT, offsetof(Light, Radius), " min=0 max=4 step=0.02 help='Light radius.' " },
- { "Animation", modeType, offsetof(Light, Animation), " help='Change the animation mode.' " }, // use the enum 'modeType' created before to tweak the Light::Animation variable
- { "Speed", TW_TYPE_FLOAT, offsetof(Light, Speed0), " readonly=true help='Light moving speed.' " } // Light::Speed is made read-only
- };
- TwType lightType = TwDefineStruct("Light", lightMembers, 5, sizeof(Light), NULL, NULL); // create a new TwType associated to the struct defined by the lightMembers array
-
- // Use the newly created 'lightType' to add variables associated with lights
- for(int i=0; i(clientData); // scene pointer is stored in clientData
- scene->Subdiv = *static_cast(value); // copy value to scene->Subdiv
- scene->Init(false); // re-init scene with the new Subdiv parameter
-}
-
-
-// Callback function called by the main tweak bar to get the 'Subdiv' value
-void TW_CALL GetSubdivCB(void *value, void *clientData)
-{
- Scene *scene = static_cast(clientData); // scene pointer is stored in clientData
- *static_cast(value) = scene->Subdiv; // copy scene->Subdiv to value
-}
-
-
-// Main function
-int main()
-{
- // Initialize GLFW
- if( !glfwInit() )
- {
- // A fatal error occurred
- std::cerr << "GLFW initialization failed" << std::endl;
- return 1;
- }
-
- // Create a window
- GLFWvidmode mode;
- glfwGetDesktopMode(&mode);
- if( !glfwOpenWindow(800, 600, mode.RedBits, mode.GreenBits, mode.BlueBits, 0, 16, 0, GLFW_WINDOW /* or GLFW_FULLSCREEN */) )
- {
- // A fatal error occurred
- std::cerr << "Cannot open GLFW window" << std::endl;
- glfwTerminate();
- return 1;
- }
- glfwSwapInterval(0);
- glfwEnable(GLFW_MOUSE_CURSOR);
- glfwEnable(GLFW_KEY_REPEAT);
- const char title[] = "AntTweakBar example: TwAdvanced1";
- glfwSetWindowTitle(title);
- // Set GLFW event callbacks
- glfwSetWindowSizeCallback(OnWindowSize);
- glfwSetMouseButtonCallback(OnMouseButton);
- glfwSetMousePosCallback(OnMousePos);
- glfwSetMouseWheelCallback(OnMouseWheel);
- glfwSetKeyCallback(OnKey);
- glfwSetCharCallback(OnChar);
-
- // Initialize AntTweakBar
- TwInit(TW_OPENGL, NULL);
- // Change the font size, and add a global message to the Help bar.
- TwDefine(" GLOBAL fontSize=3 help='This example illustrates the definition of custom structure type as well as many other features.' ");
-
- // Initialize the 3D scene
- Scene scene;
- scene.Init(true);
-
- // Create a tweak bar called 'Main' and change its refresh rate, position, size and transparency
- TwBar *mainBar = TwNewBar("Main");
- TwDefine(" Main label='Main TweakBar' refresh=0.5 position='16 16' size='260 320' alpha=0");
-
- // Add some variables to the Main tweak bar
- TwAddVarRW(mainBar, "Wireframe", TW_TYPE_BOOLCPP, &scene.Wireframe,
- " group='Display' key=w help='Toggle wireframe display mode.' "); // 'Wireframe' is put in the group 'Display' (which is then created)
- TwAddVarRW(mainBar, "BgTop", TW_TYPE_COLOR3F, &scene.BgColor1,
- " group='Background' help='Change the top background color.' "); // 'BgTop' and 'BgBottom' are put in the group 'Background' (which is then created)
- TwAddVarRW(mainBar, "BgBottom", TW_TYPE_COLOR3F, &scene.BgColor0,
- " group='Background' help='Change the bottom background color.' ");
- TwDefine(" Main/Background group='Display' "); // The group 'Background' of bar 'Main' is put in the group 'Display'
- TwAddVarCB(mainBar, "Subdiv", TW_TYPE_INT32, SetSubdivCB, GetSubdivCB, &scene,
- " group='Scene' label='Meshes subdivision' min=1 max=50 keyincr=s keyDecr=S help='Subdivide the meshes more or less (switch to wireframe to see the effect).' ");
- TwAddVarRW(mainBar, "Ambient", TW_TYPE_FLOAT, &scene.Ambient,
- " label='Ambient factor' group='Scene' min=0 max=1 step=0.001 keyIncr=a keyDecr=A help='Change scene ambient.' ");
- TwAddVarRW(mainBar, "Reflection", TW_TYPE_FLOAT, &scene.Reflection,
- " label='Reflection factor' group='Scene' min=0 max=1 step=0.001 keyIncr=r keyDecr=R help='Change ground reflection.' ");
-
- // Create a new TwType called rotationType associated with the Scene::RotMode enum, and use it
- TwEnumVal rotationEV[] = { { Scene::ROT_OFF, "Stopped"},
- { Scene::ROT_CW, "Clockwise" },
- { Scene::ROT_CCW, "Counter-clockwise" } };
- TwType rotationType = TwDefineEnum( "Rotation Mode", rotationEV, 3 );
- TwAddVarRW(mainBar, "Rotation", rotationType, &scene.Rotation,
- " group='Scene' keyIncr=Backspace keyDecr=SHIFT+Backspace help='Stop or change the rotation mode.' ");
-
- // Add a read-only float variable; its precision is 0 which means that the fractionnal part of the float value will not be displayed
- TwAddVarRO(mainBar, "RotYAngle", TW_TYPE_DOUBLE, &scene.RotYAngle,
- " group='Scene' label='Rot angle (degree)' precision=0 help='Animated rotation angle' ");
-
- // Initialize time
- double time = glfwGetTime(), dt = 0; // Current time and elapsed time
- double frameDTime = 0, frameCount = 0, fps = 0; // Framerate
-
- // Main loop (repeated while window is not closed)
- while( glfwGetWindowParam(GLFW_OPENED) )
- {
- // Get elapsed time
- dt = glfwGetTime() - time;
- if (dt < 0) dt = 0;
- time += dt;
-
- // Rotate scene
- if( scene.Rotation==Scene::ROT_CW )
- scene.RotYAngle -= 5.0*dt;
- else if( scene.Rotation==Scene::ROT_CCW )
- scene.RotYAngle += 5.0*dt;
-
- // Move lights
- scene.Update(time);
-
- // Draw scene
- scene.Draw();
-
- // Draw tweak bars
- TwDraw();
-
- // Present frame buffer
- glfwSwapBuffers();
-
- // Estimate framerate
- frameCount++;
- frameDTime += dt;
- if( frameDTime>1.0 )
- {
- fps = frameCount/frameDTime;
- char newTitle[128];
- _snprintf(newTitle, sizeof(newTitle), "%s (%.1f fps)", title, fps);
- //glfwSetWindowTitle(newTitle); // uncomment to display framerate
- frameCount = frameDTime = 0;
- }
- }
-
- // Terminate AntTweakBar and GLFW
- TwTerminate();
- glfwTerminate();
-
- return 0;
-}
diff --git a/external/AntTweakBar/examples/TwDualGLUT.c b/external/AntTweakBar/examples/TwDualGLUT.c
deleted file mode 100644
index 54ebcfb..0000000
--- a/external/AntTweakBar/examples/TwDualGLUT.c
+++ /dev/null
@@ -1,465 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwDualGLUT.c
-// @brief This example illustrates the use of AntTweakBar with multiple
-// windows. Here we are using GLUT to create a main window having
-// two sub-windows, each sub-window has a tweak bar.
-// This example extends the TwSimpleGLUT example.
-//
-// AntTweakBar: http://anttweakbar.sourceforge.net/doc
-// OpenGL: http://www.opengl.org
-// GLUT: http://opengl.org/resources/libraries/glut
-//
-// ---------------------------------------------------------------------------
-
-
-#include
-
-#include
-#include
-#include
-
-#if defined(_WIN32) || defined(_WIN64)
-// MiniGLUT.h is provided to avoid the need of having GLUT installed to
-// recompile this example. Do not use it in your own programs, better
-// install and use the actual GLUT library SDK.
-# define USE_MINI_GLUT
-#endif
-
-#if defined(USE_MINI_GLUT)
-# include "../src/MiniGLUT.h"
-#elif defined(_MACOSX)
-# include
-#else
-# include
-#endif
-
-
-// This example displays one of the following shapes in each sub-window
-typedef enum { SHAPE_TEAPOT=1, SHAPE_TORUS, SHAPE_CONE } Shape;
-#define NUM_SHAPES 3
-
-typedef struct
-{
- int WinID;
- TwBar *Bar;
- Shape ObjectShape;
- float Zoom;
- float Rotation[4];
- int AutoRotate;
- int RotateTime;
- float RotateStart[4];
- float MatAmbient[4];
- float MatDiffuse[4];
- float LightMultiplier;
- float LightDirection[3];
-} SubWindowData;
-
-SubWindowData g_SubWindowData[2];
-
-
-// Routine to set a quaternion from a rotation axis and angle
-// ( input axis = float[3] angle = float output: quat = float[4] )
-void SetQuaternionFromAxisAngle(const float *axis, float angle, float *quat)
-{
- float sina2, norm;
- sina2 = (float)sin(0.5f * angle);
- norm = (float)sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
- quat[0] = sina2 * axis[0] / norm;
- quat[1] = sina2 * axis[1] / norm;
- quat[2] = sina2 * axis[2] / norm;
- quat[3] = (float)cos(0.5f * angle);
-}
-
-
-// Routine to convert a quaternion to a 4x4 matrix
-// ( input: quat = float[4] output: mat = float[4*4] )
-void ConvertQuaternionToMatrix(const float *quat, float *mat)
-{
- float yy2 = 2.0f * quat[1] * quat[1];
- float xy2 = 2.0f * quat[0] * quat[1];
- float xz2 = 2.0f * quat[0] * quat[2];
- float yz2 = 2.0f * quat[1] * quat[2];
- float zz2 = 2.0f * quat[2] * quat[2];
- float wz2 = 2.0f * quat[3] * quat[2];
- float wy2 = 2.0f * quat[3] * quat[1];
- float wx2 = 2.0f * quat[3] * quat[0];
- float xx2 = 2.0f * quat[0] * quat[0];
- mat[0*4+0] = - yy2 - zz2 + 1.0f;
- mat[0*4+1] = xy2 + wz2;
- mat[0*4+2] = xz2 - wy2;
- mat[0*4+3] = 0;
- mat[1*4+0] = xy2 - wz2;
- mat[1*4+1] = - xx2 - zz2 + 1.0f;
- mat[1*4+2] = yz2 + wx2;
- mat[1*4+3] = 0;
- mat[2*4+0] = xz2 + wy2;
- mat[2*4+1] = yz2 - wx2;
- mat[2*4+2] = - xx2 - yy2 + 1.0f;
- mat[2*4+3] = 0;
- mat[3*4+0] = mat[3*4+1] = mat[3*4+2] = 0;
- mat[3*4+3] = 1;
-}
-
-
-// Routine to multiply 2 quaternions (ie, compose rotations)
-// ( input q1 = float[4] q2 = float[4] output: qout = float[4] )
-void MultiplyQuaternions(const float *q1, const float *q2, float *qout)
-{
- float qr[4];
- qr[0] = q1[3]*q2[0] + q1[0]*q2[3] + q1[1]*q2[2] - q1[2]*q2[1];
- qr[1] = q1[3]*q2[1] + q1[1]*q2[3] + q1[2]*q2[0] - q1[0]*q2[2];
- qr[2] = q1[3]*q2[2] + q1[2]*q2[3] + q1[0]*q2[1] - q1[1]*q2[0];
- qr[3] = q1[3]*q2[3] - (q1[0]*q2[0] + q1[1]*q2[1] + q1[2]*q2[2]);
- qout[0] = qr[0]; qout[1] = qr[1]; qout[2] = qr[2]; qout[3] = qr[3];
-}
-
-
-// Return elapsed time in milliseconds
-int GetTimeMs()
-{
-#if !defined(_WIN32)
- return glutGet(GLUT_ELAPSED_TIME);
-#else
- // glutGet(GLUT_ELAPSED_TIME) seems buggy on Windows
- return (int)GetTickCount();
-#endif
-}
-
-
-// Find the current WindowData
-SubWindowData *GetCurrentSubWindowData()
-{
- int i, currWinID;
- currWinID = glutGetWindow();
- for (i = 0; i < 2; i++)
- if (g_SubWindowData[i].WinID == currWinID)
- return &g_SubWindowData[i];
- return NULL;
-}
-
-
-// Callback function called by GLUT to render the main window content
-void DisplayMainWindow(void)
-{
- // Clear frame buffer
- glClearColor(1, 0.8f, 0.4f, 1);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- // Present frame buffer
- glutSwapBuffers();
-}
-
-
-// Callback function called by GLUT when the main window size has changed
-void ReshapeMainWindow(int width, int height)
-{
- if (width > 32 && height > 32)
- {
- glutSetWindow(g_SubWindowData[0].WinID);
- glutPositionWindow(8, 8);
- glutReshapeWindow(width/2-16, height-16);
-
- glutSetWindow(g_SubWindowData[1].WinID);
- glutPositionWindow(width/2+8, 8);
- glutReshapeWindow(width/2-16, height-16);
- }
-}
-
-
-// Callback function called by GLUT to render sub-window content
-void DisplaySubWindow(void)
-{
- float v[4]; // will be used to set light parameters
- float mat[4*4]; // rotation matrix
- SubWindowData *win;
-
- win = GetCurrentSubWindowData();
- if (win == NULL) return;
-
- // Tell AntTweakBar which is the current window
- TwSetCurrentWindow(win->WinID);
-
- // Clear frame buffer
- glClearColor(0, 0, 0, 1);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glEnable(GL_DEPTH_TEST);
- glDisable(GL_CULL_FACE);
- glEnable(GL_NORMALIZE);
-
- // Set light
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- v[0] = v[1] = v[2] = win->LightMultiplier*0.4f; v[3] = 1.0f;
- glLightfv(GL_LIGHT0, GL_AMBIENT, v);
- v[0] = v[1] = v[2] = win->LightMultiplier*0.8f; v[3] = 1.0f;
- glLightfv(GL_LIGHT0, GL_DIFFUSE, v);
- v[0] = -win->LightDirection[0]; v[1] = -win->LightDirection[1]; v[2] = -win->LightDirection[2]; v[3] = 0.0f;
- glLightfv(GL_LIGHT0, GL_POSITION, v);
-
- // Set material
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, win->MatAmbient);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, win->MatDiffuse);
-
- // Rotate and draw shape
- glPushMatrix();
- glTranslatef(0.5f, -0.3f, 0.0f);
- if( win->AutoRotate )
- {
- float axis[3] = { 0, 1, 0 };
- float angle = (float)(GetTimeMs()-win->RotateTime)/1000.0f;
- float quat[4];
- SetQuaternionFromAxisAngle(axis, angle, quat);
- MultiplyQuaternions(win->RotateStart, quat, win->Rotation);
- }
- ConvertQuaternionToMatrix(win->Rotation, mat);
- glMultMatrixf(mat);
- glScalef(win->Zoom, win->Zoom, win->Zoom);
- glCallList(win->ObjectShape);
- glPopMatrix();
-
- // Draw tweak bars
- TwDraw();
-
- // Present frame buffer
- glutSwapBuffers();
-
- // Recall Display at next frame
- glutPostRedisplay();
-}
-
-
-// Callback function called by GLUT when sub-window size has changed
-void ReshapeSubWindow(int width, int height)
-{
- SubWindowData *win;
-
- win = GetCurrentSubWindowData();
- if (win == NULL) return;
-
- // Set OpenGL viewport and camera
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(40, (double)width/height, 1, 10);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- gluLookAt(0,0,5, 0,0,0, 0,1,0);
- glTranslatef(0, 0.6f, -1);
-
- // Send the new window size to AntTweakBar
- TwSetCurrentWindow(win->WinID);
- TwWindowSize(width, height);
-}
-
-
-// Function called at exit
-void Terminate(void)
-{
- int i;
- for (i=0; i<2; i++) {
- glutSetWindow(g_SubWindowData[i].WinID);
- glDeleteLists(SHAPE_TEAPOT, NUM_SHAPES);
- }
- TwTerminate();
-}
-
-
-// Callback function called when the 'AutoRotate' variable value of the tweak bar has changed
-void TW_CALL SetAutoRotateCB(const void *value, void *clientData)
-{
- SubWindowData *win;
-
- win = (SubWindowData *)clientData;
- win->AutoRotate = *(const int *)value; // copy value to win->AutoRotate
-
- if (win->AutoRotate != 0)
- {
- // init rotation
- win->RotateTime = GetTimeMs();
- win->RotateStart[0] = win->Rotation[0];
- win->RotateStart[1] = win->Rotation[1];
- win->RotateStart[2] = win->Rotation[2];
- win->RotateStart[3] = win->Rotation[3];
- }
-
- // make Rotation variable read-only or read-write
- TwSetCurrentWindow(win->WinID);
- TwSetParam(win->Bar, "ObjRotation", "readonly", TW_PARAM_INT32, 1, &win->AutoRotate);
-}
-
-
-// Callback function called by the tweak bar to get the 'AutoRotate' value
-void TW_CALL GetAutoRotateCB(void *value, void *clientData)
-{
- SubWindowData *win;
-
- win = (SubWindowData *)clientData;
- *(int *)value = win->AutoRotate; // copy win->AutoRotate to value
-}
-
-
-// Mouse Button event callbacks
-int MouseButtonCB(int glutButton, int glutState, int mouseX, int mouseY)
-{
- TwSetCurrentWindow(glutGetWindow());
- return TwEventMouseButtonGLUT(glutButton,glutState,mouseX,mouseY);
-}
-
-
-// Mouse Motion event callbacks
-int MouseMotionCB(int mouseX, int mouseY)
-{
- TwSetCurrentWindow(glutGetWindow());
- return TwEventMouseMotionGLUT(mouseX,mouseY);
-}
-
-
-// Keyboard event callbacks
-int KeyboardCB(unsigned char glutKey, int mouseX, int mouseY)
-{
- TwSetCurrentWindow(glutGetWindow());
- return TwEventKeyboardGLUT(glutKey,mouseX,mouseY);
-}
-
-
-// Special key event callbacks
-int SpecialKeyCB(int glutKey, int mouseX, int mouseY)
-{
- TwSetCurrentWindow(glutGetWindow());
- return TwEventSpecialGLUT(glutKey,mouseX,mouseY);
-}
-
-
-// Setup new sub-window
-void SetupSubWindow(int subWinIdx)
-{
- float axis[] = { 0.7f, 0.7f, 0.0f }; // initial model rotation
- float angle = 0.8f;
- SubWindowData *win;
-
- win = &g_SubWindowData[subWinIdx];
- win->ObjectShape = (subWinIdx == 0) ? SHAPE_TEAPOT : SHAPE_TORUS;
- win->Zoom = 1;
- win->AutoRotate = (subWinIdx == 0);
- win->MatAmbient[0] = (subWinIdx == 1) ? 0.0f : 0.5f;; win->MatAmbient[1] = win->MatAmbient[2] = 0.2f; win->MatAmbient[3] = 1;
- win->MatDiffuse[0] = (subWinIdx == 1) ? 0.0f : 1.0f; win->MatDiffuse[1] = 1; win->MatDiffuse[2] = 0; win->MatDiffuse[3] = 1;
- win->LightMultiplier = 1;
- win->LightDirection[0] = win->LightDirection[1] = win->LightDirection[2] = -0.57735f;
- win->RotateTime = GetTimeMs();
- SetQuaternionFromAxisAngle(axis, angle, win->Rotation);
- SetQuaternionFromAxisAngle(axis, angle, win->RotateStart);
-
- glutSetWindow(win->WinID);
- // Set GLUT callbacks
- glutDisplayFunc(DisplaySubWindow);
- glutReshapeFunc(ReshapeSubWindow);
- // Set GLUT event callbacks
- // - Register mouse button events callback
- glutMouseFunc((GLUTmousebuttonfun)MouseButtonCB);
- // - Register mouse motion events callback
- glutMotionFunc((GLUTmousemotionfun)MouseMotionCB);
- // - Register mouse "passive" motion events (same as Motion)
- glutPassiveMotionFunc((GLUTmousemotionfun)MouseMotionCB);
- // - Register keyboard events callback
- glutKeyboardFunc((GLUTkeyboardfun)KeyboardCB);
- // - Register special key events callback
- glutSpecialFunc((GLUTspecialfun)SpecialKeyCB);
- // - Send 'glutGetModifers' function pointer to AntTweakBar;
- // required because the GLUT key event functions do not report key modifiers states.
- TwGLUTModifiersFunc(glutGetModifiers);
-
- // Create some 3D objects (stored in display lists)
- glNewList(SHAPE_TEAPOT, GL_COMPILE);
- glutSolidTeapot(1.0);
- glEndList();
- glNewList(SHAPE_TORUS, GL_COMPILE);
- glutSolidTorus(0.3, 1.0, 16, 32);
- glEndList();
- glNewList(SHAPE_CONE, GL_COMPILE);
- glutSolidCone(1.0, 1.5, 64, 4);
- glEndList();
-
- // Declare this window as current for AntTweakBar.
- // Here, this will create a new AntTweakBar context for this window,
- // which will be identified by the number WinID.
- TwSetCurrentWindow(win->WinID);
-
- // Create a tweak bar
- win->Bar = TwNewBar("TweakBar");
- TwDefine(" GLOBAL help='This example shows how to use AntTweakBar with multiple windows.' "); // Message added to the help bar.
- TwDefine(" TweakBar size='200 400' color='96 216 224' "); // change default tweak bar size and color
-
- // Add 'win->Zoom' to 'bar': this is a modifable (RW) variable of type TW_TYPE_FLOAT. Its key shortcuts are [z] and [Z].
- TwAddVarRW(win->Bar, "Zoom", TW_TYPE_FLOAT, &win->Zoom,
- " min=0.01 max=2.5 step=0.01 keyIncr=z keyDecr=Z help='Scale the object (1=original size).' ");
-
- // Add 'win->Rotation' to 'bar': this is a variable of type TW_TYPE_QUAT4F which defines the object's orientation
- TwAddVarRW(win->Bar, "ObjRotation", TW_TYPE_QUAT4F, &win->Rotation,
- " label='Object rotation' open help='Change the object orientation.' ");
-
- // Add callback to toggle auto-rotate mode (callback functions are defined above).
- TwAddVarCB(win->Bar, "AutoRotate", TW_TYPE_BOOL32, SetAutoRotateCB, GetAutoRotateCB, win,
- " label='Auto-rotate' key=space help='Toggle auto-rotate mode.' ");
-
- // Add 'win->LightMultiplier' to 'bar': this is a variable of type TW_TYPE_FLOAT. Its key shortcuts are [+] and [-].
- TwAddVarRW(win->Bar, "Multiplier", TW_TYPE_FLOAT, &win->LightMultiplier,
- " label='Light booster' min=0.1 max=4 step=0.02 keyIncr='+' keyDecr='-' help='Increase/decrease the light power.' ");
-
- // Add 'win->LightDirection' to 'bar': this is a variable of type TW_TYPE_DIR3F which defines the light direction
- TwAddVarRW(win->Bar, "LightDir", TW_TYPE_DIR3F, &win->LightDirection,
- " label='Light direction' open help='Change the light direction.' ");
-
- // Add 'win->MatAmbient' to 'bar': this is a variable of type TW_TYPE_COLOR3F (3 floats color, alpha is ignored)
- // and is inserted into a group named 'Material'.
- TwAddVarRW(win->Bar, "Ambient", TW_TYPE_COLOR3F, &win->MatAmbient, " group='Material' ");
-
- // Add 'win->MatDiffuse' to 'bar': this is a variable of type TW_TYPE_COLOR3F (3 floats color, alpha is ignored)
- // and is inserted into group 'Material'.
- TwAddVarRW(win->Bar, "Diffuse", TW_TYPE_COLOR3F, &win->MatDiffuse, " group='Material' ");
-
- // Add the enum variable 'win->ObjectShape' to 'bar'
- // (before adding an enum variable, its enum type must be declared to AntTweakBar as follow)
- {
- // ShapeEV associates Shape enum values with labels that will be displayed instead of enum values
- TwEnumVal shapeEV[NUM_SHAPES] = { {SHAPE_TEAPOT, "Teapot"}, {SHAPE_TORUS, "Torus"}, {SHAPE_CONE, "Cone"} };
- // Create a type for the enum shapeEV
- TwType shapeType = TwDefineEnum("ShapeType", shapeEV, NUM_SHAPES);
- // add 'win->CurrentShape' to 'bar': this is a variable of type ShapeType. Its key shortcuts are [<] and [>].
- TwAddVarRW(win->Bar, "Shape", shapeType, &win->ObjectShape, " keyIncr='<' keyDecr='>' help='Change object shape.' ");
- }
-}
-
-
-// Main
-int main(int argc, char *argv[])
-{
- int mainWinID;
-
- // Initialize GLUT
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
- glutInitWindowSize(960, 480);
- mainWinID = glutCreateWindow("AntTweakBar multi-window example");
- glutCreateMenu(NULL);
- glutDisplayFunc(DisplayMainWindow);
- glutReshapeFunc(ReshapeMainWindow);
-
- // Initialize AntTweakBar
- TwInit(TW_OPENGL, NULL);
-
- // Create two sub-windows
- g_SubWindowData[0].WinID = glutCreateSubWindow(mainWinID, 8, 8, 480, 464);
- SetupSubWindow(0);
- g_SubWindowData[1].WinID = glutCreateSubWindow(mainWinID, 488, 8, 464, 464);
- SetupSubWindow(1);
-
- atexit(Terminate); // Called after glutMainLoop ends
-
- // Call the GLUT main loop
- glutMainLoop();
-
- return 0;
-}
-
diff --git a/external/AntTweakBar/examples/TwGLCoreSDL.c b/external/AntTweakBar/examples/TwGLCoreSDL.c
deleted file mode 100644
index 14b2ed7..0000000
--- a/external/AntTweakBar/examples/TwGLCoreSDL.c
+++ /dev/null
@@ -1,410 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwGLCoreSDL.c
-// @brief An example that uses AntTweakBar with OpenGL Core Profile
-// and SDL 1.3.
-//
-// AntTweakBar: http://anttweakbar.sourceforge.net/doc
-// OpenGL: http://www.opengl.org
-// SDL: http://www.libsdl.org
-//
-// @author Philippe Decaudin
-//
-// ---------------------------------------------------------------------------
-
-
-#include
-
-#ifdef _WIN32
-// MiniSDL13.h is provided to avoid the need of having SDL installed to
-// recompile this example. Do not use it in your own programs, better
-// install and use the actual SDL library SDK.
-# define USE_MINI_SDL
-#endif
-
-//#define GL3_PROTOTYPES 1 ////
-//#include ////
-
-#ifdef USE_MINI_SDL
-# include "../src/MiniSDL13.h"
-#else
-# include
-#endif
-
-#include
-#include
-#include
-
-#ifdef _WIN32
-# include // required by gl.h
-#endif
-#include
-#include
-
-
-// In this example, we draw a simple rotating square using the OpenGL core profile
-// (which requires much more code than with the compatibility profile).
-// A tweak bar is created to allow the user to change the color of the
-// rectangle and see its rotation.
-
-// Part of OpenGL core interface is not directly accessible from the common
-// OpenGL header and library (at least on windows) so we have to retrieve the
-// core functions using glGetProcAddress. These functions are prefixed by
-// underscore to avoid possible confict if a modified gl.h has been installed.
-
-#ifdef _WIN32
-# define glGetProcAddress wglGetProcAddress
-#else
-# define GLX_GLXEXT_LEGACY
-# include
-# define glGetProcAddress glXGetProcAddressARB
-#endif
-#ifndef APIENTRY
-# define APIENTRY
-#endif
-typedef GLuint (APIENTRY *PFNGLCreateShader)(GLenum type);
-typedef void (APIENTRY *PFNGLDeleteShader)(GLuint shader);
-typedef void (APIENTRY *PFNGLShaderSource)(GLuint shader, GLsizei count, const char* *str, const GLint *length);
-typedef void (APIENTRY *PFNGLCompileShader)(GLuint shader);
-typedef void (APIENTRY *PFNGLAttachShader)(GLuint program, GLuint shader);
-typedef GLuint (APIENTRY *PFNGLCreateProgram)(void);
-typedef void (APIENTRY *PFNGLLinkProgram)(GLuint program);
-typedef void (APIENTRY *PFNGLUseProgram)(GLuint program);
-typedef void (APIENTRY *PFNGLDeleteProgram)(GLuint program);
-typedef void (APIENTRY *PFNGLGenBuffers)(GLsizei n, GLuint *buffers);
-typedef void (APIENTRY *PFNGLBindBuffer)(GLenum target, GLuint buffer);
-typedef void (APIENTRY *PFNGLVertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRY *PFNGLEnableVertexAttribArray)(GLuint index);
-typedef void (APIENTRY *PFNGLGenVertexArrays)(GLsizei n, GLuint *arrays);
-typedef void (APIENTRY *PFNGLBindVertexArray)(GLuint array);
-typedef void (APIENTRY *PFNGLDeleteVertexArrays)(GLsizei n, const GLuint *arrays);
-typedef GLint (APIENTRY *PFNGLGetAttribLocation)(GLuint program, const char *name);
-typedef GLint (APIENTRY *PFNGLGetUniformLocation)(GLuint program, const char *name);
-typedef void (APIENTRY *PFNGLUniform1f)(GLint location, GLfloat v0);
-typedef void (APIENTRY *PFNGLUniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRY *PFNGLBufferData)(GLenum target, ptrdiff_t size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRY *PFNGLDeleteBuffers)(GLsizei n, const GLuint *buffers);
-PFNGLCreateShader _glCreateShader;
-PFNGLDeleteShader _glDeleteShader;
-PFNGLShaderSource _glShaderSource;
-PFNGLCompileShader _glCompileShader;
-PFNGLAttachShader _glAttachShader;
-PFNGLCreateProgram _glCreateProgram;
-PFNGLLinkProgram _glLinkProgram;
-PFNGLUseProgram _glUseProgram;
-PFNGLDeleteProgram _glDeleteProgram;
-PFNGLGenBuffers _glGenBuffers;
-PFNGLBindBuffer _glBindBuffer;
-PFNGLVertexAttribPointer _glVertexAttribPointer;
-PFNGLEnableVertexAttribArray _glEnableVertexAttribArray;
-PFNGLGenVertexArrays _glGenVertexArrays;
-PFNGLBindVertexArray _glBindVertexArray;
-PFNGLDeleteVertexArrays _glDeleteVertexArrays;
-PFNGLGetAttribLocation _glGetAttribLocation;
-PFNGLGetUniformLocation _glGetUniformLocation;
-PFNGLUniform1f _glUniform1f;
-PFNGLUniform3f _glUniform3f;
-PFNGLBufferData _glBufferData;
-PFNGLDeleteBuffers _glDeleteBuffers;
-#ifndef GL_ARRAY_BUFFER
-# define GL_ARRAY_BUFFER 0x8892
-#endif
-#ifndef GL_STATIC_DRAW
-# define GL_STATIC_DRAW 0x88E4
-#endif
-#ifndef GL_VERTEX_SHADER
-# define GL_VERTEX_SHADER 0x8B31
-#endif
-#ifndef GL_FRAGMENT_SHADER
-# define GL_FRAGMENT_SHADER 0x8B30
-#endif
-
-int LoadGLCoreFunctions()
-{
- _glCreateShader = (PFNGLCreateShader)glGetProcAddress("glCreateShader");
- _glDeleteShader = (PFNGLDeleteShader)glGetProcAddress("glDeleteShader");
- _glShaderSource = (PFNGLShaderSource)glGetProcAddress("glShaderSource");
- _glCompileShader = (PFNGLCompileShader)glGetProcAddress("glCompileShader");
- _glAttachShader = (PFNGLAttachShader)glGetProcAddress("glAttachShader");
- _glCreateProgram = (PFNGLCreateProgram)glGetProcAddress("glCreateProgram");
- _glLinkProgram = (PFNGLLinkProgram)glGetProcAddress("glLinkProgram");
- _glUseProgram = (PFNGLUseProgram)glGetProcAddress("glUseProgram");
- _glDeleteProgram = (PFNGLDeleteProgram)glGetProcAddress("glDeleteProgram");
- _glGenBuffers = (PFNGLGenBuffers)glGetProcAddress("glGenBuffers");
- _glBindBuffer = (PFNGLBindBuffer)glGetProcAddress("glBindBuffer");
- _glVertexAttribPointer = (PFNGLVertexAttribPointer)glGetProcAddress("glVertexAttribPointer");
- _glEnableVertexAttribArray = (PFNGLEnableVertexAttribArray)glGetProcAddress("glEnableVertexAttribArray");
- _glGenVertexArrays = (PFNGLGenVertexArrays)glGetProcAddress("glGenVertexArrays");
- _glBindVertexArray = (PFNGLBindVertexArray)glGetProcAddress("glBindVertexArray");
- _glDeleteVertexArrays = (PFNGLDeleteVertexArrays)glGetProcAddress("glDeleteVertexArrays");
- _glGetAttribLocation = (PFNGLGetAttribLocation)glGetProcAddress("glGetAttribLocation");
- _glGetUniformLocation = (PFNGLGetUniformLocation)glGetProcAddress("glGetUniformLocation");
- _glUniform1f = (PFNGLUniform1f)glGetProcAddress("glUniform1f");
- _glUniform3f = (PFNGLUniform3f)glGetProcAddress("glUniform3f");
- _glBufferData = (PFNGLBufferData)glGetProcAddress("glBufferData");
- _glDeleteBuffers = (PFNGLDeleteBuffers)glGetProcAddress("glDeleteBuffers");
-
- if (_glCreateShader == NULL || _glDeleteShader == NULL || _glShaderSource == NULL || _glCompileShader == NULL
- || _glAttachShader == NULL || _glCreateProgram == NULL || _glLinkProgram == NULL || _glUseProgram == NULL
- || _glDeleteProgram == NULL || _glGenBuffers == NULL || _glBindBuffer == NULL || _glVertexAttribPointer == NULL
- || _glEnableVertexAttribArray == NULL || _glGenVertexArrays == NULL || _glBindVertexArray == NULL
- || _glDeleteVertexArrays == NULL || _glGetAttribLocation == NULL || _glGetUniformLocation == NULL
- || _glUniform1f == NULL || _glUniform3f == NULL || _glBufferData == NULL || _glDeleteBuffers == NULL)
- return 0;
- else
- return 1;
-}
-
-
-// Shaders globals
-GLuint vshader, fshader, program, varray, buffer;
-GLint cosa, sina, colorloc;
-float angle = 0, quat[4];
-float color[] = {0.8f, 1.0f, 0.2f};
-float FLOAT_PI = 3.14159265f;
-
-void InitRender()
-{
- // Vertex shader
- char *vsource[] = {
- "#version 150 core\n"
- "uniform float cosa, sina;"
- "in vec3 vertex;"
- "void main() { gl_Position = vec4(cosa*vertex.x-sina*vertex.y, sina*vertex.x+cosa*vertex.y, 0, 1); }"
- };
- // Fragment shader
- char *fsource[] = {
- "#version 150 core\n"
- "uniform vec3 color;"
- "out vec4 fcolor;"
- "void main() { fcolor = vec4(color, 1); }"
- };
- // Geometry vertex array
- GLfloat vertices[] = {
- -0.5f, 0.5f, 0,
- -0.5f, -0.5f, 0,
- 0.5f, 0.5f, 0,
- 0.5f, -0.5f, 0
- };
- GLint vlocation;
-
- // Compile and bind shaders
- vshader = _glCreateShader(GL_VERTEX_SHADER);
- fshader = _glCreateShader(GL_FRAGMENT_SHADER);
- program = _glCreateProgram();
- _glShaderSource(vshader, 1, vsource, NULL);
- _glShaderSource(fshader, 1, fsource, NULL);
- _glCompileShader(vshader);
- _glCompileShader(fshader);
- _glAttachShader(program, vshader);
- _glAttachShader(program, fshader);
- _glLinkProgram(program);
- _glUseProgram(program);
-
- cosa = _glGetUniformLocation(program, "cosa");
- sina = _glGetUniformLocation(program, "sina");
- colorloc = _glGetUniformLocation(program, "color");
-
- // Create and bind vertex buffer
- _glGenVertexArrays(1, &varray);
- _glBindVertexArray(varray);
- _glGenBuffers(1, &buffer);
- _glBindBuffer(GL_ARRAY_BUFFER, buffer);
- _glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
- vlocation = _glGetAttribLocation(program, "vertex");
- _glVertexAttribPointer(vlocation, 3, GL_FLOAT, GL_TRUE, 0, NULL);
- _glEnableVertexAttribArray(vlocation);
-
- // GL states
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_CULL_FACE);
-}
-
-void UninitRender()
-{
- _glDeleteProgram(program);
- _glDeleteShader(fshader);
- _glDeleteShader(vshader);
- _glDeleteBuffers(1, &buffer);
- _glDeleteVertexArrays(1, &varray);
-}
-
-void Render()
-{
- _glUniform1f(cosa, (float)cos(angle));
- _glUniform1f(sina, (float)sin(angle));
- _glUniform3f(colorloc, color[0], color[1], color[2]);
- _glBindVertexArray(varray);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-}
-
-
-TwBar *CreateTweakBar()
-{
- TwBar *bar;
-
- // Create a tweak bar
- bar = TwNewBar("TweakBar");
- TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar with SDL and OpenGL Core Profile.\n' "); // Message added to the help bar.
-
- // Add variables
- TwAddVarRW(bar, "Rotation", TW_TYPE_QUAT4F, &quat, " opened=true help='Rectangle rotation' ");
- TwAddVarRW(bar, "Color", TW_TYPE_COLOR3F, &color, " opened=true help='Rectangle color' ");
-
- return bar;
-}
-
-
-// SDL redefines main
-#ifdef main
-# undef main
-#endif
-
-int main()
-{
- const SDL_VideoInfo* video = NULL;
- int width = 480, height = 480;
- int bpp, flags;
- int quit = 0;
-
- // Initialize SDL, then get the current video mode and use it to create a SDL window.
- if (SDL_Init(SDL_INIT_VIDEO) < 0)
- {
- fprintf(stderr, "Video initialization failed: %s\n", SDL_GetError());
- SDL_Quit();
- exit(1);
- }
- video = SDL_GetVideoInfo();
- if (!video)
- {
- fprintf(stderr, "Video query failed: %s\n", SDL_GetError());
- SDL_Quit();
- exit(1);
- }
- // Request GL context to be OpenGL 3.2 Core Profile
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
- // Other GL attributes
- SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
- SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
- SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
- //SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
- bpp = video->vfmt->BitsPerPixel;
- flags = SDL_OPENGL | SDL_HWSURFACE;
- if (!SDL_SetVideoMode(width, height, bpp, flags))
- {
- fprintf(stderr, "Video mode set failed: %s\n", SDL_GetError());
- SDL_Quit();
- exit(1);
- }
- SDL_WM_SetCaption("AntTweakBar example using OpenGL Core Profile and SDL", "AntTweakBar+GLCore+SDL");
-
- // Enable SDL unicode and key-repeat
- SDL_EnableUNICODE(1);
- SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
-
- // Load some OpenGL core functions
- if (!LoadGLCoreFunctions())
- {
- fprintf(stderr, "OpenGL 3.2 not supported.\n");
- SDL_Quit();
- exit(1);
- }
-
- // Initialize AntTweakBar
- if (!TwInit(TW_OPENGL_CORE, NULL)) {
- fprintf(stderr, "AntTweakBar initialization failed: %s\n", TwGetLastError());
- SDL_Quit();
- exit(1);
- }
- // Tell the window size to AntTweakBar
- TwWindowSize(width, height);
- // Create a tweak bar
- CreateTweakBar();
-
- // Set OpenGL viewport
- glViewport(0, 0, width, height);
-
- // Prepare GL shaders and programs for drawing
- InitRender();
-
- // Main loop:
- // - Draw scene
- // - Process events
- while (!quit)
- {
- SDL_Event event;
- int handled;
- GLenum error;
-
- // Clear screen
- glClearColor(0.5f, 0.75f, 0.8f, 1);
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
-
- // Update angle and draw geometry
- angle = (float)SDL_GetTicks()/25.0f * (FLOAT_PI/180.0f);
- quat[0] = quat[1] = 0;
- quat[2] = (float)sin(angle/2.0f);
- quat[3] = (float)cos(angle/2.0f);
- Render();
-
- // Draw tweak bars
- TwDraw();
-
- // Present frame buffer
- SDL_GL_SwapBuffers();
-
- // Process incoming events
- while (SDL_PollEvent(&event))
- {
- // Send event to AntTweakBar
- handled = TwEventSDL(&event, SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
-
- // If event has not been handled by AntTweakBar, process it
- if (!handled)
- {
- switch (event.type)
- {
- case SDL_QUIT: // Window is closed
- quit = 1;
- break;
-
- case SDL_VIDEORESIZE: // Window size has changed
- // Resize SDL video mode
- width = event.resize.w;
- height = event.resize.h;
- if (!SDL_SetVideoMode(width, height, bpp, flags))
- fprintf(stderr, "WARNING: Video mode set failed: %s\n", SDL_GetError());
-
- // Resize OpenGL viewport
- glViewport(0, 0, width, height);
-
- // Restore OpenGL states
- InitRender();
-
- // TwWindowSize has been called by TwEventSDL,
- // so it is not necessary to call it again here.
-
- break;
- }
- }
- }
-
- while ((error = glGetError()) != GL_NO_ERROR)
- fprintf(stderr, "GL error detected: 0x%04X\n", error);
-
- } // End of main loop
-
- // Terminate AntTweakBar
- TwTerminate();
-
- // Delete GL shaders and buffer
- UninitRender();
-
- // Terminate SDL
- SDL_Quit();
-
- return 0;
-}
-
diff --git a/external/AntTweakBar/examples/TwSimpleDX10.cpp b/external/AntTweakBar/examples/TwSimpleDX10.cpp
deleted file mode 100644
index e8d146c..0000000
--- a/external/AntTweakBar/examples/TwSimpleDX10.cpp
+++ /dev/null
@@ -1,486 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwSimpleDX10.cpp
-// @brief A simple example that uses AntTweakBar with DirectX10.
-// This example draws a triangle and allow the user to tweak its
-// vertex positions and colors.
-//
-// AntTweakBar: http://anttweakbar.sourceforge.net/doc
-// DirectX: http://msdn.microsoft.com/directx
-//
-// @author Philippe Decaudin
-//
-// ---------------------------------------------------------------------------
-
-#include
-#include
-
-#include "d3d10vs2003.h" // workaround to include D3D10.h with VS2003
-#include
-
-
-// D3D interface pointers
-ID3D10Device * g_D3DDevice = NULL;
-IDXGISwapChain * g_SwapChain = NULL;
-DXGI_SWAP_CHAIN_DESC g_SwapChainDesc;
-ID3D10RenderTargetView *g_RenderTargetView = NULL;
-ID3D10Effect * g_Effect = NULL;
-ID3D10EffectTechnique * g_Technique = NULL;
-ID3D10InputLayout * g_VertexLayout = NULL;
-ID3D10Buffer * g_VertexBuffer = NULL;
-ID3D10BlendState * g_BlendState = NULL;
-ID3D10RasterizerState * g_RasterState = NULL;
-
-const int NB_VERTS = 3;
-
-
-// Forward declarations
-HRESULT InitDevice(HWND wnd);
-HRESULT InitScene();
-void Cleanup();
-LRESULT CALLBACK MessageProc(HWND, UINT, WPARAM, LPARAM);
-void Render();
-
-// Variables
-int g_Angle = 0;
-float g_Scale = 1;
-struct Point { float X, Y; };
-Point g_Positions[NB_VERTS] = { {0.0f, 0.5f}, {0.5f, -0.5f}, {-0.5f, -0.5f} };
-float g_Colors[NB_VERTS][4] = { {0, 1, 1, 1}, {1, 0, 1, 1}, {1, 1, 0, 1} };
-
-
-// Main
-int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int cmdShow)
-{
- // Register our window class
- WNDCLASSEX wcex = { sizeof(WNDCLASSEX), CS_HREDRAW|CS_VREDRAW, MessageProc,
- 0L, 0L, instance, NULL, NULL, NULL, NULL, L"TwDX10", NULL };
- RegisterClassEx(&wcex);
-
- // Create a window
- RECT rc = { 0, 0, 640, 480 };
- AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE);
- HWND wnd = CreateWindow(L"TwDX10", L"AntTweakBar simple example using DirectX10",
- WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
- rc.right-rc.left, rc.bottom-rc.top, NULL, NULL, instance, NULL);
- if( !wnd )
- {
- MessageBox(NULL, L"Cannot create window", L"Error", MB_OK|MB_ICONERROR);
- return 0;
- }
-
- // Initialize D3D10
- if( FAILED(InitDevice(wnd)) )
- {
- Cleanup();
- MessageBox(wnd, L"Cannot create D3D10 device", L"Error", MB_OK|MB_ICONERROR);
- return 0;
- }
-
- // Initialize the 3D scene
- if( FAILED(InitScene()) )
- {
- Cleanup();
- MessageBox(wnd, L"Scene initialization failed.", L"Error", MB_OK|MB_ICONERROR);
- return 0;
- }
-
-
- // Initialize AntTweakBar
- if( !TwInit(TW_DIRECT3D10, g_D3DDevice) )
- {
- Cleanup();
- MessageBoxA(wnd, TwGetLastError(), "AntTweakBar initialization failed", MB_OK|MB_ICONERROR);
- return 0;
- }
-
- // Create a tweak bar
- TwBar *bar = TwNewBar("TweakBar");
- TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar in a DirectX10 application.' "); // Message added to the help bar.
-
- // Add rotation and scale vars to bar
- TwAddVarRW(bar, "Rotation", TW_TYPE_INT32, &g_Angle,
- " KeyIncr=r KeyDecr=R Help='Rotates the triangle (angle in degree).' ");
- TwAddVarRW(bar, "Scale", TW_TYPE_FLOAT, &g_Scale,
- " Min=-2 Max=2 Step=0.01 KeyIncr=s KeyDecr=S Help='Scales the triangle (1=original size).' ");
-
- // Create a new TwType to edit 2D points: a struct that contains two floats
- TwStructMember pointMembers[] = {
- { "X", TW_TYPE_FLOAT, offsetof(Point, X), " Min=-1 Max=1 Step=0.01 " },
- { "Y", TW_TYPE_FLOAT, offsetof(Point, Y), " Min=-1 Max=1 Step=0.01 " } };
- TwType pointType = TwDefineStruct("POINT", pointMembers, 2, sizeof(Point), NULL, NULL);
-
- // Add color and position of the 3 vertices of the triangle
- TwAddVarRW(bar, "Color0", TW_TYPE_COLOR4F, &g_Colors[0], " Alpha HLS Group='Vertex 0' Label=Color ");
- TwAddVarRW(bar, "Pos0", pointType, &g_Positions[0], " Group='Vertex 0' Label='Position' ");
- TwAddVarRW(bar, "Color1", TW_TYPE_COLOR4F, &g_Colors[1], " Alpha HLS Group='Vertex 1' Label=Color ");
- TwAddVarRW(bar, "Pos1", pointType, &g_Positions[1], " Group='Vertex 1' Label='Position' ");
- TwAddVarRW(bar, "Color2", TW_TYPE_COLOR4F, &g_Colors[2], " Alpha HLS Group='Vertex 2' Label=Color ");
- TwAddVarRW(bar, "Pos2", pointType, &g_Positions[2], " Group='Vertex 2' Label='Position' ");
-
-
- // Show and update the window
- ShowWindow(wnd, cmdShow);
- UpdateWindow(wnd);
-
- // Main message loop.
- // Passive loop: Content is repaint only when needed.
- MSG msg = {0};
- while( GetMessage(&msg, NULL, 0, 0) > 0 )
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
- TwTerminate();
- Cleanup();
-
- return (int)msg.wParam;
-}
-
-
-// Create Direct3D device and swap chain
-HRESULT InitDevice(HWND wnd)
-{
- HRESULT hr = S_OK;
- RECT rc;
- GetClientRect(wnd, &rc);
- UINT width = rc.right - rc.left;
- UINT height = rc.bottom - rc.top;
-
- UINT createDeviceFlags = 0;
- #ifdef _DEBUG
- createDeviceFlags |= D3D10_CREATE_DEVICE_DEBUG;
- #endif
- ZeroMemory(&g_SwapChainDesc, sizeof(g_SwapChainDesc));
- g_SwapChainDesc.BufferCount = 1;
- g_SwapChainDesc.BufferDesc.Width = width;
- g_SwapChainDesc.BufferDesc.Height = height;
- g_SwapChainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
- g_SwapChainDesc.BufferDesc.RefreshRate.Numerator = 60;
- g_SwapChainDesc.BufferDesc.RefreshRate.Denominator = 1;
- g_SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
- g_SwapChainDesc.OutputWindow = wnd;
- g_SwapChainDesc.SampleDesc.Count = 1;
- g_SwapChainDesc.SampleDesc.Quality = 0;
- g_SwapChainDesc.Windowed = TRUE;
- g_SwapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
-
- // Try to create a hardware accelerated device first
- hr = D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, createDeviceFlags,
- D3D10_SDK_VERSION, &g_SwapChainDesc, &g_SwapChain, &g_D3DDevice);
- if( FAILED(hr) )
- {
- // If failed, try to create a reference device
- hr = D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, createDeviceFlags,
- D3D10_SDK_VERSION, &g_SwapChainDesc, &g_SwapChain, &g_D3DDevice);
- if( SUCCEEDED(hr) )
- MessageBox(wnd, L"No DX10 hardware acceleration found.\nSwitching to REFERENCE driver (very slow).",
- L"Warning", MB_OK|MB_ICONWARNING);
- else
- return hr;
- }
-
- // Create a render target view
- ID3D10Texture2D *buffer;
- hr = g_SwapChain->GetBuffer( 0, __uuidof( ID3D10Texture2D ), (LPVOID*)&buffer );
- if( FAILED(hr) )
- return hr;
-
- hr = g_D3DDevice->CreateRenderTargetView( buffer, NULL, &g_RenderTargetView );
- buffer->Release();
- if( FAILED(hr) )
- return hr;
-
- g_D3DDevice->OMSetRenderTargets( 1, &g_RenderTargetView, NULL );
-
- // Setup the viewport
- D3D10_VIEWPORT vp;
- vp.Width = width;
- vp.Height = height;
- vp.MinDepth = 0.0f;
- vp.MaxDepth = 1.0f;
- vp.TopLeftX = 0;
- vp.TopLeftY = 0;
- g_D3DDevice->RSSetViewports( 1, &vp );
-
- return S_OK;
-}
-
-
-// Initialize the 3D objects & effects
-HRESULT InitScene()
-{
- HRESULT hr = S_OK;
-
- // Create effect
- DWORD shaderFlags = D3D10_SHADER_ENABLE_STRICTNESS;
- #if defined( DEBUG ) || defined( _DEBUG )
- // shaderFlags |= D3D10_SHADER_DEBUG;
- #endif
-
- // DX10 requires shaders (no fixed function anymore). We will read the shaders from the following string.
- char shaderFX[] = " struct PSInput { float4 Pos : SV_POSITION; float4 Col : COLOR0; }; \n"
- " PSInput VertShad(float4 pos : POSITION, float4 col : COLOR) { \n"
- " PSInput ps; ps.Pos=pos; ps.Col=col; return ps; } \n"
- " float4 PixShad(PSInput input) : SV_Target { return input.Col; } \n"
- " technique10 Render { pass P0 { \n"
- " SetVertexShader( CompileShader( vs_4_0, VertShad() ) ); \n"
- " SetGeometryShader( NULL ); \n"
- " SetPixelShader( CompileShader( ps_4_0, PixShad() ) ); \n"
- " } }\n";
-
- ID3D10Blob *compiledFX = NULL;
- ID3D10Blob *errors = NULL;
- hr = D3D10CompileEffectFromMemory(shaderFX, strlen(shaderFX), "TestDX10",
- NULL, NULL, shaderFlags, 0, &compiledFX, &errors);
- if( FAILED(hr) )
- {
- char *errMsg = static_cast(errors->GetBufferPointer());
- errMsg[errors->GetBufferSize()-1] = '\0';
- MessageBoxA( NULL, errMsg, "Effect compilation failed", MB_OK|MB_ICONERROR );
- errors->Release();
- return hr;
- }
- hr = D3D10CreateEffectFromMemory(compiledFX->GetBufferPointer(), compiledFX->GetBufferSize(),
- 0, g_D3DDevice, NULL, &g_Effect);
- compiledFX->Release();
-
- if( FAILED( hr ) )
- {
- MessageBox( NULL, L"Effect creation failed", L"Error", MB_OK );
- return hr;
- }
-
- // Obtain the technique
- g_Technique = g_Effect->GetTechniqueByName("Render");
-
- // Define the input layout
- D3D10_INPUT_ELEMENT_DESC layout[] =
- {
- { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0 },
- { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 3*sizeof(float), D3D10_INPUT_PER_VERTEX_DATA, 0 }
- };
-
- // Create the input layout
- D3D10_PASS_DESC passDesc;
- g_Technique->GetPassByIndex(0)->GetDesc(&passDesc);
- hr = g_D3DDevice->CreateInputLayout(layout, sizeof(layout)/sizeof(layout[0]), passDesc.pIAInputSignature,
- passDesc.IAInputSignatureSize, &g_VertexLayout);
- if( FAILED( hr ) )
- return hr;
- const int VERTEX_SIZE = (3 + 4)*sizeof(float); // 3 floats for POSITION + 4 floats for COLOR
-
- // Set the input layout
- g_D3DDevice->IASetInputLayout(g_VertexLayout);
-
- // Create vertex buffer
- D3D10_BUFFER_DESC bd;
- bd.Usage = D3D10_USAGE_DYNAMIC;
- bd.ByteWidth = VERTEX_SIZE * NB_VERTS;
- bd.BindFlags = D3D10_BIND_VERTEX_BUFFER;
- bd.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE;
- bd.MiscFlags = 0;
- hr = g_D3DDevice->CreateBuffer(&bd, NULL, &g_VertexBuffer);
- if( FAILED( hr ) )
- return hr;
-
- // Set vertex buffer
- UINT stride = VERTEX_SIZE;
- UINT offset = 0;
- g_D3DDevice->IASetVertexBuffers(0, 1, &g_VertexBuffer, &stride, &offset);
-
- // Set primitive topology
- g_D3DDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
-
- // Blend state
- D3D10_BLEND_DESC bsd;
- bsd.AlphaToCoverageEnable = FALSE;
- for(int i=0; i<8; ++i)
- {
- bsd.BlendEnable[i] = TRUE;
- bsd.RenderTargetWriteMask[i] = D3D10_COLOR_WRITE_ENABLE_ALL;
- }
- bsd.SrcBlend = D3D10_BLEND_SRC_ALPHA;
- bsd.DestBlend = D3D10_BLEND_INV_SRC_ALPHA;
- bsd.BlendOp = D3D10_BLEND_OP_ADD;
- bsd.SrcBlendAlpha = D3D10_BLEND_SRC_ALPHA;
- bsd.DestBlendAlpha = D3D10_BLEND_INV_SRC_ALPHA;
- bsd.BlendOpAlpha = D3D10_BLEND_OP_ADD;
- g_D3DDevice->CreateBlendState(&bsd, &g_BlendState);
- float blendFactors[4] = { 1, 1, 1, 1 };
- g_D3DDevice->OMSetBlendState(g_BlendState, blendFactors, 0xffffffff);
-
- // Rasterizer state
- D3D10_RASTERIZER_DESC rs;
- ZeroMemory(&rs, sizeof(rs));
- rs.FillMode = D3D10_FILL_SOLID;
- rs.CullMode = D3D10_CULL_NONE;
- g_D3DDevice->CreateRasterizerState(&rs, &g_RasterState);
- g_D3DDevice->RSSetState(g_RasterState);
-
- return S_OK;
-}
-
-
-// Clean up D3D objects
-void Cleanup()
-{
- if( g_D3DDevice )
- g_D3DDevice->ClearState();
-
- if( g_BlendState )
- g_BlendState->Release();
- if( g_RasterState )
- g_RasterState->Release();
- if( g_VertexBuffer )
- g_VertexBuffer->Release();
- if( g_VertexLayout )
- g_VertexLayout->Release();
- if( g_Effect )
- g_Effect->Release();
- if( g_RenderTargetView )
- g_RenderTargetView->Release();
- if( g_SwapChain && g_SwapChainDesc.Windowed )
- g_SwapChain->Release();
- if( g_D3DDevice )
- g_D3DDevice->Release();
-}
-
-
-// Called every time the application receives a message
-LRESULT CALLBACK MessageProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- // Send event message to AntTweakBar
- if( TwEventWin(wnd, message, wParam, lParam) )
- {
- // Event has been handled by AntTweakBar.
- // Note: TwEventWin send a WM_PAINT in this case and
- // the window will be repaint next time.
- return 0;
- }
-
- switch(message)
- {
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- BeginPaint(wnd, &ps);
-
- if( g_D3DDevice )
- Render();
-
- EndPaint(wnd, &ps);
- }
- return 0;
- case WM_SIZE: // Window size has been changed
- if( g_D3DDevice ) // Resize D3D render target
- {
- // Release render target
- ID3D10RenderTargetView *nullRTV = NULL;
- g_D3DDevice->OMSetRenderTargets(1, &nullRTV, NULL);
- if( g_RenderTargetView )
- {
- g_RenderTargetView->Release();
- g_RenderTargetView = NULL;
- }
-
- if( g_SwapChain )
- {
- // Resize swap chain
- g_SwapChainDesc.BufferDesc.Width = LOWORD(lParam);
- g_SwapChainDesc.BufferDesc.Height = HIWORD(lParam);
- g_SwapChain->ResizeBuffers(g_SwapChainDesc.BufferCount, g_SwapChainDesc.BufferDesc.Width,
- g_SwapChainDesc.BufferDesc.Height, g_SwapChainDesc.BufferDesc.Format, g_SwapChainDesc.Flags);
-
- // Re-create a render target view
- ID3D10Texture2D *buffer;
- g_SwapChain->GetBuffer(0, __uuidof( ID3D10Texture2D ), (LPVOID*)&buffer);
- g_D3DDevice->CreateRenderTargetView(buffer, NULL, &g_RenderTargetView);
- buffer->Release();
- g_D3DDevice->OMSetRenderTargets(1, &g_RenderTargetView, NULL);
-
- // Setup the viewport
- D3D10_VIEWPORT vp;
- vp.Width = g_SwapChainDesc.BufferDesc.Width;
- vp.Height = g_SwapChainDesc.BufferDesc.Height;
- vp.MinDepth = 0.0f;
- vp.MaxDepth = 1.0f;
- vp.TopLeftX = 0;
- vp.TopLeftY = 0;
- g_D3DDevice->RSSetViewports(1, &vp);
- }
-
- // TwWindowSize has been called by TwEventWin32, so it is not necessary to call it again here.
- }
- return 0;
- case WM_CHAR:
- if( wParam==VK_ESCAPE )
- PostQuitMessage(0);
- return 0;
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
- default:
- return DefWindowProc(wnd, message, wParam, lParam);
- }
-}
-
-
-// Render scene
-void Render()
-{
- // Update the vertex buffer
- float a = (float)g_Angle * (3.14159265358979f/180.0f);
- float ca = cosf(a);
- float sa = sinf(a);
- float ratio = (float)g_SwapChainDesc.BufferDesc.Height/g_SwapChainDesc.BufferDesc.Width;
- float *vertices;
- g_VertexBuffer->Map(D3D10_MAP_WRITE_DISCARD, 0, (void **)&vertices);
- // Vertex 0 (3 floats for POSITION + 4 floats for COLOR)
- vertices[0*7 + 0] = g_Scale*(ca*g_Positions[0].X - sa*g_Positions[0].Y)*ratio;
- vertices[0*7 + 1] = g_Scale*(sa*g_Positions[0].X + ca*g_Positions[0].Y);
- vertices[0*7 + 2] = 0;
- vertices[0*7 + 3] = g_Colors[0][0];
- vertices[0*7 + 4] = g_Colors[0][1];
- vertices[0*7 + 5] = g_Colors[0][2];
- vertices[0*7 + 6] = g_Colors[0][3];
- // Vertex 1 (3 floats for POSITION + 4 floats for COLOR)
- vertices[1*7 + 0] = g_Scale*(ca*g_Positions[1].X - sa*g_Positions[1].Y)*ratio;
- vertices[1*7 + 1] = g_Scale*(sa*g_Positions[1].X + ca*g_Positions[1].Y);
- vertices[1*7 + 2] = 0;
- vertices[1*7 + 3] = g_Colors[1][0];
- vertices[1*7 + 4] = g_Colors[1][1];
- vertices[1*7 + 5] = g_Colors[1][2];
- vertices[1*7 + 6] = g_Colors[1][3];
- // Vertex 2 (3 floats for POSITION + 4 floats for COLOR)
- vertices[2*7 + 0] = g_Scale*(ca*g_Positions[2].X - sa*g_Positions[2].Y)*ratio;
- vertices[2*7 + 1] = g_Scale*(sa*g_Positions[2].X + ca*g_Positions[2].Y);
- vertices[2*7 + 2] = 0;
- vertices[2*7 + 3] = g_Colors[2][0];
- vertices[2*7 + 4] = g_Colors[2][1];
- vertices[2*7 + 5] = g_Colors[2][2];
- vertices[2*7 + 6] = g_Colors[2][3];
- g_VertexBuffer->Unmap();
-
- // Clear the back buffer
- float clearColor[4] = {0.125f, 0.125f, 0.3f, 1.0f};
- g_D3DDevice->ClearRenderTargetView(g_RenderTargetView, clearColor);
-
- // Render a triangle
- D3D10_TECHNIQUE_DESC techDesc;
- g_Technique->GetDesc(&techDesc);
- for( UINT p=0; pGetPassByIndex(p)->Apply(0);
- g_D3DDevice->Draw(3, 0);
- }
-
- // Draw tweak bars
- TwDraw();
-
- // Present the information rendered to the back buffer to the front buffer (the screen)
- g_SwapChain->Present(0, 0);
-}
-
-
diff --git a/external/AntTweakBar/examples/TwSimpleDX11.cpp b/external/AntTweakBar/examples/TwSimpleDX11.cpp
deleted file mode 100644
index 1829959..0000000
--- a/external/AntTweakBar/examples/TwSimpleDX11.cpp
+++ /dev/null
@@ -1,985 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwSimpleDX11.cpp
-//
-// @brief Example that uses AntTweakBar with DirectX11.
-//
-// It draws a Menger sponge, aka Sierpinski cube:
-// http://en.wikipedia.org/wiki/Menger_sponge .
-//
-// Cubes shading is augmented with some simple ambient occlusion
-// applied by subdividing each cube face into a 3x3 grid.
-// AntTweakBar is used to add some interacitve controls.
-//
-// Note that most of the code here is related to DirectX and
-// Menger sponge generation. AntTweakBar calls are localized
-// in the WinMain function.
-//
-// AntTweakBar: http://anttweakbar.sourceforge.net/doc
-// DirectX: http://msdn.microsoft.com/directx
-//
-// @author Philippe Decaudin
-//
-// ---------------------------------------------------------------------------
-
-#include
-#include
-#include
-#include
-
-#include "d3d10vs2003.h" // workaround to include D3D10.h and D3D11.h with VS2003
-#include
-
-// Shaders:
-// Vertex and pixel shaders are defined in TwSimpleDX11.hlsl and are compiled
-// in a pre-build step using the fxc.exe compiler (from the DirectX SDK Aug'09 or later).
-// Pre-build commands are:
-// fxc /T vs_4_0_level_9_1 /E MainVS /Fh $(IntDir)\TwSimpleDX11_VS.h TwSimpleDX11.hlsl
-// fxc /T ps_4_0_level_9_1 /E MainPS /Fh $(IntDir)\TwSimpleDX11_PS.h TwSimpleDX11.hlsl
-//
-#include "TwSimpleDX11_VS.h"
-#include "TwSimpleDX11_PS.h"
-
-
-// D3D objects
-ID3D11Device * g_D3DDev = NULL;
-ID3D11DeviceContext * g_D3DDevCtx = NULL;
-IDXGISwapChain * g_SwapChain = NULL;
-DXGI_SWAP_CHAIN_DESC g_SwapChainDesc;
-ID3D11RenderTargetView *g_RenderTargetView = NULL;
-ID3D11DepthStencilView *g_DepthStencilView = NULL;
-D3D11_TEXTURE2D_DESC g_DepthStencilDesc;
-ID3D11VertexShader * g_VertexShader = NULL;
-ID3D11PixelShader * g_PixelShader = NULL;
-ID3D11InputLayout * g_InputLayout = NULL;
-ID3D11Buffer * g_VertexBuffer = NULL;
-ID3D11Buffer * g_IndexBuffer = NULL;
-ID3D11BlendState * g_BlendState = NULL;
-ID3D11DepthStencilState*g_DepthStencilState = NULL;
-ID3D11RasterizerState * g_RasterState = NULL;
-ID3D11Buffer * g_ConstantBuffer = NULL;
-
-
-// Geometry data structures and objects
-struct Vector3
-{
- float v[3];
- static Vector3 ZERO;
-};
-Vector3 Vector3::ZERO = { 0, 0, 0 };
-struct Matrix4x4
-{
- float m[4][4];
- static Matrix4x4 IDENTITY;
-};
-Matrix4x4 Matrix4x4::IDENTITY = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 };
-struct Quaternion
-{
- float q[4];
- static Quaternion IDENTITY;
-};
-Quaternion Quaternion::IDENTITY = { 0, 0, 0, 1 };
-const float FLOAT_PI = 3.14159265f;
-struct Vertex
-{
- Vector3 Position;
- Vector3 Normal;
- unsigned int AmbientColor;
-};
-struct ShaderConstants
-{
- Matrix4x4 WorldViewProj;
- Matrix4x4 WorldNorm;
- Vector3 LightDir;
- float LightCoeff;
-};
-// Each cube face is split into a 3x3 grid
-const int CUBE_FACE_VERTEX_COUNT = 4 * 4; // 16 vertices per face
-const int CUBE_FACE_TRIANGLE_COUNT = 2 * 3 * 3; // 18 triangles to be drawn for each face
-// Faces color of the sponge wrt to recursion level
-const unsigned int COLORS[] = { 0xffffffff, 0xff007fff, 0xff7fff00, 0xffff007f, 0xff0000ff, 0xff00ff00, 0xffff0000 };
-
-
-// Scene globals
-Quaternion g_SpongeRotation; // model rotation, set by InitScene
-int g_SpongeLevel = 2; // number of recursions
-bool g_SpongeAO = true; // apply ambient occlusion
-unsigned int g_SpongeIndicesCount = 0; // set by BuildSponge
-Vector3 g_LightDir = {-0.5f, -0.2f, 1}; // light direction vector
-float g_CamDistance = 0.7f; // camera distance
-float g_BackgroundColor[] = {0, 0, 0.5f, 1}; // background color
-bool g_Animate = true; // enable animation
-float g_AnimationSpeed = 0.2f; // animation speed
-
-
-// Some math operators and functions.
-// They are defined here to avoid linking with D3DX.
-Vector3 operator+(const Vector3& a, const Vector3& b)
-{
- Vector3 out;
- out.v[0] = a.v[0] + b.v[0];
- out.v[1] = a.v[1] + b.v[1];
- out.v[2] = a.v[2] + b.v[2];
- return out;
-}
-
-Vector3 operator*(float s, const Vector3& a)
-{
- Vector3 out;
- out.v[0] = s * a.v[0];
- out.v[1] = s * a.v[1];
- out.v[2] = s * a.v[2];
- return out;
-}
-
-float Length(const Vector3& a)
-{
- return sqrt(a.v[0]*a.v[0] + a.v[1]*a.v[1] + a.v[2]*a.v[2]);
-}
-
-Matrix4x4 Projection(float fov, float aspectRatio, float zNear, float zFar) // Left-handed projection
-{
- Matrix4x4 out;
- float yScale = 1.0f / tan(fov / 2.0f);
- float xScale = yScale / aspectRatio;
- out.m[0][0] = xScale;
- out.m[0][1] = out.m[0][2] = out.m[0][3] = 0;
- out.m[1][1] = yScale;
- out.m[1][0] = out.m[1][2] = out.m[1][3] = 0;
- out.m[2][0] = out.m[2][1] = 0;
- out.m[2][2] = zFar / (zFar - zNear);
- out.m[2][3] = 1;
- out.m[3][0] = out.m[3][1] = out.m[3][3] = 0;
- out.m[3][2] = - zNear * zFar / (zFar - zNear);
- return out;
-}
-
-Matrix4x4 Translation(const Vector3& t)
-{
- Matrix4x4 out(Matrix4x4::IDENTITY);
- out.m[3][0] = t.v[0];
- out.m[3][1] = t.v[1];
- out.m[3][2] = t.v[2];
- return out;
-}
-
-Matrix4x4 Scale(float s)
-{
- Matrix4x4 out(Matrix4x4::IDENTITY);
- out.m[0][0] = out.m[1][1] = out.m[2][2] = s;
- return out;
-}
-
-Matrix4x4 operator*(const Matrix4x4& a, const Matrix4x4& b)
-{
- Matrix4x4 out(Matrix4x4::IDENTITY);
- int i, j;
- for (i = 0; i < 4; i++)
- for (j = 0; j < 4; j++)
- out.m[i][j] = a.m[i][0]*b.m[0][j] + a.m[i][1]*b.m[1][j] + a.m[i][2]*b.m[2][j] + a.m[i][3]*b.m[3][j];
- return out;
-}
-
-Vector3 operator*(const Vector3& p, const Matrix4x4& a)
-{
- Vector3 out;
- float rw = 1.f / (p.v[0]*a.m[0][3] + p.v[1]*a.m[1][3] + p.v[2]*a.m[2][3] + a.m[3][3]);
- out.v[0] = rw * (p.v[0]*a.m[0][0] + p.v[1]*a.m[1][0] + p.v[2]*a.m[2][0] + a.m[3][0]);
- out.v[1] = rw * (p.v[0]*a.m[0][1] + p.v[1]*a.m[1][1] + p.v[2]*a.m[2][1] + a.m[3][1]);
- out.v[2] = rw * (p.v[0]*a.m[0][2] + p.v[1]*a.m[1][2] + p.v[2]*a.m[2][2] + a.m[3][2]);
- return out;
-}
-
-Quaternion RotationFromAxisAngle(const Vector3& axis, float angle)
-{
- Quaternion out;
- float norm = Length(axis);
- float sina2 = sin(0.5f * angle);
- out.q[0] = sina2 * axis.v[0] / norm;
- out.q[1] = sina2 * axis.v[1] / norm;
- out.q[2] = sina2 * axis.v[2] / norm;
- out.q[3] = cos(0.5f * angle);
- return out;
-}
-
-void AxisAngleFromRotation(Vector3& outAxis, float& outAngle, const Quaternion& quat)
-{
- float sina2 = sqrt(quat.q[0]*quat.q[0] + quat.q[1]*quat.q[1] + quat.q[2]*quat.q[2]);
- outAngle = 2.0f * atan2(sina2, quat.q[3]);
- float r = (sina2 > 0) ? (1.0f / sina2) : 0;
- outAxis.v[0] = r * quat.q[0];
- outAxis.v[1] = r * quat.q[1];
- outAxis.v[2] = r * quat.q[2];
-}
-
-Matrix4x4 QuaternionToMatrix(const Quaternion& quat)
-{
- Matrix4x4 out;
- float yy2 = 2.0f * quat.q[1] * quat.q[1];
- float xy2 = 2.0f * quat.q[0] * quat.q[1];
- float xz2 = 2.0f * quat.q[0] * quat.q[2];
- float yz2 = 2.0f * quat.q[1] * quat.q[2];
- float zz2 = 2.0f * quat.q[2] * quat.q[2];
- float wz2 = 2.0f * quat.q[3] * quat.q[2];
- float wy2 = 2.0f * quat.q[3] * quat.q[1];
- float wx2 = 2.0f * quat.q[3] * quat.q[0];
- float xx2 = 2.0f * quat.q[0] * quat.q[0];
- out.m[0][0] = - yy2 - zz2 + 1.0f;
- out.m[0][1] = xy2 + wz2;
- out.m[0][2] = xz2 - wy2;
- out.m[0][3] = 0;
- out.m[1][0] = xy2 - wz2;
- out.m[1][1] = - xx2 - zz2 + 1.0f;
- out.m[1][2] = yz2 + wx2;
- out.m[1][3] = 0;
- out.m[2][0] = xz2 + wy2;
- out.m[2][1] = yz2 - wx2;
- out.m[2][2] = - xx2 - yy2 + 1.0f;
- out.m[2][3] = 0;
- out.m[3][0] = out.m[3][1] = out.m[3][2] = 0;
- out.m[3][3] = 1;
- return out;
-}
-
-
-// Forward declarations
-HRESULT InitDevice(HWND wnd);
-HRESULT InitScene();
-void Cleanup();
-LRESULT CALLBACK MessageProc(HWND, UINT, WPARAM, LPARAM);
-void Anim();
-void Render();
-HRESULT BuildSponge(int levelMax, bool aoEnabled);
-
-
-// Callback function called by AntTweakBar to set the sponge recursion level
-void TW_CALL SetSpongeLevelCB(const void *value, void * /*clientData*/)
-{
- g_SpongeLevel = *static_cast(value);
- BuildSponge(g_SpongeLevel, g_SpongeAO);
-}
-
-
-// Callback function called by AntTweakBar to get the sponge recursion level
-void TW_CALL GetSpongeLevelCB(void *value, void * /*clientData*/)
-{
- *static_cast(value) = g_SpongeLevel;
-}
-
-
-// Callback function called by AntTweakBar to enable/disable ambient occlusion
-void TW_CALL SetSpongeAOCB(const void *value, void * /*clientData*/)
-{
- g_SpongeAO = *static_cast(value);
- BuildSponge(g_SpongeLevel, g_SpongeAO);
-}
-
-
-// Callback function called by AntTweakBar to get ambient occlusion state
-void TW_CALL GetSpongeAOCB(void *value, void * /*clientData*/)
-{
- *static_cast(value) = g_SpongeAO;
-}
-
-
-// Main
-int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int cmdShow)
-{
- // Register our window class
- WNDCLASSEX wcex = { sizeof(WNDCLASSEX), CS_HREDRAW|CS_VREDRAW, MessageProc,
- 0L, 0L, instance, NULL, NULL, NULL, NULL, L"TwDX11", NULL };
- RegisterClassEx(&wcex);
-
- // Create a window
- RECT rc = { 0, 0, 640, 480 };
- AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE);
- HWND wnd = CreateWindow(L"TwDX11", L"AntTweakBar simple example using DirectX11",
- WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
- rc.right-rc.left, rc.bottom-rc.top, NULL, NULL, instance, NULL);
- if (!wnd)
- {
- MessageBox(NULL, L"Cannot create window", L"Error", MB_OK|MB_ICONERROR);
- return 0;
- }
- ShowWindow(wnd, cmdShow);
- UpdateWindow(wnd);
-
- // Initialize D3D11
- if (FAILED(InitDevice(wnd)))
- {
- MessageBox(wnd, L"Cannot create D3D11 device", L"Error", MB_OK|MB_ICONERROR);
- Cleanup();
- return 0;
- }
-
- // Initialize the 3D scene
- if (FAILED(InitScene()))
- {
- MessageBox(wnd, L"Scene initialization failed.", L"Error", MB_OK|MB_ICONERROR);
- Cleanup();
- return 0;
- }
-
- // Initialize AntTweakBar
- if (!TwInit(TW_DIRECT3D11, g_D3DDev))
- {
- MessageBoxA(wnd, TwGetLastError(), "AntTweakBar initialization failed", MB_OK|MB_ICONERROR);
- Cleanup();
- return 0;
- }
-
- // Create a tweak bar
- TwBar *bar = TwNewBar("TweakBar");
- TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar into a DirectX11 application.' "); // Message added to the help bar.
- int barSize[2] = {224, 320};
- TwSetParam(bar, NULL, "size", TW_PARAM_INT32, 2, barSize);
-
- // Add variables to the tweak bar
- TwAddVarCB(bar, "Level", TW_TYPE_INT32, SetSpongeLevelCB, GetSpongeLevelCB, NULL, "min=0 max=3 group=Sponge keyincr=l keydecr=L");
- TwAddVarCB(bar, "Ambient Occlusion", TW_TYPE_BOOLCPP, SetSpongeAOCB, GetSpongeAOCB, NULL, "group=Sponge key=o");
- TwAddVarRW(bar, "Rotation", TW_TYPE_QUAT4F, &g_SpongeRotation, "opened=true axisz=-z group=Sponge");
- TwAddVarRW(bar, "Animation", TW_TYPE_BOOLCPP, &g_Animate, "group=Sponge key=a");
- TwAddVarRW(bar, "Animation speed", TW_TYPE_FLOAT, &g_AnimationSpeed, "min=-10 max=10 step=0.1 group=Sponge keyincr=+ keydecr=-");
- TwAddVarRW(bar, "Light direction", TW_TYPE_DIR3F, &g_LightDir, "opened=true axisz=-z showval=false");
- TwAddVarRW(bar, "Camera distance", TW_TYPE_FLOAT, &g_CamDistance, "min=0 max=4 step=0.01 keyincr=PGUP keydecr=PGDOWN");
- TwAddVarRW(bar, "Background", TW_TYPE_COLOR4F, &g_BackgroundColor, "colormode=hls");
-
- // Main message loop
- MSG msg = {0};
- while (WM_QUIT != msg.message)
- {
- if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- else
- {
- Anim();
- Render();
- }
- }
-
- TwTerminate();
- Cleanup();
-
- return (int)msg.wParam;
-}
-
-
-// Create Direct3D device and swap chain
-HRESULT InitDevice(HWND wnd)
-{
- HRESULT hr = S_OK;
-
- // Get window size
- RECT rc;
- GetClientRect(wnd, &rc);
- UINT width = rc.right - rc.left;
- UINT height = rc.bottom - rc.top;
-
- // Create D3D11 device and swap chain
- UINT createDeviceFlags = 0;
- #ifdef _DEBUG
- createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
- #endif
- ZeroMemory(&g_SwapChainDesc, sizeof(g_SwapChainDesc));
- g_SwapChainDesc.BufferCount = 1;
- g_SwapChainDesc.BufferDesc.Width = width;
- g_SwapChainDesc.BufferDesc.Height = height;
- g_SwapChainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
- g_SwapChainDesc.BufferDesc.RefreshRate.Numerator = 0;
- g_SwapChainDesc.BufferDesc.RefreshRate.Denominator = 0;
- g_SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
- g_SwapChainDesc.OutputWindow = wnd;
- g_SwapChainDesc.SampleDesc.Count = 4;
- g_SwapChainDesc.SampleDesc.Quality = 0;
- g_SwapChainDesc.Windowed = TRUE;
- g_SwapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
- // Try to create a hardware accelerated device with multisample antialiasing first
- hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, createDeviceFlags,
- NULL, 0, D3D11_SDK_VERSION, &g_SwapChainDesc, &g_SwapChain,
- &g_D3DDev, NULL, &g_D3DDevCtx);
- if (FAILED(hr))
- {
- // If failed, try without antialiasing
- g_SwapChainDesc.SampleDesc.Count = 1;
- hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, createDeviceFlags,
- NULL, 0, D3D11_SDK_VERSION, &g_SwapChainDesc, &g_SwapChain,
- &g_D3DDev, NULL, &g_D3DDevCtx);
- if (FAILED(hr))
- {
- // If failed, try to create a reference device
- hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, createDeviceFlags,
- NULL, 0, D3D11_SDK_VERSION, &g_SwapChainDesc, &g_SwapChain,
- &g_D3DDev, NULL, &g_D3DDevCtx);
- if (SUCCEEDED(hr))
- MessageBox(wnd, L"No DX11 hardware acceleration found.\nSwitching to REFERENCE driver (very slow).",
- L"Warning", MB_OK|MB_ICONWARNING);
- else
- return hr;
- }
- }
-
- // Create a render target and depth-stencil view
- ID3D11Texture2D *backBuffer = NULL, *dsBuffer = NULL;
- hr = g_SwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&backBuffer);
- if (FAILED(hr))
- return hr;
-
- hr = g_D3DDev->CreateRenderTargetView(backBuffer, NULL, &g_RenderTargetView);
- backBuffer->Release();
- if (FAILED(hr))
- return hr;
-
- g_DepthStencilDesc.Width = width;
- g_DepthStencilDesc.Height = height;
- g_DepthStencilDesc.MipLevels = 1;
- g_DepthStencilDesc.ArraySize = 1;
- g_DepthStencilDesc.Format = DXGI_FORMAT_D16_UNORM;
- g_DepthStencilDesc.SampleDesc = g_SwapChainDesc.SampleDesc;
- g_DepthStencilDesc.Usage = D3D11_USAGE_DEFAULT;
- g_DepthStencilDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
- g_DepthStencilDesc.CPUAccessFlags = 0;
- g_DepthStencilDesc.MiscFlags = 0;
- hr = g_D3DDev->CreateTexture2D(&g_DepthStencilDesc, NULL, &dsBuffer);
- if (FAILED(hr))
- return hr;
- hr = g_D3DDev->CreateDepthStencilView(dsBuffer, NULL, &g_DepthStencilView);
- dsBuffer->Release();
- if (FAILED(hr))
- return hr;
-
- g_D3DDevCtx->OMSetRenderTargets(1, &g_RenderTargetView, g_DepthStencilView);
-
- // Setup the viewport
- D3D11_VIEWPORT vp;
- vp.Width = (float)width;
- vp.Height = (float)height;
- vp.MinDepth = 0.0f;
- vp.MaxDepth = 1.0f;
- vp.TopLeftX = 0;
- vp.TopLeftY = 0;
- g_D3DDevCtx->RSSetViewports(1, &vp);
-
- return S_OK;
-}
-
-
-// Initialize the 3D objects & shaders
-HRESULT InitScene()
-{
- HRESULT hr;
-
- // Define the input layout
- D3D11_INPUT_ELEMENT_DESC layout[] =
- {
- { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(Vertex, Position), D3D11_INPUT_PER_VERTEX_DATA, 0 },
- { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(Vertex, Normal), D3D11_INPUT_PER_VERTEX_DATA, 0 },
- { "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, offsetof(Vertex, AmbientColor), D3D11_INPUT_PER_VERTEX_DATA, 0 }
- };
- hr = g_D3DDev->CreateInputLayout(layout, sizeof(layout)/sizeof(layout[0]), g_MainVS, sizeof(g_MainVS), &g_InputLayout);
- if (FAILED(hr))
- return hr;
-
- // Set the input layout
- g_D3DDevCtx->IASetInputLayout(g_InputLayout);
-
- // Create shaders
- hr = g_D3DDev->CreateVertexShader(g_MainVS, sizeof(g_MainVS), NULL, &g_VertexShader);
- if (FAILED(hr))
- return hr;
- hr = g_D3DDev->CreatePixelShader(g_MainPS, sizeof(g_MainPS), NULL, &g_PixelShader);
- if (FAILED(hr))
- return hr;
-
- // Set shaders
- g_D3DDevCtx->VSSetShader(g_VertexShader, NULL, 0);
- g_D3DDevCtx->PSSetShader(g_PixelShader, NULL, 0);
-
- // Create vertex and index buffers
- hr = BuildSponge(g_SpongeLevel, g_SpongeAO);
- if (FAILED(hr))
- return hr;
-
- // Create constant buffer
- D3D11_BUFFER_DESC bd;
- bd.Usage = D3D11_USAGE_DYNAMIC;
- bd.ByteWidth = sizeof(ShaderConstants);
- bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
- bd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
- bd.MiscFlags = 0;
- bd.StructureByteStride = 0;
- hr = g_D3DDev->CreateBuffer(&bd, NULL, &g_ConstantBuffer);
- if (FAILED(hr))
- return hr;
-
- // Blend state
- D3D11_BLEND_DESC bsd;
- bsd.AlphaToCoverageEnable = FALSE;
- bsd.IndependentBlendEnable = FALSE;
- for (int i = 0; i < 8; i++)
- {
- bsd.RenderTarget[i].BlendEnable = TRUE;
- bsd.RenderTarget[i].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
- bsd.RenderTarget[i].SrcBlend = D3D11_BLEND_SRC_ALPHA;
- bsd.RenderTarget[i].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
- bsd.RenderTarget[i].BlendOp = D3D11_BLEND_OP_ADD;
- bsd.RenderTarget[i].SrcBlendAlpha = D3D11_BLEND_SRC_ALPHA;
- bsd.RenderTarget[i].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
- bsd.RenderTarget[i].BlendOpAlpha = D3D11_BLEND_OP_ADD;
- }
- g_D3DDev->CreateBlendState(&bsd, &g_BlendState);
- float blendFactors[4] = { 1, 1, 1, 1 };
- g_D3DDevCtx->OMSetBlendState(g_BlendState, blendFactors, 0xffffffff);
-
- // Depth-stencil state
- D3D11_DEPTH_STENCILOP_DESC od;
- od.StencilFunc = D3D11_COMPARISON_ALWAYS;
- od.StencilFailOp = D3D11_STENCIL_OP_KEEP;
- od.StencilPassOp = D3D11_STENCIL_OP_KEEP;
- od.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
- D3D11_DEPTH_STENCIL_DESC dsd;
- dsd.DepthEnable = TRUE;
- dsd.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
- dsd.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
- dsd.StencilEnable = FALSE;
- dsd.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
- dsd.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
- dsd.FrontFace = od;
- dsd.BackFace = od;
- g_D3DDev->CreateDepthStencilState(&dsd, &g_DepthStencilState);
- g_D3DDevCtx->OMSetDepthStencilState(g_DepthStencilState, 0);
-
- // Rasterizer state
- D3D11_RASTERIZER_DESC rs;
- ZeroMemory(&rs, sizeof(rs));
- rs.FillMode = D3D11_FILL_SOLID;
- rs.CullMode = D3D11_CULL_NONE;
- rs.MultisampleEnable = (g_SwapChainDesc.SampleDesc.Count > 0);
- g_D3DDev->CreateRasterizerState(&rs, &g_RasterState);
- g_D3DDevCtx->RSSetState(g_RasterState);
-
- // Init model rotation
- Vector3 axis = {-1, 1, 0};
- g_SpongeRotation = RotationFromAxisAngle(axis, FLOAT_PI/4);
-
- return S_OK;
-}
-
-
-// Clean up D3D objects
-void Cleanup()
-{
- #define RELEASE_CHECK(p) if (p) { ULONG rc = (p)->Release(); assert(rc == 0); (void)rc; (p) = NULL; }
-
- if (g_D3DDevCtx)
- g_D3DDevCtx->ClearState();
-
- RELEASE_CHECK(g_BlendState);
- RELEASE_CHECK(g_DepthStencilState);
- RELEASE_CHECK(g_RasterState);
- RELEASE_CHECK(g_VertexBuffer);
- RELEASE_CHECK(g_IndexBuffer);
- RELEASE_CHECK(g_ConstantBuffer);
- RELEASE_CHECK(g_InputLayout);
- RELEASE_CHECK(g_VertexShader);
- RELEASE_CHECK(g_PixelShader);
- RELEASE_CHECK(g_RenderTargetView);
- RELEASE_CHECK(g_DepthStencilView);
- if (g_SwapChainDesc.Windowed)
- RELEASE_CHECK(g_SwapChain);
- RELEASE_CHECK(g_D3DDevCtx);
- RELEASE_CHECK(g_D3DDev);
-}
-
-
-// Called every time the application receives a message
-LRESULT CALLBACK MessageProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- // Send event message to AntTweakBar
- if (TwEventWin(wnd, message, wParam, lParam))
- return 0; // Event has been handled by AntTweakBar
-
- switch (message)
- {
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- BeginPaint(wnd, &ps);
- EndPaint(wnd, &ps);
- return 0;
- }
- case WM_SIZE: // Window size has been changed
- if (g_D3DDev) // Resize D3D render target
- {
- // Release render target and depth-stencil view
- ID3D11RenderTargetView *nullRTV = NULL;
- g_D3DDevCtx->OMSetRenderTargets(1, &nullRTV, NULL);
- if (g_RenderTargetView)
- {
- g_RenderTargetView->Release();
- g_RenderTargetView = NULL;
- }
- if (g_DepthStencilView)
- {
- g_DepthStencilView->Release();
- g_DepthStencilView = NULL;
- }
-
- if (g_SwapChain)
- {
- // Resize swap chain
- g_SwapChainDesc.BufferDesc.Width = LOWORD(lParam);
- g_SwapChainDesc.BufferDesc.Height = HIWORD(lParam);
- g_SwapChain->ResizeBuffers(g_SwapChainDesc.BufferCount, g_SwapChainDesc.BufferDesc.Width,
- g_SwapChainDesc.BufferDesc.Height, g_SwapChainDesc.BufferDesc.Format,
- g_SwapChainDesc.Flags);
-
- // Re-create a render target and depth-stencil view
- ID3D11Texture2D *backBuffer = NULL, *dsBuffer = NULL;
- g_SwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&backBuffer);
- g_D3DDev->CreateRenderTargetView(backBuffer, NULL, &g_RenderTargetView);
- backBuffer->Release();
- g_DepthStencilDesc.Width = g_SwapChainDesc.BufferDesc.Width;
- g_DepthStencilDesc.Height = g_SwapChainDesc.BufferDesc.Height;
- g_D3DDev->CreateTexture2D(&g_DepthStencilDesc, NULL, &dsBuffer);
- g_D3DDev->CreateDepthStencilView(dsBuffer, NULL, &g_DepthStencilView);
- dsBuffer->Release();
- g_D3DDevCtx->OMSetRenderTargets(1, &g_RenderTargetView, g_DepthStencilView);
-
- // Setup the viewport
- D3D11_VIEWPORT vp;
- vp.Width = (float)g_SwapChainDesc.BufferDesc.Width;
- vp.Height = (float)g_SwapChainDesc.BufferDesc.Height;
- vp.MinDepth = 0.0f;
- vp.MaxDepth = 1.0f;
- vp.TopLeftX = 0;
- vp.TopLeftY = 0;
- g_D3DDevCtx->RSSetViewports(1, &vp);
- }
-
- // TwWindowSize has been called by TwEventWin, so it is not necessary to call it again here.
- }
- return 0;
- case WM_CHAR:
- if (wParam == VK_ESCAPE)
- PostQuitMessage(0);
- return 0;
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
- default:
- return DefWindowProc(wnd, message, wParam, lParam);
- }
-}
-
-
-// Append vertices and indices of a cube to the index and vertex buffers.
-// The cube has gradient ambient-occlusion defined per edge.
-void AppendCubeToBuffers(std::vector& vertices, std::vector& indices,
- const Matrix4x4& xform, float aoRatio, const bool aoEdges[12],
- const unsigned int faceColors[6])
-{
- unsigned int indicesOffset = (unsigned int)vertices.size();
-
- // Fill vertex buffer
-
- // Cube faces and edges numbering:
- // __________ _____6____
- // / /| /| /|
- // / 4 / |<2 10 5 9 |
- // /_________/ | /__|__2___/ 7
- // | | 1| | |___4__|__|
- // 3>| 0 | / 3 / 1 /
- // | | / | 11 | 8
- // |_________|/ |/____0___|/
- // 5^
- // Each face is split in a 3x3 grid, which gives 16 vertices per face and 3x3x2(=18) triangles per face.
- // Ambient occlusion color is set for each of these vertices wrt aoEdges flags.
-
- const float R = 0.5f; // unit cube radius
- // the 4 corner coordinates for each of the 6 faces
- const Vector3 A[6] = { {-R, -R, -R}, {+R, -R, -R}, {+R, -R, +R}, {-R, -R, +R}, {-R, +R, -R}, {-R, -R, -R} };
- const Vector3 B[6] = { {+R, -R, -R}, {+R, -R, +R}, {-R, -R, +R}, {-R, -R, -R}, {+R, +R, -R}, {+R, -R, -R} };
- const Vector3 C[6] = { {-R, +R, -R}, {+R, +R, -R}, {+R, +R, +R}, {-R, +R, +R}, {-R, +R, +R}, {-R, -R, +R} };
- const Vector3 D[6] = { {+R, +R, -R}, {+R, +R, +R}, {-R, +R, +R}, {-R, +R, -R}, {+R, +R, +R}, {+R, -R, +R} };
- // the 6 face normals
- const Vector3 N[6] = { { 0, 0, -1}, {+1, 0, 0}, { 0, 0, +1}, {-1, 0, 0}, { 0, +1, 0}, { 0, -1, 0} };
- // association between edge indices and the 6 faces
- const int E[6][4] = { {0, 1, 2, 3}, {8, 7, 9, 1}, {4, 5, 6, 7}, {11, 3, 10, 5}, {2, 9, 6, 10}, {0, 8, 4, 11} };
-
- int face, i, j;
- float u, v;
- bool ao;
- Vertex vertex;
- for (face = 0; face < 6; face++)
- for (j = 0; j < 4; j++)
- {
- v = (j == 1) ? aoRatio : ((j == 2) ? 1.0f - aoRatio : j/3);
- for (i = 0; i < 4; i++)
- {
- u = (i == 1) ? aoRatio : ((i == 2) ? 1.0f - aoRatio : i/3);
-
- vertex.Position = (1.0f - v) * ((1.0f - u) * A[face] + u * B[face])
- + v * ((1.0f - u) * C[face] + u * D[face]);
- vertex.Position = vertex.Position * xform;
-
- vertex.Normal = N[face];
-
- ao = (j == 0) && aoEdges[E[face][0]];
- ao |= (i == 3) && aoEdges[E[face][1]];
- ao |= (j == 3) && aoEdges[E[face][2]];
- ao |= (i == 0) && aoEdges[E[face][3]];
-
- #define DARKEN(r, s) ( (unsigned int)(float(r)*(s)) > 255 ? 255 : (unsigned int)(float(r)*(s)) )
- #define DARKEN_COLOR(c, s) ( 0xff000000 | (DARKEN(((c)>>16)&0xff, s)<<16) | (DARKEN(((c)>>8)&0xff, s)<<8) | DARKEN((c)&0xff, s) )
- vertex.AmbientColor = ao ? DARKEN_COLOR(faceColors[face], 0.75f) : faceColors[face];
-
- vertices.push_back(vertex);
- }
- }
-
- // Fill index buffer
-
- // 3 indices per triangle, 2*3*3 triangles per faces, 6 faces.
- // Vertex index numbering of each face:
- // 12__13__14___15
- // |'. | .'| .'|
- // 8__'9'_10'__11
- // | .'| .'| .'|
- // 4'__5'__6'__7
- // | .'| .'|'. |
- // 0'__1'__2__'3
-
- const unsigned short I[CUBE_FACE_TRIANGLE_COUNT][3] =
- {
- {0, 5, 4}, {0, 1, 5}, {1, 6, 5}, {1, 2, 6}, {3, 6, 2}, {3, 7, 6},
- {4, 9, 8}, {4, 5, 9}, {5, 10, 9}, {5, 6, 10}, {6, 11, 10}, {6, 7, 11},
- {8, 9, 12}, {9, 13, 12}, {9, 14, 13}, {9, 10, 14}, {10, 15, 14}, {10, 11, 15}
- };
- int tri;
- for (face = 0; face < 6; face++)
- for (tri = 0; tri < CUBE_FACE_TRIANGLE_COUNT; tri++)
- for (i = 0; i < 3; i++)
- indices.push_back(indicesOffset + I[tri][i] + 16*face); // 16 vertices per face
-}
-
-
-// Recursive function called to fill the vertex and index buffers with the cubes forming the Menger sponge.
-void FillSpongeBuffers(int level, int levelMax, std::vector& vertices, std::vector& indices,
- const Vector3& center, bool aoEnabled, const bool aoEdges[12], const unsigned int faceColors[6])
-{
- float scale = pow(1.0f/3.0f, level);
-
- if (level == levelMax)
- {
- float aoRatio = pow(3.0f, level) * 0.02f;
- if (aoRatio > 0.4999f)
- aoRatio = 0.4999f;
- Matrix4x4 xform = Scale(scale) * Translation(center);
- AppendCubeToBuffers(vertices, indices, xform, aoRatio, aoEdges, faceColors);
- }
- else
- {
- // Local function which applies AO in one direction
- struct Local
- {
- static void ApplyAO(int i, int j, bool& e0, bool& e1, bool& e2, bool& e3)
- {
- if (i == -1 && j == 0) e0 = e1 = true;
- if (i == +1 && j <= 0) e1 = false;
- if (i == +1 && j >= 0) e0 = false;
-
- if (i == +1 && j == 0) e2 = e3 = true;
- if (i == -1 && j <= 0) e2 = false;
- if (i == -1 && j >= 0) e3 = false;
-
- if (j == -1 && i == 0) e1 = e2 = true;
- if (j == +1 && i <= 0) e1 = false;
- if (j == +1 && i >= 0) e2 = false;
-
- if (j == +1 && i == 0) e0 = e3 = true;
- if (j == -1 && i <= 0) e0 = false;
- if (j == -1 && i >= 0) e3 = false;
- }
- };
-
- bool aoEdgesCopy[12];
- unsigned int faceColorsCopy[6];
- int i, j, k, l;
- for (i = -1; i <= 1; i++)
- for (j = -1; j <= 1; j++)
- for (k = -1; k <= 1; k++)
- if ( !( (i == 0 && j == 0) || (i == 0 && k == 0) || (j == 0 && k == 0) ) )
- {
- float s = 1.0f/3.0f * scale;
- Vector3 t = { center.v[0] + s * i, center.v[1] + s * j, center.v[2] + s * k };
-
- for (l = 0; l < 12; l++)
- aoEdgesCopy[l] = aoEdges[l];
- if (aoEnabled)
- {
- Local::ApplyAO( i, j, aoEdgesCopy[8], aoEdgesCopy[9], aoEdgesCopy[10], aoEdgesCopy[11]); // z direction
- Local::ApplyAO( i, k, aoEdgesCopy[1], aoEdgesCopy[7], aoEdgesCopy[5], aoEdgesCopy[3] ); // y direction
- Local::ApplyAO(-k, j, aoEdgesCopy[0], aoEdgesCopy[2], aoEdgesCopy[6], aoEdgesCopy[4] ); // x direction
- }
-
- for (l = 0; l < 6; l++)
- faceColorsCopy[l] = faceColors[l];
- if (k == +1) faceColorsCopy[0] = COLORS[level+1];
- if (i == -1) faceColorsCopy[1] = COLORS[level+1];
- if (k == -1) faceColorsCopy[2] = COLORS[level+1];
- if (i == +1) faceColorsCopy[3] = COLORS[level+1];
- if (j == -1) faceColorsCopy[4] = COLORS[level+1];
- if (j == +1) faceColorsCopy[5] = COLORS[level+1];
-
- FillSpongeBuffers(level + 1, levelMax, vertices, indices, t, aoEnabled, aoEdgesCopy, faceColorsCopy);
- }
- }
-}
-
-
-// Build sponge vertex and index buffers
-HRESULT BuildSponge(int levelMax, bool aoEnabled)
-{
- if (g_VertexBuffer)
- g_VertexBuffer->Release();
- if (g_IndexBuffer)
- g_IndexBuffer->Release();
- g_SpongeIndicesCount = 0;
-
- // Fill vertex and index memory buffers
- static std::vector vertices;
- static std::vector indices;
- vertices.clear();
- indices.clear();
- bool aoEdges[12] = { false, false, false, false, false, false, false, false, false, false, false, false };
- unsigned int faceColors[6] = { COLORS[0], COLORS[0], COLORS[0], COLORS[0], COLORS[0], COLORS[0] };
- FillSpongeBuffers(0, levelMax, vertices, indices, Vector3::ZERO, aoEnabled, aoEdges, faceColors);
-
- // Create vertex buffer
- D3D11_BUFFER_DESC bd;
- bd.Usage = D3D11_USAGE_IMMUTABLE;
- bd.ByteWidth = (UINT)vertices.size() * sizeof(Vertex);
- bd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
- bd.CPUAccessFlags = 0;
- bd.MiscFlags = 0;
- bd.StructureByteStride = 0;
- D3D11_SUBRESOURCE_DATA initData;
- initData.pSysMem = &vertices[0];
- initData.SysMemPitch = 0;
- initData.SysMemSlicePitch = 0;
- HRESULT hr = g_D3DDev->CreateBuffer(&bd, &initData, &g_VertexBuffer);
- if (FAILED(hr))
- return hr;
-
- // Create index buffer
- bd.ByteWidth = (UINT)indices.size() * sizeof(unsigned int);
- bd.BindFlags = D3D11_BIND_INDEX_BUFFER;
- initData.pSysMem = &indices[0];
- hr = g_D3DDev->CreateBuffer(&bd, &initData, &g_IndexBuffer);
- if (FAILED(hr))
- {
- g_VertexBuffer->Release();
- return hr;
- }
-
- g_SpongeIndicesCount = (unsigned int)indices.size();
- return S_OK;
-}
-
-
-// Render the sponge
-void DrawSponge()
-{
- if (g_SpongeIndicesCount == 0)
- return;
-
- // Set vertex buffer
- UINT stride = sizeof(Vertex);
- UINT offset = 0;
- g_D3DDevCtx->IASetVertexBuffers(0, 1, &g_VertexBuffer, &stride, &offset);
-
- // Set index buffer
- g_D3DDevCtx->IASetIndexBuffer(g_IndexBuffer, DXGI_FORMAT_R32_UINT, 0);
-
- // Set primitive topology
- g_D3DDevCtx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
-
- // Set shaders
- g_D3DDevCtx->VSSetShader(g_VertexShader, NULL, 0);
- g_D3DDevCtx->PSSetShader(g_PixelShader, NULL, 0);
-
- // Render the primitives
- g_D3DDevCtx->DrawIndexed(g_SpongeIndicesCount, 0, 0);
-}
-
-
-// Copy world/view/proj matrices and light parameters to shader constants
-void SetShaderConstants(const Matrix4x4& world, const Matrix4x4& view, const Matrix4x4& proj)
-{
- D3D11_MAPPED_SUBRESOURCE mappedResource;
- HRESULT hr = g_D3DDevCtx->Map(g_ConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
- if (SUCCEEDED(hr))
- {
- ShaderConstants *cst = (ShaderConstants *)mappedResource.pData;
- cst->WorldViewProj = world * view * proj;
- cst->WorldNorm = world;
- cst->LightDir = (1.0f / Length(g_LightDir)) * g_LightDir;
- cst->LightCoeff = 0.85f;
- g_D3DDevCtx->Unmap(g_ConstantBuffer, 0);
- }
- g_D3DDevCtx->VSSetConstantBuffers(0, 1, &g_ConstantBuffer);
-}
-
-
-// Render a frame
-void Render()
-{
- // Clear the back buffer
- g_D3DDevCtx->ClearRenderTargetView(g_RenderTargetView, g_BackgroundColor);
- g_D3DDevCtx->ClearDepthStencilView(g_DepthStencilView, D3D11_CLEAR_DEPTH, 1, 0);
-
- // Set world/view/proj matrices and global shader constants
- float aspectRatio = (float)g_DepthStencilDesc.Width / g_DepthStencilDesc.Height;
- Matrix4x4 proj = Projection(FLOAT_PI/4, aspectRatio, 0.1f, 100.0f);
- float dist = g_CamDistance + 0.4f;
- Vector3 camPosInv = { dist * 0.3f, dist * 0.0f, dist * 2.0f };
- Matrix4x4 view = Translation(camPosInv);
- Matrix4x4 world = QuaternionToMatrix(g_SpongeRotation);
- SetShaderConstants(world, view, proj);
-
- // Draw the sponge
- DrawSponge();
-
- // Draw tweak bars
- TwDraw();
-
- // Present the information rendered in the back buffer to the front buffer (the screen)
- g_SwapChain->Present(0, 0);
-}
-
-
-// Rotating sponge
-void Anim()
-{
- static DWORD s_PrevTick = GetTickCount();
- DWORD tick = GetTickCount(); // msec
- float dt = float(tick - s_PrevTick) / 1000.0f; // sec
- if (g_Animate && dt > 0 && dt < 0.2f)
- {
- Vector3 axis = Vector3::ZERO;
- float angle = 0;
- AxisAngleFromRotation(axis, angle, g_SpongeRotation);
- if (Length(axis) < 1.0e-6f)
- axis.v[1] = 1;
- angle += g_AnimationSpeed * dt;
- if (angle >= 2.0f*FLOAT_PI)
- angle -= 2.0f*FLOAT_PI;
- else if (angle <= 0)
- angle += 2.0f*FLOAT_PI;
- g_SpongeRotation = RotationFromAxisAngle(axis, angle);
- }
- s_PrevTick = tick;
-}
\ No newline at end of file
diff --git a/external/AntTweakBar/examples/TwSimpleDX9.cpp b/external/AntTweakBar/examples/TwSimpleDX9.cpp
deleted file mode 100644
index 9443ece..0000000
--- a/external/AntTweakBar/examples/TwSimpleDX9.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwSimpleDX9.cpp
-// @brief A simple example that uses AntTweakBar with DirectX9
-//
-// AntTweakBar: http://anttweakbar.sourceforge.net/doc
-// DirectX: http://msdn.microsoft.com/directx
-//
-// @author Philippe Decaudin
-// @date 2006/05/20
-//
-// ---------------------------------------------------------------------------
-
-
-#include
-
-#include
-//#include
-
-#include
-
-
-// Direct3D structures
-IDirect3D9 * g_D3D = NULL;
-IDirect3DDevice9 * g_D3DDev = NULL;
-D3DPRESENT_PARAMETERS g_D3Dpp;
-
-
-// D3D states initialization function
-void InitD3D()
-{
- // Set viewport
- D3DVIEWPORT9 vp = {0,0, g_D3Dpp.BackBufferWidth,g_D3Dpp.BackBufferHeight, 0,1};
- g_D3DDev->SetViewport(&vp);
-
- // Set D3D matrices
- D3DMATRIX matId = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };
- g_D3DDev->SetTransform(D3DTS_WORLD, &matId);
- g_D3DDev->SetTransform(D3DTS_VIEW, &matId);
- D3DMATRIX matProj = { (float)g_D3Dpp.BackBufferHeight/g_D3Dpp.BackBufferWidth,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };
- g_D3DDev->SetTransform(D3DTS_PROJECTION, &matProj);
-
- // Disable lighting and culling
- g_D3DDev->SetRenderState( D3DRS_LIGHTING, FALSE );
- g_D3DDev->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
- g_D3DDev->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
-}
-
-
-// Win32 MessageProc callback
-LRESULT CALLBACK MessageProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- // Send event message to AntTweakBar
- if( TwEventWin(wnd, msg, wParam, lParam) )
- return 0; // Event has been handled by AntTweakBar
-
- switch( msg )
- {
- case WM_CHAR:
- if( wParam==VK_ESCAPE )
- PostQuitMessage(0);
- return 0;
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
- case WM_SIZE: // Window size has been changed
- // Reset D3D device
- if( g_D3DDev )
- {
- g_D3Dpp.BackBufferWidth = LOWORD(lParam);
- g_D3Dpp.BackBufferHeight = HIWORD(lParam);
- if( g_D3Dpp.BackBufferWidth>0 && g_D3Dpp.BackBufferHeight>0 )
- {
- g_D3DDev->Reset(&g_D3Dpp);
- InitD3D(); // re-initialize D3D states
- }
- // TwWindowSize has been called by TwEventWin32,
- // so it is not necessary to call it again here.
- }
- return 0;
- default:
- return DefWindowProc(wnd, msg, wParam, lParam);
- }
-}
-
-
-// Main
-int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int cmdShow)
-{
- // Register our window class
- WNDCLASSEX wcex = { sizeof(WNDCLASSEX), CS_CLASSDC|CS_DBLCLKS, MessageProc, 0L, 0L,
- instance, NULL, NULL, NULL, NULL, "TwDX9", NULL };
- RegisterClassEx(&wcex);
-
- // Create a window
- const int W = 640;
- const int H = 480;
- BOOL fullscreen = FALSE; // Set to TRUE to run in fullscreen
- RECT rect = { 0, 0, W, H };
- DWORD style = fullscreen ? WS_POPUP : WS_OVERLAPPEDWINDOW;
- AdjustWindowRect(&rect, style, FALSE);
- HWND wnd = CreateWindow("TwDX9", "AntTweakBar simple example using DirectX9",
- style, CW_USEDEFAULT, CW_USEDEFAULT,
- rect.right-rect.left, rect.bottom-rect.top, NULL, NULL, instance, NULL);
- if( !wnd )
- {
- MessageBox(NULL, "Cannot create window", "Error", MB_OK|MB_ICONERROR);
- return FALSE;
- }
- ShowWindow(wnd, cmdShow);
- UpdateWindow(wnd);
-
- // Initialize Direct3D
- g_D3D = Direct3DCreate9(D3D_SDK_VERSION);
- if( !g_D3D )
- {
- MessageBox(wnd, "Cannot initialize DirectX", "Error", MB_OK|MB_ICONERROR);
- return FALSE;
- }
-
- // Create a Direct3D device
- ZeroMemory( &g_D3Dpp, sizeof(D3DPRESENT_PARAMETERS) );
- g_D3Dpp.Windowed = !fullscreen;
- if( fullscreen )
- {
- g_D3Dpp.BackBufferWidth = W;
- g_D3Dpp.BackBufferHeight = H;
- }
- g_D3Dpp.BackBufferCount = 1;
- g_D3Dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
- if( fullscreen )
- g_D3Dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
- else
- g_D3Dpp.BackBufferFormat = D3DFMT_UNKNOWN;
- g_D3Dpp.hDeviceWindow = wnd;
-
- g_D3Dpp.EnableAutoDepthStencil = TRUE;
- g_D3Dpp.AutoDepthStencilFormat = D3DFMT_D16;
- g_D3Dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- HRESULT hr = g_D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd,
- D3DCREATE_SOFTWARE_VERTEXPROCESSING, &g_D3Dpp, &g_D3DDev);
- if( FAILED(hr) )
- {
- //DXTRACE_ERR_MSGBOX("Cannot create DirectX device", hr);
- MessageBox(wnd, "Cannot create DirectX device", "Error", MB_OK|MB_ICONERROR);
- g_D3D->Release();
- g_D3D = NULL;
- return FALSE;
- }
-
- // This example draws a moving strip;
- // create a buffer of vertices for the strip
- struct Vertex
- {
- float x, y, z;
- DWORD color;
- };
- Vertex vertices[2002];
- int numSec = 100; // number of strip sections
- float color[] = { 1, 0, 0 }; // strip color
- unsigned int bgColor = D3DCOLOR_ARGB(255, 128, 196, 196); // background color
-
- // Init some D3D states
- InitD3D();
-
- // Initialize AntTweakBar
- // (note that the Direct3D device pointer must be passed to TwInit)
- if( !TwInit(TW_DIRECT3D9, g_D3DDev) )
- {
- MessageBox(wnd, TwGetLastError(), "Cannot initialize AntTweakBar", MB_OK|MB_ICONERROR);
- g_D3DDev->Release();
- g_D3DDev = NULL;
- g_D3D->Release();
- g_D3D = NULL;
- return FALSE;
- }
-
-
- // Create a tweak bar
- TwBar *bar = TwNewBar("TweakBar");
- TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar in a DirectX9 application.' "); // Message added to the help bar.
- TwDefine(" TweakBar color='128 224 160' text=dark "); // Change TweakBar color and use dark text
-
- // Add 'numSec' to 'bar': it is a modifiable (RW) variable of type TW_TYPE_INT32. Its shortcuts are [s] and [S].
- TwAddVarRW(bar, "NumSec", TW_TYPE_INT32, &numSec,
- " label='Strip length' min=1 max=1000 keyIncr=s keyDecr=S help='Number of segments of the strip.' ");
-
- // Add 'color' to 'bar': it is a modifiable variable of type TW_TYPE_COLOR3F (3 floats color)
- TwAddVarRW(bar, "Color", TW_TYPE_COLOR3F, &color, " label='Strip color' ");
-
- // Add 'bgColor' to 'bar': it is a modifiable variable of type TW_TYPE_COLOR32 (32 bits color)
- TwAddVarRW(bar, "BgColor", TW_TYPE_COLOR32, &bgColor, " label='Background color' ");
-
- // Add 'width' and 'height' to 'bar': they are read-only (RO) variables of type TW_TYPE_INT32.
- TwAddVarRO(bar, "Width", TW_TYPE_INT32, &g_D3Dpp.BackBufferWidth,
- " label='wnd width' help='Current graphics window width.' ");
- TwAddVarRO(bar, "Height", TW_TYPE_INT32, &g_D3Dpp.BackBufferHeight,
- " label='wnd height' help='Current graphics window height.' ");
-
-
- // Main loop
- bool quit = false;
- DWORD t0 = GetTickCount();
- while( !quit )
- {
- // Clear screen and begin draw
- g_D3DDev->Clear(0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, bgColor, 1.0f, 0);
- g_D3DDev->BeginScene();
-
- // Draw scene
- float s, t = (float)(GetTickCount() - t0)/1000.0f;
- for( int i=0; i<=numSec; ++i ) // update vertices
- {
- s = (float)i/100;
- vertices[2*i+0].x = 0.05f+0.7f*cosf(2.0f*s+5.0f*t);
- vertices[2*i+1].x = vertices[2*i+0].x + (0.25f+0.1f*cosf(s+t));
- vertices[2*i+0].y = vertices[2*i+1].y = 0.7f*(0.7f+0.3f*sinf(s+t))*sinf(1.5f*s+3.0f*t);
- vertices[2*i+0].z = vertices[2*i+1].z = 0;
- s = (float)i/numSec;
- vertices[2*i+0].color = vertices[2*i+1].color =
- D3DCOLOR_XRGB((int)(255*color[0]*s), (int)(255*color[1]*s), (int)(255*color[2]*s));
- }
- g_D3DDev->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
- g_D3DDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2*numSec, vertices, sizeof(Vertex)); // draw strip
-
- // Draw tweak bars
- TwDraw();
-
- // End draw
- g_D3DDev->EndScene();
-
- // Present frame buffer
- g_D3DDev->Present(NULL, NULL, NULL, NULL);
-
- // Process windows messages
- MSG msg;
- while( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
- {
- if( msg.message==WM_QUIT )
- quit = true;
- else if( !TranslateAccelerator(msg.hwnd, NULL, &msg) )
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
- } // End of main loop
-
-
- // Terminate AntTweakBar
- TwTerminate();
-
- // Release Direct3D
- g_D3DDev->Release();
- g_D3DDev = NULL;
- g_D3D->Release();
- g_D3D = NULL;
-
- return 0;
-}
-
diff --git a/external/AntTweakBar/examples/TwSimpleGLFW.c b/external/AntTweakBar/examples/TwSimpleGLFW.c
deleted file mode 100644
index c62b171..0000000
--- a/external/AntTweakBar/examples/TwSimpleGLFW.c
+++ /dev/null
@@ -1,203 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwSimpleGLFW.c
-// @brief A simple example that uses AntTweakBar with
-// OpenGL and the GLFW windowing system.
-//
-// AntTweakBar: http://anttweakbar.sourceforge.net/doc
-// OpenGL: http://www.opengl.org
-// GLFW: http://www.glfw.org
-//
-// @author Philippe Decaudin
-// @date 2006/05/20
-//
-// ---------------------------------------------------------------------------
-
-
-#include
-
-#define GLFW_DLL
-#include "glfw.h"
-
-#include
-
-
-// Callback function called by GLFW when window size changes
-void GLFWCALL WindowSizeCB(int width, int height)
-{
- // Set OpenGL viewport and camera
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(40, (double)width/height, 1, 10);
- gluLookAt(-1,0,3, 0,0,0, 0,1,0);
-
- // Send the new window size to AntTweakBar
- TwWindowSize(width, height);
-}
-
-
-// This example program draws a possibly transparent cube
-void DrawModel(int wireframe)
-{
- int pass, numPass;
-
- // Enable OpenGL transparency and light (could have been done once at init)
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_LIGHT0); // use default light diffuse and position
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);
- glEnable(GL_COLOR_MATERIAL);
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
- glEnable(GL_LINE_SMOOTH);
- glLineWidth(3.0);
-
- if( wireframe )
- {
- glDisable(GL_CULL_FACE);
- glDisable(GL_LIGHTING);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- numPass = 1;
- }
- else
- {
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- numPass = 2;
- }
-
- for( pass=0; pass
-
-#include
-#include
-#include
-
-#if defined(_WIN32) || defined(_WIN64)
-// MiniGLUT.h is provided to avoid the need of having GLUT installed to
-// recompile this example. Do not use it in your own programs, better
-// install and use the actual GLUT library SDK.
-# define USE_MINI_GLUT
-#endif
-
-#if defined(USE_MINI_GLUT)
-# include "../src/MiniGLUT.h"
-#elif defined(_MACOSX)
-# include
-#else
-# include
-#endif
-
-// This example displays one of the following shapes
-typedef enum { SHAPE_TEAPOT=1, SHAPE_TORUS, SHAPE_CONE } Shape;
-#define NUM_SHAPES 3
-Shape g_CurrentShape = SHAPE_TORUS;
-// Shapes scale
-float g_Zoom = 1.0f;
-// Shape orientation (stored as a quaternion)
-float g_Rotation[] = { 0.0f, 0.0f, 0.0f, 1.0f };
-// Auto rotate
-int g_AutoRotate = 0;
-int g_RotateTime = 0;
-float g_RotateStart[] = { 0.0f, 0.0f, 0.0f, 1.0f };
-// Shapes material
-float g_MatAmbient[] = { 0.5f, 0.0f, 0.0f, 1.0f };
-float g_MatDiffuse[] = { 1.0f, 1.0f, 0.0f, 1.0f };
-// Light parameter
-float g_LightMultiplier = 1.0f;
-float g_LightDirection[] = { -0.57735f, -0.57735f, -0.57735f };
-
-
-// Routine to set a quaternion from a rotation axis and angle
-// ( input axis = float[3] angle = float output: quat = float[4] )
-void SetQuaternionFromAxisAngle(const float *axis, float angle, float *quat)
-{
- float sina2, norm;
- sina2 = (float)sin(0.5f * angle);
- norm = (float)sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
- quat[0] = sina2 * axis[0] / norm;
- quat[1] = sina2 * axis[1] / norm;
- quat[2] = sina2 * axis[2] / norm;
- quat[3] = (float)cos(0.5f * angle);
-}
-
-
-// Routine to convert a quaternion to a 4x4 matrix
-// ( input: quat = float[4] output: mat = float[4*4] )
-void ConvertQuaternionToMatrix(const float *quat, float *mat)
-{
- float yy2 = 2.0f * quat[1] * quat[1];
- float xy2 = 2.0f * quat[0] * quat[1];
- float xz2 = 2.0f * quat[0] * quat[2];
- float yz2 = 2.0f * quat[1] * quat[2];
- float zz2 = 2.0f * quat[2] * quat[2];
- float wz2 = 2.0f * quat[3] * quat[2];
- float wy2 = 2.0f * quat[3] * quat[1];
- float wx2 = 2.0f * quat[3] * quat[0];
- float xx2 = 2.0f * quat[0] * quat[0];
- mat[0*4+0] = - yy2 - zz2 + 1.0f;
- mat[0*4+1] = xy2 + wz2;
- mat[0*4+2] = xz2 - wy2;
- mat[0*4+3] = 0;
- mat[1*4+0] = xy2 - wz2;
- mat[1*4+1] = - xx2 - zz2 + 1.0f;
- mat[1*4+2] = yz2 + wx2;
- mat[1*4+3] = 0;
- mat[2*4+0] = xz2 + wy2;
- mat[2*4+1] = yz2 - wx2;
- mat[2*4+2] = - xx2 - yy2 + 1.0f;
- mat[2*4+3] = 0;
- mat[3*4+0] = mat[3*4+1] = mat[3*4+2] = 0;
- mat[3*4+3] = 1;
-}
-
-
-// Routine to multiply 2 quaternions (ie, compose rotations)
-// ( input q1 = float[4] q2 = float[4] output: qout = float[4] )
-void MultiplyQuaternions(const float *q1, const float *q2, float *qout)
-{
- float qr[4];
- qr[0] = q1[3]*q2[0] + q1[0]*q2[3] + q1[1]*q2[2] - q1[2]*q2[1];
- qr[1] = q1[3]*q2[1] + q1[1]*q2[3] + q1[2]*q2[0] - q1[0]*q2[2];
- qr[2] = q1[3]*q2[2] + q1[2]*q2[3] + q1[0]*q2[1] - q1[1]*q2[0];
- qr[3] = q1[3]*q2[3] - (q1[0]*q2[0] + q1[1]*q2[1] + q1[2]*q2[2]);
- qout[0] = qr[0]; qout[1] = qr[1]; qout[2] = qr[2]; qout[3] = qr[3];
-}
-
-
-// Return elapsed time in milliseconds
-int GetTimeMs()
-{
-#if !defined(_WIN32)
- return glutGet(GLUT_ELAPSED_TIME);
-#else
- // glutGet(GLUT_ELAPSED_TIME) seems buggy on Windows
- return (int)GetTickCount();
-#endif
-}
-
-
-// Callback function called by GLUT to render screen
-void Display(void)
-{
- float v[4]; // will be used to set light parameters
- float mat[4*4]; // rotation matrix
-
- // Clear frame buffer
- glClearColor(0, 0, 0, 1);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glEnable(GL_DEPTH_TEST);
- glDisable(GL_CULL_FACE);
- glEnable(GL_NORMALIZE);
-
- // Set light
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- v[0] = v[1] = v[2] = g_LightMultiplier*0.4f; v[3] = 1.0f;
- glLightfv(GL_LIGHT0, GL_AMBIENT, v);
- v[0] = v[1] = v[2] = g_LightMultiplier*0.8f; v[3] = 1.0f;
- glLightfv(GL_LIGHT0, GL_DIFFUSE, v);
- v[0] = -g_LightDirection[0]; v[1] = -g_LightDirection[1]; v[2] = -g_LightDirection[2]; v[3] = 0.0f;
- glLightfv(GL_LIGHT0, GL_POSITION, v);
-
- // Set material
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, g_MatAmbient);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, g_MatDiffuse);
-
- // Rotate and draw shape
- glPushMatrix();
- glTranslatef(0.5f, -0.3f, 0.0f);
- if( g_AutoRotate )
- {
- float axis[3] = { 0, 1, 0 };
- float angle = (float)(GetTimeMs()-g_RotateTime)/1000.0f;
- float quat[4];
- SetQuaternionFromAxisAngle(axis, angle, quat);
- MultiplyQuaternions(g_RotateStart, quat, g_Rotation);
- }
- ConvertQuaternionToMatrix(g_Rotation, mat);
- glMultMatrixf(mat);
- glScalef(g_Zoom, g_Zoom, g_Zoom);
- glCallList(g_CurrentShape);
- glPopMatrix();
-
- // Draw tweak bars
- TwDraw();
-
- // Present frame buffer
- glutSwapBuffers();
-
- // Recall Display at next frame
- glutPostRedisplay();
-}
-
-
-// Callback function called by GLUT when window size changes
-void Reshape(int width, int height)
-{
- // Set OpenGL viewport and camera
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(40, (double)width/height, 1, 10);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- gluLookAt(0,0,5, 0,0,0, 0,1,0);
- glTranslatef(0, 0.6f, -1);
-
- // Send the new window size to AntTweakBar
- TwWindowSize(width, height);
-}
-
-
-// Function called at exit
-void Terminate(void)
-{
- glDeleteLists(SHAPE_TEAPOT, NUM_SHAPES);
-
- TwTerminate();
-}
-
-
-// Callback function called when the 'AutoRotate' variable value of the tweak bar has changed
-void TW_CALL SetAutoRotateCB(const void *value, void *clientData)
-{
- (void)clientData; // unused
-
- g_AutoRotate = *(const int *)value; // copy value to g_AutoRotate
- if( g_AutoRotate!=0 )
- {
- // init rotation
- g_RotateTime = GetTimeMs();
- g_RotateStart[0] = g_Rotation[0];
- g_RotateStart[1] = g_Rotation[1];
- g_RotateStart[2] = g_Rotation[2];
- g_RotateStart[3] = g_Rotation[3];
-
- // make Rotation variable read-only
- TwDefine(" TweakBar/ObjRotation readonly ");
- }
- else
- // make Rotation variable read-write
- TwDefine(" TweakBar/ObjRotation readwrite ");
-}
-
-
-// Callback function called by the tweak bar to get the 'AutoRotate' value
-void TW_CALL GetAutoRotateCB(void *value, void *clientData)
-{
- (void)clientData; // unused
- *(int *)value = g_AutoRotate; // copy g_AutoRotate to value
-}
-
-
-// Main
-int main(int argc, char *argv[])
-{
- TwBar *bar; // Pointer to the tweak bar
- float axis[] = { 0.7f, 0.7f, 0.0f }; // initial model rotation
- float angle = 0.8f;
-
- // Initialize GLUT
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
- glutInitWindowSize(640, 480);
- glutCreateWindow("AntTweakBar simple example using GLUT");
- glutCreateMenu(NULL);
-
- // Set GLUT callbacks
- glutDisplayFunc(Display);
- glutReshapeFunc(Reshape);
- atexit(Terminate); // Called after glutMainLoop ends
-
- // Initialize AntTweakBar
- TwInit(TW_OPENGL, NULL);
-
- // Set GLUT event callbacks
- // - Directly redirect GLUT mouse button events to AntTweakBar
- glutMouseFunc((GLUTmousebuttonfun)TwEventMouseButtonGLUT);
- // - Directly redirect GLUT mouse motion events to AntTweakBar
- glutMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
- // - Directly redirect GLUT mouse "passive" motion events to AntTweakBar (same as MouseMotion)
- glutPassiveMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
- // - Directly redirect GLUT key events to AntTweakBar
- glutKeyboardFunc((GLUTkeyboardfun)TwEventKeyboardGLUT);
- // - Directly redirect GLUT special key events to AntTweakBar
- glutSpecialFunc((GLUTspecialfun)TwEventSpecialGLUT);
- // - Send 'glutGetModifers' function pointer to AntTweakBar;
- // required because the GLUT key event functions do not report key modifiers states.
- TwGLUTModifiersFunc(glutGetModifiers);
-
- // Create some 3D objects (stored in display lists)
- glNewList(SHAPE_TEAPOT, GL_COMPILE);
- glutSolidTeapot(1.0);
- glEndList();
- glNewList(SHAPE_TORUS, GL_COMPILE);
- glutSolidTorus(0.3, 1.0, 16, 32);
- glEndList();
- glNewList(SHAPE_CONE, GL_COMPILE);
- glutSolidCone(1.0, 1.5, 64, 4);
- glEndList();
-
- // Create a tweak bar
- bar = TwNewBar("TweakBar");
- TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar with GLUT and OpenGL.' "); // Message added to the help bar.
- TwDefine(" TweakBar size='200 400' color='96 216 224' "); // change default tweak bar size and color
-
- // Add 'g_Zoom' to 'bar': this is a modifable (RW) variable of type TW_TYPE_FLOAT. Its key shortcuts are [z] and [Z].
- TwAddVarRW(bar, "Zoom", TW_TYPE_FLOAT, &g_Zoom,
- " min=0.01 max=2.5 step=0.01 keyIncr=z keyDecr=Z help='Scale the object (1=original size).' ");
-
- // Add 'g_Rotation' to 'bar': this is a variable of type TW_TYPE_QUAT4F which defines the object's orientation
- TwAddVarRW(bar, "ObjRotation", TW_TYPE_QUAT4F, &g_Rotation,
- " label='Object rotation' opened=true help='Change the object orientation.' ");
-
- // Add callback to toggle auto-rotate mode (callback functions are defined above).
- TwAddVarCB(bar, "AutoRotate", TW_TYPE_BOOL32, SetAutoRotateCB, GetAutoRotateCB, NULL,
- " label='Auto-rotate' key=space help='Toggle auto-rotate mode.' ");
-
- // Add 'g_LightMultiplier' to 'bar': this is a variable of type TW_TYPE_FLOAT. Its key shortcuts are [+] and [-].
- TwAddVarRW(bar, "Multiplier", TW_TYPE_FLOAT, &g_LightMultiplier,
- " label='Light booster' min=0.1 max=4 step=0.02 keyIncr='+' keyDecr='-' help='Increase/decrease the light power.' ");
-
- // Add 'g_LightDirection' to 'bar': this is a variable of type TW_TYPE_DIR3F which defines the light direction
- TwAddVarRW(bar, "LightDir", TW_TYPE_DIR3F, &g_LightDirection,
- " label='Light direction' opened=true help='Change the light direction.' ");
-
- // Add 'g_MatAmbient' to 'bar': this is a variable of type TW_TYPE_COLOR3F (3 floats color, alpha is ignored)
- // and is inserted into a group named 'Material'.
- TwAddVarRW(bar, "Ambient", TW_TYPE_COLOR3F, &g_MatAmbient, " group='Material' ");
-
- // Add 'g_MatDiffuse' to 'bar': this is a variable of type TW_TYPE_COLOR3F (3 floats color, alpha is ignored)
- // and is inserted into group 'Material'.
- TwAddVarRW(bar, "Diffuse", TW_TYPE_COLOR3F, &g_MatDiffuse, " group='Material' ");
-
- // Add the enum variable 'g_CurrentShape' to 'bar'
- // (before adding an enum variable, its enum type must be declared to AntTweakBar as follow)
- {
- // ShapeEV associates Shape enum values with labels that will be displayed instead of enum values
- TwEnumVal shapeEV[NUM_SHAPES] = { {SHAPE_TEAPOT, "Teapot"}, {SHAPE_TORUS, "Torus"}, {SHAPE_CONE, "Cone"} };
- // Create a type for the enum shapeEV
- TwType shapeType = TwDefineEnum("ShapeType", shapeEV, NUM_SHAPES);
- // add 'g_CurrentShape' to 'bar': this is a variable of type ShapeType. Its key shortcuts are [<] and [>].
- TwAddVarRW(bar, "Shape", shapeType, &g_CurrentShape, " keyIncr='<' keyDecr='>' help='Change object shape.' ");
- }
-
- // Store time
- g_RotateTime = GetTimeMs();
- // Init rotation
- SetQuaternionFromAxisAngle(axis, angle, g_Rotation);
- SetQuaternionFromAxisAngle(axis, angle, g_RotateStart);
-
- // Call the GLUT main loop
- glutMainLoop();
-
- return 0;
-}
-
diff --git a/external/AntTweakBar/examples/TwSimpleSDL.c b/external/AntTweakBar/examples/TwSimpleSDL.c
deleted file mode 100644
index 55a8e96..0000000
--- a/external/AntTweakBar/examples/TwSimpleSDL.c
+++ /dev/null
@@ -1,260 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwSimpleSDL.c
-// @brief A simple example that uses AntTweakBar with OpenGL and SDL 1.2
-//
-// AntTweakBar: http://anttweakbar.sourceforge.net/doc
-// OpenGL: http://www.opengl.org
-// SDL: http://www.libsdl.org
-//
-// @author Philippe Decaudin
-//
-// ---------------------------------------------------------------------------
-
-
-#include
-
-#if defined(_WIN32) || defined(_WIN64)
-// MiniSDL12.h is provided to avoid the need of having SDL installed to
-// recompile this example. Do not use it in your own programs, better
-// install and use the actual SDL library SDK.
-# define USE_MINI_SDL
-#endif
-
-#ifdef USE_MINI_SDL
-# include "../src/MiniSDL12.h"
-#else
-# include
-#endif
-
-#include
-#include
-#include
-
-#if defined(_WIN32) || defined(_WIN64)
-# include // required by gl.h
-#endif
-#include
-#include
-
-// SDL redefines main
-#ifdef main
-# undef main
-#endif
-
-int main()
-{
- const SDL_VideoInfo* video = NULL;
- int width = 640, height = 480;
- int bpp, flags;
- int quit = 0;
- TwBar *bar;
- int n, numCubes = 30;
- float color0[] = { 1.0f, 0.5f, 0.0f };
- float color1[] = { 0.5f, 1.0f, 0.0f };
- double ka = 5.3, kb = 1.7, kc = 4.1;
-
- // Initialize SDL, then get the current video mode and use it to create a SDL window.
- if( SDL_Init(SDL_INIT_VIDEO)<0 )
- {
- fprintf(stderr, "Video initialization failed: %s\n", SDL_GetError());
- SDL_Quit();
- exit(1);
- }
- video = SDL_GetVideoInfo();
- if( !video )
- {
- fprintf(stderr, "Video query failed: %s\n", SDL_GetError());
- SDL_Quit();
- exit(1);
- }
- SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
- //SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 1);
- SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
- bpp = video->vfmt->BitsPerPixel;
- flags = SDL_OPENGL | SDL_HWSURFACE | SDL_RESIZABLE;
- //flags |= SDL_FULLSCREEN;
- if( !SDL_SetVideoMode(width, height, bpp, flags) )
- {
- fprintf(stderr, "Video mode set failed: %s\n", SDL_GetError());
- SDL_Quit();
- exit(1);
- }
- SDL_WM_SetCaption("AntTweakBar simple example using SDL", "AntTweakBar+SDL");
-
- // Enable SDL unicode and key-repeat
- SDL_EnableUNICODE(1);
- SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
-
- // Set OpenGL viewport and states
- glViewport(0, 0, width, height);
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0); // use default light diffuse and position
- glEnable(GL_NORMALIZE);
- glEnable(GL_COLOR_MATERIAL);
- glDisable(GL_CULL_FACE);
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
-
- // Initialize AntTweakBar
- TwInit(TW_OPENGL, NULL);
-
- // Tell the window size to AntTweakBar
- TwWindowSize(width, height);
-
- // Create a tweak bar
- bar = TwNewBar("TweakBar");
- TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar with SDL and OpenGL.\nPress [Space] to toggle fullscreen.' "); // Message added to the help bar.
-
- // Add 'width' and 'height' to 'bar': they are read-only (RO) variables of type TW_TYPE_INT32.
- TwAddVarRO(bar, "Width", TW_TYPE_INT32, &width,
- " label='Wnd width' help='Width of the graphics window (in pixels)' ");
-
- TwAddVarRO(bar, "Height", TW_TYPE_INT32, &height,
- " label='Wnd height' help='Height of the graphics window (in pixels)' ");
-
- // Add 'numCurves' to 'bar': this is a modifiable variable of type TW_TYPE_INT32. Its shortcuts are [c] and [C].
- TwAddVarRW(bar, "NumCubes", TW_TYPE_INT32, &numCubes,
- " label='Number of cubes' min=1 max=100 keyIncr=c keyDecr=C help='Defines the number of cubes in the scene.' ");
-
- // Add 'ka', 'kb and 'kc' to 'bar': they are modifiable variables of type TW_TYPE_DOUBLE
- TwAddVarRW(bar, "ka", TW_TYPE_DOUBLE, &ka,
- " label='X path coeff' keyIncr=1 keyDecr=CTRL+1 min=-10 max=10 step=0.01 ");
- TwAddVarRW(bar, "kb", TW_TYPE_DOUBLE, &kb,
- " label='Y path coeff' keyIncr=2 keyDecr=CTRL+2 min=-10 max=10 step=0.01 ");
- TwAddVarRW(bar, "kc", TW_TYPE_DOUBLE, &kc,
- " label='Z path coeff' keyIncr=3 keyDecr=CTRL+3 min=-10 max=10 step=0.01 ");
-
- // Add 'color0' and 'color1' to 'bar': they are modifable variables of type TW_TYPE_COLOR3F (3 floats color)
- TwAddVarRW(bar, "color0", TW_TYPE_COLOR3F, &color0,
- " label='Start color' help='Color of the first cube.' ");
- TwAddVarRW(bar, "color1", TW_TYPE_COLOR3F, &color1,
- " label='End color' help='Color of the last cube. Cube colors are interpolated between the Start and End colors.' ");
-
- // Add 'quit' to 'bar': this is a modifiable (RW) variable of type TW_TYPE_BOOL32
- // (a boolean stored in a 32 bits integer). Its shortcut is [ESC].
- TwAddVarRW(bar, "Quit", TW_TYPE_BOOL32, &quit,
- " label='Quit?' true='+' false='-' key='ESC' help='Quit program.' ");
-
- // Main loop:
- // - Draw some cubes
- // - Process events
- while( !quit )
- {
- SDL_Event event;
- int handled;
-
- // Clear screen
- glClearColor(0.5f, 0.75f, 0.8f, 1);
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
-
- // Set OpenGL camera
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(40, (double)width/height, 1, 10);
- gluLookAt(0,0,3, 0,0,0, 0,1,0);
-
- // Draw cubes
- for( n=0; n
-
-#if defined(_WIN32)
-// MiniSFML16.h is provided to avoid the need of having SFML installed to
-// recompile this example. Do not use it in your own programs, better
-// install and use the actual SFML library SDK.
-# define USE_MINI_SFML
-#endif
-
-#ifdef USE_MINI_SFML
-# include "../src/MiniSFML16.h"
-#else
-# include
-#endif
-
-#if defined(_WIN32)
-# include // required by gl.h
-#endif
-#include
-#include
-
-#include
-#include
-#include
-
-
-// Pseudo-random value between -1 and 1
-float Random()
-{
- return 2.0f * ((float)rand() / RAND_MAX) - 1.0f;
-}
-
-// Particle randomly initialized
-struct Particle
-{
- float Size;
- float Position[3]; // [px, py, pz]
- float Speed[3]; // [vx, vy, vz]
- float RotationAxis[3]; // [rx, ry, rz]
- float RotationAngle; // in degree
- float RotationSpeed;
- float Color[3]; // [r, g, b]
- float Age;
- Particle(float size, float speedDir[3], float speedNorm, float color[3]) // Constructor
- {
- Size = size * (1.0f + 0.2f * Random());
- Position[0] = Position[1] = Position[2] = 0;
- Speed[0] = speedNorm * (speedDir[0] + 0.1f * Random());
- Speed[1] = speedNorm * (speedDir[1] + 0.1f * Random());
- Speed[2] = speedNorm * (speedDir[2] + 0.1f * Random());
- RotationAxis[0] = Random();
- RotationAxis[1] = Random();
- RotationAxis[2] = Random();
- RotationAngle = 360.0f * Random();
- RotationSpeed = 360.0f * Random();
- Color[0] = color[0] + 0.2f * Random();
- Color[1] = color[1] + 0.2f * Random();
- Color[2] = color[2] + 0.2f * Random();
- Age = 0;
- }
- void Update(float dt) // Apply one animation step
- {
- Position[0] += dt * Speed[0];
- Position[1] += dt * Speed[1];
- Position[2] += dt * Speed[2];
- Speed[1] -= dt * 9.81f; // gravity
- RotationAngle += dt * RotationSpeed;
- Age += dt;
- }
-};
-
-
-// Main
-int main()
-{
- // Create main window
- sf::RenderWindow app(sf::VideoMode(800, 600), "AntTweakBar simple example using SFML");
- app.PreserveOpenGLStates(true);
-
- // Particules
- std::list particles;
- std::list::iterator p;
- float birthCount = 0;
- float birthRate = 20; // number of particles generated per second
- float maxAge = 3.0f; // particles life time
- float speedDir[3] = {0, 1, 0}; // initial particles speed direction
- float speedNorm = 7.0f; // initial particles speed amplitude
- float size = 0.1f; // particles size
- float color[3] = {0.8f, 0.6f, 0}; // particles color
- float bgColor[3] = {0, 0.6f, 0.6f}; // background color
-
-
- // Initialize AntTweakBar
- TwInit(TW_OPENGL, NULL);
-
- // Tell the window size to AntTweakBar
- TwWindowSize(app.GetWidth(), app.GetHeight());
-
- // Create a tweak bar
- TwBar *bar = TwNewBar("Particles");
- TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar with SFML and OpenGL.' "); // Message added to the help bar.
-
- // Change bar position
- int barPos[2] = {16, 240};
- TwSetParam(bar, NULL, "position", TW_PARAM_INT32, 2, &barPos);
-
- // Add 'birthRate' to 'bar': this is a modifiable variable of type TW_TYPE_FLOAT in range [0.1, 100]. Its shortcuts are [+] and [-].
- TwAddVarRW(bar, "Birth rate", TW_TYPE_FLOAT, &birthRate, " min=0.1 max=100 step=0.1 keyIncr='+' keyDecr='-' ");
-
- // Add 'speedNorm' to 'bar': this is a modifiable variable of type TW_TYPE_FLOAT in range [0.1, 10]. Its shortcuts are [s] and [S].
- TwAddVarRW(bar, "Speed", TW_TYPE_FLOAT, &speedNorm, " min=0.1 max=10 step=0.1 keyIncr='s' keyDecr='S' ");
-
- // Add 'speedDir' to 'bar': this is a modifiable variable of type TW_TYPE_DIR3F. Just displaying the arrow widget
- TwAddVarRW(bar, "Direction", TW_TYPE_DIR3F, &speedDir, " opened=true showval=false ");
-
- // Add 'color' to 'bar': this is a modifiable variable of type TW_TYPE_COLOR3F. Switched to HLS
- TwAddVarRW(bar, "Color", TW_TYPE_COLOR3F, &color, " colorMode=hls opened=true ");
-
- // Add 'bgColor' to 'bar': this is a modifiable variable of type TW_TYPE_COLOR3F. Switched to HLS
- TwAddVarRW(bar, "Background color", TW_TYPE_COLOR3F, &bgColor, " colorMode=hls opened=true ");
-
- // Initialize OpenGL states
- glEnable(GL_DEPTH_TEST);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(90.f, (float)app.GetWidth()/app.GetHeight(), 0.1f, 100.f);
- glMatrixMode(GL_MODELVIEW);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_NORMALIZE);
- glEnable(GL_COLOR_MATERIAL);
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
-
- // Init time
- sf::Clock clock;
- float time = clock.GetElapsedTime();
-
- // Main loop
- while (app.IsOpened())
- {
- // Process events
- sf::Event event;
- while (app.GetEvent(event))
- {
- // Send event to AntTweakBar
- int handled = TwEventSFML(&event, 1, 6); // Assume SFML version 1.6 here
-
- // If event has not been handled by AntTweakBar, process it
- if( !handled )
- {
- // Close or Escape
- if (event.Type == sf::Event::Closed
- || (event.Type == sf::Event::KeyPressed && event.Key.Code == sf::Key::Escape))
- app.Close();
-
- // Resize
- if (event.Type == sf::Event::Resized)
- {
- glViewport(0, 0, event.Size.Width, event.Size.Height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(90.f, (float)event.Size.Width/event.Size.Height, 1.f, 500.f);
- glMatrixMode(GL_MODELVIEW);
-
- // TwWindowSize has been called by TwEventSFML,
- // so it is not necessary to call it again here.
- }
- }
- }
-
- if (!app.IsOpened())
- continue;
-
- // Update time
- float dt = clock.GetElapsedTime() - time;
- if (dt < 0) dt = 0;
- time += dt;
-
- // Update particles
- p = particles.begin();
- while (p != particles.end())
- {
- p->Update(dt);
- if (p->Age >= maxAge)
- p = particles.erase(p); // Die!
- else
- ++p;
- }
-
- // Generate new particles
- birthCount += dt * birthRate;
- while (birthCount >= 1.0f)
- {
- particles.push_back(Particle(size, speedDir, speedNorm, color));
- birthCount--;
- }
-
- // Clear depth buffer
- glClearColor(bgColor[0], bgColor[1], bgColor[2], 1);
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
-
- // Draw particles
- for (p = particles.begin(); p != particles.end(); ++p)
- {
- glColor4fv(p->Color);
- glLoadIdentity();
- glTranslatef(0.0f, -1.0f, -3.0f); // Camera position
- glTranslatef(p->Position[0], p->Position[1], p->Position[2]);
- glScalef(p->Size, p->Size, p->Size);
- glRotatef(p->RotationAngle, p->RotationAxis[0], p->RotationAxis[1], p->RotationAxis[2]);
-
- // Draw a cube
- glBegin(GL_QUADS);
- glNormal3f(0,0,-1); glVertex3f(0,0,0); glVertex3f(0,1,0); glVertex3f(1,1,0); glVertex3f(1,0,0); // front face
- glNormal3f(0,0,+1); glVertex3f(0,0,1); glVertex3f(1,0,1); glVertex3f(1,1,1); glVertex3f(0,1,1); // back face
- glNormal3f(-1,0,0); glVertex3f(0,0,0); glVertex3f(0,0,1); glVertex3f(0,1,1); glVertex3f(0,1,0); // left face
- glNormal3f(+1,0,0); glVertex3f(1,0,0); glVertex3f(1,1,0); glVertex3f(1,1,1); glVertex3f(1,0,1); // right face
- glNormal3f(0,-1,0); glVertex3f(0,0,0); glVertex3f(1,0,0); glVertex3f(1,0,1); glVertex3f(0,0,1); // bottom face
- glNormal3f(0,+1,0); glVertex3f(0,1,0); glVertex3f(0,1,1); glVertex3f(1,1,1); glVertex3f(1,1,0); // top face
- glEnd();
- }
-
- TwDraw();
-
- // Finally, display the rendered frame on screen
- app.Display();
- }
-
- // Un-initialize AntTweakBar
- TwTerminate();
-
- return EXIT_SUCCESS;
-}
diff --git a/external/AntTweakBar/examples/TwString.cpp b/external/AntTweakBar/examples/TwString.cpp
deleted file mode 100644
index 7a17112..0000000
--- a/external/AntTweakBar/examples/TwString.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwString.cpp
-// @brief This example illustrates the use of the different types of
-// AntTweakBar string variables.
-// The graphic window is created by GLUT.
-//
-// AntTweakBar: http://anttweakbar.sourceforge.net/doc
-// OpenGL: http://www.opengl.org
-// GLUT: http://opengl.org/resources/libraries/glut
-//
-// @author Philippe Decaudin
-//
-// ---------------------------------------------------------------------------
-
-#include
-
-#if defined(_WIN32) || defined(_WIN64)
-// MiniGLUT.h is provided to avoid the need of having GLUT installed to
-// recompile this example. Do not use it in your own programs, better
-// install and use the actual GLUT library SDK.
-# define USE_MINI_GLUT
-#endif
-
-#if defined(USE_MINI_GLUT)
-# include "../src/MiniGLUT.h"
-#elif defined(_MACOSX)
-# include
-#else
-# include
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#if !defined _MSC_VER
-# define _snprintf snprintf
-#endif
-
-
-// ---------------------------------------------------------------------------
-// 1) Callback functions for std::string variables
-// ---------------------------------------------------------------------------
-
-// Function called to copy the content of a std::string (souceString) handled
-// by the AntTweakBar library to destinationClientString handled by our application
-void TW_CALL CopyStdStringToClient(std::string& destinationClientString, const std::string& sourceLibraryString)
-{
- destinationClientString = sourceLibraryString;
-}
-
-std::vector g_BarTitles;
-
-// Callback function called by AntTweakBar to set the "EditTitle" std::string variable
-void TW_CALL SetBarTitleCB(const void *value, void *clientData)
-{
- const std::string *newTitle = (const std::string *)(value);
- int barIndex = *(int *)(&clientData); // clientData stores the bar index
-
- // Stores the new bar title
- g_BarTitles[barIndex] = *newTitle;
-
- // Create the def command to change the bar label (ie., its title)
- std::stringstream def;
- def << "bar_" << barIndex << " label=`" << g_BarTitles[barIndex] << "`";
- // Execute the command
- TwDefine(def.str().c_str());
-}
-
-// Callback function called by AntTweakBar to get the "EditTitle" std::string variable
-void TW_CALL GetBarTitleCB(void *value, void *clientData)
-{
- std::string *destStringPtr = (std::string *)(value);
- int barIndex = *(int *)(&clientData); // clientData stores the bar index
- std::string title = g_BarTitles[barIndex];
-
- // Do not assign destStringPtr directly (see TwCopyStdStringToLibrary doc for explanation):
- // Use TwCopyStdStringToLibrary to copy the bar title string to AntTweakBar
- TwCopyStdStringToLibrary(*destStringPtr, title);
-}
-
-// Callback function to create a bar with a given title
-void TW_CALL CreateBarCB(void *clientData)
-{
- const std::string *title = (const std::string *)(clientData);
-
- // Create a unique bar name
- int barIndex = (int)g_BarTitles.size();
- std::stringstream name;
- name << "bar_" << barIndex;
-
- g_BarTitles.push_back(*title);
-
- // Create bar
- TwBar *bar = TwNewBar(name.str().c_str());
- TwAddButton(bar, "Info", NULL, NULL, " label='std::string variable:' ");
-
- // Set bar label (ie. the title)
- std::stringstream def;
- def << name.str() << " label=`" << *title << "` ";
- TwDefine(def.str().c_str());
-
- // Cast barNum as void* to use it as clientData
- // (doing so it could be directly sent through the get/set callbacks)
- void *barIndexAsVoidPtr = *(void **)&barIndex;
-
- // Add a std::string variable to the bar to edit its title,
- // The variable will be accessed through callbacks
- TwAddVarCB(bar, "EditTitle", TW_TYPE_STDSTRING, SetBarTitleCB, GetBarTitleCB, barIndexAsVoidPtr,
- " label='Edit bar title' help='Edit this string to change the tweak bar title.' ");
-}
-
-
-// ---------------------------------------------------------------------------
-// 2) Callback functions for C-Dynamic string variables
-// ---------------------------------------------------------------------------
-
-// Function called to copy the content of a C-Dynamic String (src) handled by
-// the AntTweakBar library to a C-Dynamic string (*destPtr) handled by our application
-void TW_CALL CopyCDStringToClient(char **destPtr, const char *src)
-{
- size_t srcLen = (src!=NULL) ? strlen(src) : 0;
- size_t destLen = (*destPtr!=NULL) ? strlen(*destPtr) : 0;
-
- // Alloc or realloc dest memory block if needed
- if( *destPtr==NULL )
- *destPtr = (char *)malloc(srcLen+1);
- else if( srcLen>destLen )
- *destPtr = (char *)realloc(*destPtr, srcLen+1);
-
- // Copy src
- if( srcLen>0 )
- strncpy(*destPtr, src, srcLen);
- (*destPtr)[srcLen] = '\0'; // null-terminated string
-}
-
-// Callback function called by AntTweakBar to set the "TextLine" CDString variable
-void TW_CALL SetTextLineCB(const void *value, void *clientData)
-{
- const char *src = *(const char **)value;
- char **destPtr = (char **)clientData;
-
- // Copies src to *destPtr (destPtr might be reallocated)
- CopyCDStringToClient(destPtr, src);
-
- // Change the label of the "Echo" inactive button
- size_t srcLen = strlen(src);
- if( srcLen>0 )
- {
- char *def = (char *)malloc(128+srcLen);
- _snprintf(def, 128+srcLen, " Main/Echo label=`%s` ", src);
- TwDefine(def);
- free(def);
- }
- else
- TwDefine(" Main/Echo label=` ` ");
-}
-
-// Callback function called by AntTweakBar to get the "TextLine" CDString variable
-void TW_CALL GetTextLineCB(void *value, void *clientData)
-{
- char **destPtr = (char **)value;
- char *src = *(char **)clientData;
-
- // Do not assign destPtr directly:
- // Use TwCopyCDStringToLibrary to copy TextLine to AntTweakBar
- TwCopyCDStringToLibrary(destPtr, src);
-}
-
-
-// ---------------------------------------------------------------------------
-// 3) Callback functions for C-Static sized string variables
-// ---------------------------------------------------------------------------
-
-// A static sized string
-char g_CapStr[17] = "16 chars max"; // 17 = 16 + the null termination char
-
-// A utility function: Convert a C string to lower or upper case
-void CaseCopy(char *dest, const char *src, size_t maxLength, int capCase)
-{
- size_t i;
- if( capCase==0 ) // lower case
- for( i=0; i size = 11
- TwAddVarRW(bar, "Ten", TW_TYPE_CSSTRING(sizeof(tenStr)), tenStr,
- " label='10 chars max' group=CSString help='A string with a length of 10 characters max.' ");
-
- // Add a CSString accessed through callbacks. The callbacks will convert the string characters to upper or lower case
- int capCase = 1; // O: lower-case, 1: upper-case
- TwAddVarCB(bar, "Capitalize", TW_TYPE_CSSTRING(sizeof(g_CapStr)), SetCapStrCB, GetCapStrCB, &capCase,
- " group=CSString help='A string of fixed size to be converted to upper or lower case.' ");
-
- // Add a bool variable
- TwAddVarRW(bar, "Case", TW_TYPE_BOOL32, &capCase,
- " false=lower true=UPPER group=CSString key=Space help=`Changes the characters case of the 'Capitalize' string.` ");
-
- // Set the group label & separator
- TwDefine(" Main/CSString label='Character capitalization' help='This example demonstates different use of C-Static sized variables.' ");
- TwAddSeparator(bar, "Sep3", "");
-
-
- // Call the GLUT main loop
- glutMainLoop();
-
- return 0;
-}
-
diff --git a/external/AntTweakBar/examples/d3d10vs2003.h b/external/AntTweakBar/examples/d3d10vs2003.h
deleted file mode 100644
index 7f32914..0000000
--- a/external/AntTweakBar/examples/d3d10vs2003.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Workaround to include D3D10.h with VS2003
-#ifndef __out
-#define __out
-#endif
-#ifndef __in
-#define __in
-#endif
-#ifndef __inout
-#define __inout
-#endif
-#ifndef __in_opt
-#define __in_opt
-#endif
-#ifndef __out_opt
-#define __out_opt
-#endif
-#ifndef __inout_opt
-#define __inout_opt
-#endif
-#ifndef __in_ecount
-#define __in_ecount(x)
-#endif
-#ifndef __in_ecount_opt
-#define __in_ecount_opt(x)
-#endif
-#ifndef __out_ecount
-#define __out_ecount(x)
-#endif
-#ifndef __out_ecount_opt
-#define __out_ecount_opt(x)
-#endif
-#ifndef __inout_ecount
-#define __inout_ecount(x)
-#endif
-#ifndef __inout_ecount_opt
-#define __inout_ecount_opt(x)
-#endif
-#ifndef __in_bcount_opt
-#define __in_bcount_opt(x)
-#endif
-#ifndef __out_bcount_opt
-#define __out_bcount_opt(x)
-#endif
-#ifndef __inout_bcount_opt
-#define __inout_bcount_opt(x)
-#endif
diff --git a/external/AntTweakBar/examples/glfw.h b/external/AntTweakBar/examples/glfw.h
deleted file mode 100644
index 63eb727..0000000
--- a/external/AntTweakBar/examples/glfw.h
+++ /dev/null
@@ -1,482 +0,0 @@
-//========================================================================
-// GLFW - An OpenGL framework
-// File: glfw.h
-// API version: 2.5
-// Author: Marcus Geelnard (marcus.geelnard at home.se)
-// WWW: http://glfw.sourceforge.net
-//------------------------------------------------------------------------
-// Copyright (c) 2002-2005 Marcus Geelnard
-//
-// This software is provided 'as-is', without any express or implied
-// warranty. In no event will the authors be held liable for any damages
-// arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it
-// freely, subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented; you must not
-// claim that you wrote the original software. If you use this software
-// in a product, an acknowledgment in the product documentation would
-// be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such, and must not
-// be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source
-// distribution.
-//
-// Marcus Geelnard
-// marcus.geelnard at home.se
-//------------------------------------------------------------------------
-// $Id: glfw.h,v 1.16 2005/03/14 20:52:51 marcus256 Exp $
-//========================================================================
-
-#ifndef __glfw_h_
-#define __glfw_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-//========================================================================
-// Global definitions
-//========================================================================
-
-// We need a NULL pointer from time to time
-#ifndef NULL
- #ifdef __cplusplus
- #define NULL 0
- #else
- #define NULL ((void *)0)
- #endif
-#endif // NULL
-
-
-// ------------------- BEGIN SYSTEM/COMPILER SPECIFIC --------------------
-
-// Please report any probles that you find with your compiler, which may
-// be solved in this section! There are several compilers that I have not
-// been able to test this file with yet.
-
-// First: If we are we on Windows, we want a single define for it (_WIN32)
-// (Note: For Cygwin the compiler flag -mwin32 should be used, but to
-// make sure that things run smoothly for Cygwin users, we add __CYGWIN__
-// to the list of "valid Win32 identifiers", which removes the need for
-// -mwin32)
-#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))
- #define _WIN32
-#endif // _WIN32
-
-// In order for extension support to be portable, we need to define an
-// OpenGL function call method. We use the keyword APIENTRY, which is
-// defined for Win32. (Note: Windows also needs this for )
-#ifndef APIENTRY
- #ifdef _WIN32
- #define APIENTRY __stdcall
- #else
- #define APIENTRY
- #endif
- #define GL_APIENTRY_DEFINED
-#endif // APIENTRY
-
-
-// The following three defines are here solely to make some Windows-based
-// files happy. Theoretically we could include , but
-// it has the major drawback of severely polluting our namespace.
-
-// Under Windows, we need WINGDIAPI defined
-#if !defined(WINGDIAPI) && defined(_WIN32)
- #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)
- // Microsoft Visual C++, Borland C++ Builder and Pelles C
- #define WINGDIAPI __declspec(dllimport)
- #elif defined(__LCC__)
- // LCC-Win32
- #define WINGDIAPI __stdcall
- #else
- // Others (e.g. MinGW, Cygwin)
- #define WINGDIAPI extern
- #endif
- #define GL_WINGDIAPI_DEFINED
-#endif // WINGDIAPI
-
-// Some files also need CALLBACK defined
-#if !defined(CALLBACK) && defined(_WIN32)
- #if defined(_MSC_VER)
- // Microsoft Visual C++
- #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
- #define CALLBACK __stdcall
- #else
- #define CALLBACK
- #endif
- #else
- // Other Windows compilers
- #define CALLBACK __stdcall
- #endif
- #define GLU_CALLBACK_DEFINED
-#endif // CALLBACK
-
-// Microsoft Visual C++, Borland C++ and Pelles C needs wchar_t
-#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)) && !defined(_WCHAR_T_DEFINED)
- typedef unsigned short wchar_t;
- #define _WCHAR_T_DEFINED
-#endif // _WCHAR_T_DEFINED
-
-
-// ---------------- GLFW related system specific defines -----------------
-
-#if defined(_WIN32) && defined(GLFW_BUILD_DLL)
-
- // We are building a Win32 DLL
- #define GLFWAPI __declspec(dllexport)
- #define GLFWAPIENTRY __stdcall
- #define GLFWCALL __stdcall
-
-#elif defined(_WIN32) && defined(GLFW_DLL)
-
- // We are calling a Win32 DLL
- #if defined(__LCC__)
- #define GLFWAPI extern
- #else
- #define GLFWAPI __declspec(dllimport)
- #endif
- #define GLFWAPIENTRY __stdcall
- #define GLFWCALL __stdcall
-
-#else
-
- // We are either building/calling a static lib or we are non-win32
- #define GLFWAPIENTRY
- #define GLFWAPI
- #define GLFWCALL
-
-#endif
-
-// -------------------- END SYSTEM/COMPILER SPECIFIC ---------------------
-
-// Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is
-// convenient for the user to only have to include . This also
-// solves the problem with Windows and needing some
-// special defines which normally requires the user to include
-// (which is not a nice solution for portable programs).
-#if defined(__APPLE_CC__)
- #include
- #include
-#else
- #include
- #include
-#endif
-
-
-//========================================================================
-// GLFW version
-//========================================================================
-
-#define GLFW_VERSION_MAJOR 2
-#define GLFW_VERSION_MINOR 5
-#define GLFW_VERSION_REVISION 0
-
-
-//========================================================================
-// Input handling definitions
-//========================================================================
-
-// Key and button state/action definitions
-#define GLFW_RELEASE 0
-#define GLFW_PRESS 1
-
-// Keyboard key definitions: 8-bit ISO-8859-1 (Latin 1) encoding is used
-// for printable keys (such as A-Z, 0-9 etc), and values above 256
-// represent special (non-printable) keys (e.g. F1, Page Up etc).
-#define GLFW_KEY_UNKNOWN -1
-#define GLFW_KEY_SPACE 32
-#define GLFW_KEY_SPECIAL 256
-#define GLFW_KEY_ESC (GLFW_KEY_SPECIAL+1)
-#define GLFW_KEY_F1 (GLFW_KEY_SPECIAL+2)
-#define GLFW_KEY_F2 (GLFW_KEY_SPECIAL+3)
-#define GLFW_KEY_F3 (GLFW_KEY_SPECIAL+4)
-#define GLFW_KEY_F4 (GLFW_KEY_SPECIAL+5)
-#define GLFW_KEY_F5 (GLFW_KEY_SPECIAL+6)
-#define GLFW_KEY_F6 (GLFW_KEY_SPECIAL+7)
-#define GLFW_KEY_F7 (GLFW_KEY_SPECIAL+8)
-#define GLFW_KEY_F8 (GLFW_KEY_SPECIAL+9)
-#define GLFW_KEY_F9 (GLFW_KEY_SPECIAL+10)
-#define GLFW_KEY_F10 (GLFW_KEY_SPECIAL+11)
-#define GLFW_KEY_F11 (GLFW_KEY_SPECIAL+12)
-#define GLFW_KEY_F12 (GLFW_KEY_SPECIAL+13)
-#define GLFW_KEY_F13 (GLFW_KEY_SPECIAL+14)
-#define GLFW_KEY_F14 (GLFW_KEY_SPECIAL+15)
-#define GLFW_KEY_F15 (GLFW_KEY_SPECIAL+16)
-#define GLFW_KEY_F16 (GLFW_KEY_SPECIAL+17)
-#define GLFW_KEY_F17 (GLFW_KEY_SPECIAL+18)
-#define GLFW_KEY_F18 (GLFW_KEY_SPECIAL+19)
-#define GLFW_KEY_F19 (GLFW_KEY_SPECIAL+20)
-#define GLFW_KEY_F20 (GLFW_KEY_SPECIAL+21)
-#define GLFW_KEY_F21 (GLFW_KEY_SPECIAL+22)
-#define GLFW_KEY_F22 (GLFW_KEY_SPECIAL+23)
-#define GLFW_KEY_F23 (GLFW_KEY_SPECIAL+24)
-#define GLFW_KEY_F24 (GLFW_KEY_SPECIAL+25)
-#define GLFW_KEY_F25 (GLFW_KEY_SPECIAL+26)
-#define GLFW_KEY_UP (GLFW_KEY_SPECIAL+27)
-#define GLFW_KEY_DOWN (GLFW_KEY_SPECIAL+28)
-#define GLFW_KEY_LEFT (GLFW_KEY_SPECIAL+29)
-#define GLFW_KEY_RIGHT (GLFW_KEY_SPECIAL+30)
-#define GLFW_KEY_LSHIFT (GLFW_KEY_SPECIAL+31)
-#define GLFW_KEY_RSHIFT (GLFW_KEY_SPECIAL+32)
-#define GLFW_KEY_LCTRL (GLFW_KEY_SPECIAL+33)
-#define GLFW_KEY_RCTRL (GLFW_KEY_SPECIAL+34)
-#define GLFW_KEY_LALT (GLFW_KEY_SPECIAL+35)
-#define GLFW_KEY_RALT (GLFW_KEY_SPECIAL+36)
-#define GLFW_KEY_TAB (GLFW_KEY_SPECIAL+37)
-#define GLFW_KEY_ENTER (GLFW_KEY_SPECIAL+38)
-#define GLFW_KEY_BACKSPACE (GLFW_KEY_SPECIAL+39)
-#define GLFW_KEY_INSERT (GLFW_KEY_SPECIAL+40)
-#define GLFW_KEY_DEL (GLFW_KEY_SPECIAL+41)
-#define GLFW_KEY_PAGEUP (GLFW_KEY_SPECIAL+42)
-#define GLFW_KEY_PAGEDOWN (GLFW_KEY_SPECIAL+43)
-#define GLFW_KEY_HOME (GLFW_KEY_SPECIAL+44)
-#define GLFW_KEY_END (GLFW_KEY_SPECIAL+45)
-#define GLFW_KEY_KP_0 (GLFW_KEY_SPECIAL+46)
-#define GLFW_KEY_KP_1 (GLFW_KEY_SPECIAL+47)
-#define GLFW_KEY_KP_2 (GLFW_KEY_SPECIAL+48)
-#define GLFW_KEY_KP_3 (GLFW_KEY_SPECIAL+49)
-#define GLFW_KEY_KP_4 (GLFW_KEY_SPECIAL+50)
-#define GLFW_KEY_KP_5 (GLFW_KEY_SPECIAL+51)
-#define GLFW_KEY_KP_6 (GLFW_KEY_SPECIAL+52)
-#define GLFW_KEY_KP_7 (GLFW_KEY_SPECIAL+53)
-#define GLFW_KEY_KP_8 (GLFW_KEY_SPECIAL+54)
-#define GLFW_KEY_KP_9 (GLFW_KEY_SPECIAL+55)
-#define GLFW_KEY_KP_DIVIDE (GLFW_KEY_SPECIAL+56)
-#define GLFW_KEY_KP_MULTIPLY (GLFW_KEY_SPECIAL+57)
-#define GLFW_KEY_KP_SUBTRACT (GLFW_KEY_SPECIAL+58)
-#define GLFW_KEY_KP_ADD (GLFW_KEY_SPECIAL+59)
-#define GLFW_KEY_KP_DECIMAL (GLFW_KEY_SPECIAL+60)
-#define GLFW_KEY_KP_EQUAL (GLFW_KEY_SPECIAL+61)
-#define GLFW_KEY_KP_ENTER (GLFW_KEY_SPECIAL+62)
-#define GLFW_KEY_LAST GLFW_KEY_KP_ENTER
-
-// Mouse button definitions
-#define GLFW_MOUSE_BUTTON_1 0
-#define GLFW_MOUSE_BUTTON_2 1
-#define GLFW_MOUSE_BUTTON_3 2
-#define GLFW_MOUSE_BUTTON_4 3
-#define GLFW_MOUSE_BUTTON_5 4
-#define GLFW_MOUSE_BUTTON_6 5
-#define GLFW_MOUSE_BUTTON_7 6
-#define GLFW_MOUSE_BUTTON_8 7
-#define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8
-
-// Mouse button aliases
-#define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1
-#define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2
-#define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3
-
-
-// Joystick identifiers
-#define GLFW_JOYSTICK_1 0
-#define GLFW_JOYSTICK_2 1
-#define GLFW_JOYSTICK_3 2
-#define GLFW_JOYSTICK_4 3
-#define GLFW_JOYSTICK_5 4
-#define GLFW_JOYSTICK_6 5
-#define GLFW_JOYSTICK_7 6
-#define GLFW_JOYSTICK_8 7
-#define GLFW_JOYSTICK_9 8
-#define GLFW_JOYSTICK_10 9
-#define GLFW_JOYSTICK_11 10
-#define GLFW_JOYSTICK_12 11
-#define GLFW_JOYSTICK_13 12
-#define GLFW_JOYSTICK_14 13
-#define GLFW_JOYSTICK_15 14
-#define GLFW_JOYSTICK_16 15
-#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16
-
-
-//========================================================================
-// Other definitions
-//========================================================================
-
-// glfwOpenWindow modes
-#define GLFW_WINDOW 0x00010001
-#define GLFW_FULLSCREEN 0x00010002
-
-// glfwGetWindowParam tokens
-#define GLFW_OPENED 0x00020001
-#define GLFW_ACTIVE 0x00020002
-#define GLFW_ICONIFIED 0x00020003
-#define GLFW_ACCELERATED 0x00020004
-#define GLFW_RED_BITS 0x00020005
-#define GLFW_GREEN_BITS 0x00020006
-#define GLFW_BLUE_BITS 0x00020007
-#define GLFW_ALPHA_BITS 0x00020008
-#define GLFW_DEPTH_BITS 0x00020009
-#define GLFW_STENCIL_BITS 0x0002000A
-
-// The following constants are used for both glfwGetWindowParam
-// and glfwOpenWindowHint
-#define GLFW_REFRESH_RATE 0x0002000B
-#define GLFW_ACCUM_RED_BITS 0x0002000C
-#define GLFW_ACCUM_GREEN_BITS 0x0002000D
-#define GLFW_ACCUM_BLUE_BITS 0x0002000E
-#define GLFW_ACCUM_ALPHA_BITS 0x0002000F
-#define GLFW_AUX_BUFFERS 0x00020010
-#define GLFW_STEREO 0x00020011
-
-// glfwEnable/glfwDisable tokens
-#define GLFW_MOUSE_CURSOR 0x00030001
-#define GLFW_STICKY_KEYS 0x00030002
-#define GLFW_STICKY_MOUSE_BUTTONS 0x00030003
-#define GLFW_SYSTEM_KEYS 0x00030004
-#define GLFW_KEY_REPEAT 0x00030005
-#define GLFW_AUTO_POLL_EVENTS 0x00030006
-
-// glfwWaitThread wait modes
-#define GLFW_WAIT 0x00040001
-#define GLFW_NOWAIT 0x00040002
-
-// glfwGetJoystickParam tokens
-#define GLFW_PRESENT 0x00050001
-#define GLFW_AXES 0x00050002
-#define GLFW_BUTTONS 0x00050003
-
-// glfwReadImage/glfwLoadTexture2D flags
-#define GLFW_NO_RESCALE_BIT 0x00000001 // Only for glfwReadImage
-#define GLFW_ORIGIN_UL_BIT 0x00000002
-#define GLFW_BUILD_MIPMAPS_BIT 0x00000004 // Only for glfwLoadTexture2D
-#define GLFW_ALPHA_MAP_BIT 0x00000008
-
-// Time spans longer than this (seconds) are considered to be infinity
-#define GLFW_INFINITY 100000.0
-
-
-//========================================================================
-// Typedefs
-//========================================================================
-
-// The video mode structure used by glfwGetVideoModes()
-typedef struct {
- int Width, Height;
- int RedBits, BlueBits, GreenBits;
-} GLFWvidmode;
-
-// Image/texture information
-typedef struct {
- int Width, Height;
- int Format;
- int BytesPerPixel;
- unsigned char *Data;
-} GLFWimage;
-
-// Thread ID
-typedef int GLFWthread;
-
-// Mutex object
-typedef void * GLFWmutex;
-
-// Condition variable object
-typedef void * GLFWcond;
-
-// Function pointer types
-typedef void (GLFWCALL * GLFWwindowsizefun)(int,int);
-typedef int (GLFWCALL * GLFWwindowclosefun)(void);
-typedef void (GLFWCALL * GLFWwindowrefreshfun)(void);
-typedef void (GLFWCALL * GLFWmousebuttonfun)(int,int);
-typedef void (GLFWCALL * GLFWmouseposfun)(int,int);
-typedef void (GLFWCALL * GLFWmousewheelfun)(int);
-typedef void (GLFWCALL * GLFWkeyfun)(int,int);
-typedef void (GLFWCALL * GLFWcharfun)(int,int);
-typedef void (GLFWCALL * GLFWthreadfun)(void *);
-
-
-//========================================================================
-// Prototypes
-//========================================================================
-
-// GLFW initialization, termination and version querying
-GLFWAPI int GLFWAPIENTRY glfwInit( void );
-GLFWAPI void GLFWAPIENTRY glfwTerminate( void );
-GLFWAPI void GLFWAPIENTRY glfwGetVersion( int *major, int *minor, int *rev );
-
-// Window handling
-GLFWAPI int GLFWAPIENTRY glfwOpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode );
-GLFWAPI void GLFWAPIENTRY glfwOpenWindowHint( int target, int hint );
-GLFWAPI void GLFWAPIENTRY glfwCloseWindow( void );
-GLFWAPI void GLFWAPIENTRY glfwSetWindowTitle( const char *title );
-GLFWAPI void GLFWAPIENTRY glfwGetWindowSize( int *width, int *height );
-GLFWAPI void GLFWAPIENTRY glfwSetWindowSize( int width, int height );
-GLFWAPI void GLFWAPIENTRY glfwSetWindowPos( int x, int y );
-GLFWAPI void GLFWAPIENTRY glfwIconifyWindow( void );
-GLFWAPI void GLFWAPIENTRY glfwRestoreWindow( void );
-GLFWAPI void GLFWAPIENTRY glfwSwapBuffers( void );
-GLFWAPI void GLFWAPIENTRY glfwSwapInterval( int interval );
-GLFWAPI int GLFWAPIENTRY glfwGetWindowParam( int param );
-GLFWAPI void GLFWAPIENTRY glfwSetWindowSizeCallback( GLFWwindowsizefun cbfun );
-GLFWAPI void GLFWAPIENTRY glfwSetWindowCloseCallback( GLFWwindowclosefun cbfun );
-GLFWAPI void GLFWAPIENTRY glfwSetWindowRefreshCallback( GLFWwindowrefreshfun cbfun );
-
-// Video mode functions
-GLFWAPI int GLFWAPIENTRY glfwGetVideoModes( GLFWvidmode *list, int maxcount );
-GLFWAPI void GLFWAPIENTRY glfwGetDesktopMode( GLFWvidmode *mode );
-
-// Input handling
-GLFWAPI void GLFWAPIENTRY glfwPollEvents( void );
-GLFWAPI void GLFWAPIENTRY glfwWaitEvents( void );
-GLFWAPI int GLFWAPIENTRY glfwGetKey( int key );
-GLFWAPI int GLFWAPIENTRY glfwGetMouseButton( int button );
-GLFWAPI void GLFWAPIENTRY glfwGetMousePos( int *xpos, int *ypos );
-GLFWAPI void GLFWAPIENTRY glfwSetMousePos( int xpos, int ypos );
-GLFWAPI int GLFWAPIENTRY glfwGetMouseWheel( void );
-GLFWAPI void GLFWAPIENTRY glfwSetMouseWheel( int pos );
-GLFWAPI void GLFWAPIENTRY glfwSetKeyCallback( GLFWkeyfun cbfun );
-GLFWAPI void GLFWAPIENTRY glfwSetCharCallback( GLFWcharfun cbfun );
-GLFWAPI void GLFWAPIENTRY glfwSetMouseButtonCallback( GLFWmousebuttonfun cbfun );
-GLFWAPI void GLFWAPIENTRY glfwSetMousePosCallback( GLFWmouseposfun cbfun );
-GLFWAPI void GLFWAPIENTRY glfwSetMouseWheelCallback( GLFWmousewheelfun cbfun );
-
-// Joystick input
-GLFWAPI int GLFWAPIENTRY glfwGetJoystickParam( int joy, int param );
-GLFWAPI int GLFWAPIENTRY glfwGetJoystickPos( int joy, float *pos, int numaxes );
-GLFWAPI int GLFWAPIENTRY glfwGetJoystickButtons( int joy, unsigned char *buttons, int numbuttons );
-
-// Time
-GLFWAPI double GLFWAPIENTRY glfwGetTime( void );
-GLFWAPI void GLFWAPIENTRY glfwSetTime( double time );
-GLFWAPI void GLFWAPIENTRY glfwSleep( double time );
-
-// Extension support
-GLFWAPI int GLFWAPIENTRY glfwExtensionSupported( const char *extension );
-GLFWAPI void* GLFWAPIENTRY glfwGetProcAddress( const char *procname );
-GLFWAPI void GLFWAPIENTRY glfwGetGLVersion( int *major, int *minor, int *rev );
-
-// Threading support
-GLFWAPI GLFWthread GLFWAPIENTRY glfwCreateThread( GLFWthreadfun fun, void *arg );
-GLFWAPI void GLFWAPIENTRY glfwDestroyThread( GLFWthread ID );
-GLFWAPI int GLFWAPIENTRY glfwWaitThread( GLFWthread ID, int waitmode );
-GLFWAPI GLFWthread GLFWAPIENTRY glfwGetThreadID( void );
-GLFWAPI GLFWmutex GLFWAPIENTRY glfwCreateMutex( void );
-GLFWAPI void GLFWAPIENTRY glfwDestroyMutex( GLFWmutex mutex );
-GLFWAPI void GLFWAPIENTRY glfwLockMutex( GLFWmutex mutex );
-GLFWAPI void GLFWAPIENTRY glfwUnlockMutex( GLFWmutex mutex );
-GLFWAPI GLFWcond GLFWAPIENTRY glfwCreateCond( void );
-GLFWAPI void GLFWAPIENTRY glfwDestroyCond( GLFWcond cond );
-GLFWAPI void GLFWAPIENTRY glfwWaitCond( GLFWcond cond, GLFWmutex mutex, double timeout );
-GLFWAPI void GLFWAPIENTRY glfwSignalCond( GLFWcond cond );
-GLFWAPI void GLFWAPIENTRY glfwBroadcastCond( GLFWcond cond );
-GLFWAPI int GLFWAPIENTRY glfwGetNumberOfProcessors( void );
-
-// Enable/disable functions
-GLFWAPI void GLFWAPIENTRY glfwEnable( int token );
-GLFWAPI void GLFWAPIENTRY glfwDisable( int token );
-
-// Image/texture I/O support
-GLFWAPI int GLFWAPIENTRY glfwReadImage( const char *name, GLFWimage *img, int flags );
-GLFWAPI void GLFWAPIENTRY glfwFreeImage( GLFWimage *img );
-GLFWAPI int GLFWAPIENTRY glfwLoadTexture2D( const char *name, int flags );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __glfw_h_
diff --git a/external/AntTweakBar/examples/vis_stud_stuff.tar.gz b/external/AntTweakBar/examples/vis_stud_stuff.tar.gz
deleted file mode 100644
index 1b348db..0000000
Binary files a/external/AntTweakBar/examples/vis_stud_stuff.tar.gz and /dev/null differ
diff --git a/external/AntTweakBar/include/AntTweakBar.h b/external/AntTweakBar/include/AntTweakBar.h
deleted file mode 100644
index 24ff223..0000000
--- a/external/AntTweakBar/include/AntTweakBar.h
+++ /dev/null
@@ -1,378 +0,0 @@
-// ----------------------------------------------------------------------------
-//
-// @file AntTweakBar.h
-//
-// @brief AntTweakBar is a light and intuitive graphical user interface
-// that can be readily integrated into OpenGL and DirectX
-// applications in order to interactively tweak parameters.
-//
-// @author Philippe Decaudin
-//
-// @doc http://anttweakbar.sourceforge.net/doc
-//
-// @license This file is part of the AntTweakBar library.
-// AntTweakBar is a free software released under the zlib license.
-// For conditions of distribution and use, see License.txt
-//
-// ----------------------------------------------------------------------------
-
-
-#if !defined TW_INCLUDED
-#define TW_INCLUDED
-
-#include
-
-#define TW_VERSION 116 // Version Mmm : M=Major mm=minor (e.g., 102 is version 1.02)
-
-
-#ifdef __cplusplus
-# if defined(_MSC_VER)
-# pragma warning(push)
-# pragma warning(disable: 4995 4530)
-# include
-# pragma warning(pop)
-# else
-# include
-# endif
- extern "C" {
-#endif // __cplusplus
-
-
-// ----------------------------------------------------------------------------
-// OS specific definitions
-// ----------------------------------------------------------------------------
-
-#if (defined(_WIN32) || defined(_WIN64)) && !defined(TW_STATIC)
-# define TW_CALL __stdcall
-# define TW_CDECL_CALL __cdecl
-# define TW_EXPORT_API __declspec(dllexport)
-# define TW_IMPORT_API __declspec(dllimport)
-#else
-# define TW_CALL
-# define TW_CDECL_CALL
-# define TW_EXPORT_API
-# define TW_IMPORT_API
-#endif
-
-#if defined TW_EXPORTS
-# define TW_API TW_EXPORT_API
-#elif defined TW_STATIC
-# define TW_API
-# if defined(_MSC_VER) && !defined(TW_NO_LIB_PRAGMA)
-# ifdef _WIN64
-# pragma comment(lib, "AntTweakBarStatic64")
-# else
-# pragma comment(lib, "AntTweakBarStatic")
-# endif
-# endif
-#else
-# define TW_API TW_IMPORT_API
-# if defined(_MSC_VER) && !defined(TW_NO_LIB_PRAGMA)
-# ifdef _WIN64
-# pragma comment(lib, "AntTweakBar64")
-# else
-# pragma comment(lib, "AntTweakBar")
-# endif
-# endif
-#endif
-
-
-// ----------------------------------------------------------------------------
-// Bar functions and definitions
-// ----------------------------------------------------------------------------
-
-typedef struct CTwBar TwBar; // structure CTwBar is not exposed.
-
-TW_API TwBar * TW_CALL TwNewBar(const char *barName);
-TW_API int TW_CALL TwDeleteBar(TwBar *bar);
-TW_API int TW_CALL TwDeleteAllBars();
-TW_API int TW_CALL TwSetTopBar(const TwBar *bar);
-TW_API TwBar * TW_CALL TwGetTopBar();
-TW_API int TW_CALL TwSetBottomBar(const TwBar *bar);
-TW_API TwBar * TW_CALL TwGetBottomBar();
-TW_API const char * TW_CALL TwGetBarName(const TwBar *bar);
-TW_API int TW_CALL TwGetBarCount();
-TW_API TwBar * TW_CALL TwGetBarByIndex(int barIndex);
-TW_API TwBar * TW_CALL TwGetBarByName(const char *barName);
-TW_API int TW_CALL TwRefreshBar(TwBar *bar);
-
-// ----------------------------------------------------------------------------
-// Var functions and definitions
-// ----------------------------------------------------------------------------
-
-typedef enum ETwType
-{
- TW_TYPE_UNDEF = 0,
-#ifdef __cplusplus
- TW_TYPE_BOOLCPP = 1,
-#endif // __cplusplus
- TW_TYPE_BOOL8 = 2,
- TW_TYPE_BOOL16,
- TW_TYPE_BOOL32,
- TW_TYPE_CHAR,
- TW_TYPE_INT8,
- TW_TYPE_UINT8,
- TW_TYPE_INT16,
- TW_TYPE_UINT16,
- TW_TYPE_INT32,
- TW_TYPE_UINT32,
- TW_TYPE_FLOAT,
- TW_TYPE_DOUBLE,
- TW_TYPE_COLOR32, // 32 bits color. Order is RGBA if API is OpenGL or Direct3D10, and inversed if API is Direct3D9 (can be modified by defining 'colorOrder=...', see doc)
- TW_TYPE_COLOR3F, // 3 floats color. Order is RGB.
- TW_TYPE_COLOR4F, // 4 floats color. Order is RGBA.
- TW_TYPE_CDSTRING, // Null-terminated C Dynamic String (pointer to an array of char dynamically allocated with malloc/realloc/strdup)
-#ifdef __cplusplus
-# if defined(_MSC_VER) && (_MSC_VER == 1600)
- TW_TYPE_STDSTRING = (0x2ffe0000+sizeof(std::string)), // VS2010 C++ STL string (std::string)
-# else
- TW_TYPE_STDSTRING = (0x2fff0000+sizeof(std::string)), // C++ STL string (std::string)
-# endif
-#endif // __cplusplus
- TW_TYPE_QUAT4F = TW_TYPE_CDSTRING+2, // 4 floats encoding a quaternion {qx,qy,qz,qs}
- TW_TYPE_QUAT4D, // 4 doubles encoding a quaternion {qx,qy,qz,qs}
- TW_TYPE_DIR3F, // direction vector represented by 3 floats
- TW_TYPE_DIR3D // direction vector represented by 3 doubles
-} TwType;
-#define TW_TYPE_CSSTRING(n) ((TwType)(0x30000000+((n)&0xfffffff))) // Null-terminated C Static String of size n (defined as char[n], with n<2^28)
-
-typedef void (TW_CALL * TwSetVarCallback)(const void *value, void *clientData);
-typedef void (TW_CALL * TwGetVarCallback)(void *value, void *clientData);
-typedef void (TW_CALL * TwButtonCallback)(void *clientData);
-
-TW_API int TW_CALL TwAddVarRW(TwBar *bar, const char *name, TwType type, void *var, const char *def);
-TW_API int TW_CALL TwAddVarRO(TwBar *bar, const char *name, TwType type, const void *var, const char *def);
-TW_API int TW_CALL TwAddVarCB(TwBar *bar, const char *name, TwType type, TwSetVarCallback setCallback, TwGetVarCallback getCallback, void *clientData, const char *def);
-TW_API int TW_CALL TwAddButton(TwBar *bar, const char *name, TwButtonCallback callback, void *clientData, const char *def);
-TW_API int TW_CALL TwAddSeparator(TwBar *bar, const char *name, const char *def);
-TW_API int TW_CALL TwRemoveVar(TwBar *bar, const char *name);
-TW_API int TW_CALL TwRemoveAllVars(TwBar *bar);
-
-typedef struct CTwEnumVal
-{
- int Value;
- const char * Label;
-} TwEnumVal;
-typedef struct CTwStructMember
-{
- const char * Name;
- TwType Type;
- size_t Offset;
- const char * DefString;
-} TwStructMember;
-typedef void (TW_CALL * TwSummaryCallback)(char *summaryString, size_t summaryMaxLength, const void *value, void *clientData);
-
-TW_API int TW_CALL TwDefine(const char *def);
-TW_API TwType TW_CALL TwDefineEnum(const char *name, const TwEnumVal *enumValues, unsigned int nbValues);
-TW_API TwType TW_CALL TwDefineEnumFromString(const char *name, const char *enumString);
-TW_API TwType TW_CALL TwDefineStruct(const char *name, const TwStructMember *structMembers, unsigned int nbMembers, size_t structSize, TwSummaryCallback summaryCallback, void *summaryClientData);
-
-typedef void (TW_CALL * TwCopyCDStringToClient)(char **destinationClientStringPtr, const char *sourceString);
-TW_API void TW_CALL TwCopyCDStringToClientFunc(TwCopyCDStringToClient copyCDStringFunc);
-TW_API void TW_CALL TwCopyCDStringToLibrary(char **destinationLibraryStringPtr, const char *sourceClientString);
-#ifdef __cplusplus
-typedef void (TW_CALL * TwCopyStdStringToClient)(std::string& destinationClientString, const std::string& sourceString);
-TW_API void TW_CALL TwCopyStdStringToClientFunc(TwCopyStdStringToClient copyStdStringToClientFunc);
-TW_API void TW_CALL TwCopyStdStringToLibrary(std::string& destinationLibraryString, const std::string& sourceClientString);
-#endif // __cplusplus
-
-typedef enum ETwParamValueType
-{
- TW_PARAM_INT32,
- TW_PARAM_FLOAT,
- TW_PARAM_DOUBLE,
- TW_PARAM_CSTRING // Null-terminated array of char (ie, c-string)
-} TwParamValueType;
-TW_API int TW_CALL TwGetParam(TwBar *bar, const char *varName, const char *paramName, TwParamValueType paramValueType, unsigned int outValueMaxCount, void *outValues);
-TW_API int TW_CALL TwSetParam(TwBar *bar, const char *varName, const char *paramName, TwParamValueType paramValueType, unsigned int inValueCount, const void *inValues);
-
-
-// ----------------------------------------------------------------------------
-// Management functions and definitions
-// ----------------------------------------------------------------------------
-
-typedef enum ETwGraphAPI
-{
- TW_OPENGL = 1,
- TW_DIRECT3D9 = 2,
- TW_DIRECT3D10 = 3,
- TW_DIRECT3D11 = 4,
- TW_OPENGL_CORE = 5
-} TwGraphAPI;
-
-TW_API int TW_CALL TwInit(TwGraphAPI graphAPI, void *device);
-TW_API int TW_CALL TwTerminate();
-
-TW_API int TW_CALL TwDraw();
-TW_API int TW_CALL TwWindowSize(int width, int height);
-
-TW_API int TW_CALL TwSetCurrentWindow(int windowID); // multi-windows support
-TW_API int TW_CALL TwGetCurrentWindow();
-TW_API int TW_CALL TwWindowExists(int windowID);
-
-typedef enum ETwKeyModifier
-{
- TW_KMOD_NONE = 0x0000, // same codes as SDL keysym.mod
- TW_KMOD_SHIFT = 0x0003,
- TW_KMOD_CTRL = 0x00c0,
- TW_KMOD_ALT = 0x0100,
- TW_KMOD_META = 0x0c00
-} TwKeyModifier;
-typedef enum EKeySpecial
-{
- TW_KEY_BACKSPACE = '\b',
- TW_KEY_TAB = '\t',
- TW_KEY_CLEAR = 0x0c,
- TW_KEY_RETURN = '\r',
- TW_KEY_PAUSE = 0x13,
- TW_KEY_ESCAPE = 0x1b,
- TW_KEY_SPACE = ' ',
- TW_KEY_DELETE = 0x7f,
- TW_KEY_UP = 273, // same codes and order as SDL 1.2 keysym.sym
- TW_KEY_DOWN,
- TW_KEY_RIGHT,
- TW_KEY_LEFT,
- TW_KEY_INSERT,
- TW_KEY_HOME,
- TW_KEY_END,
- TW_KEY_PAGE_UP,
- TW_KEY_PAGE_DOWN,
- TW_KEY_F1,
- TW_KEY_F2,
- TW_KEY_F3,
- TW_KEY_F4,
- TW_KEY_F5,
- TW_KEY_F6,
- TW_KEY_F7,
- TW_KEY_F8,
- TW_KEY_F9,
- TW_KEY_F10,
- TW_KEY_F11,
- TW_KEY_F12,
- TW_KEY_F13,
- TW_KEY_F14,
- TW_KEY_F15,
- TW_KEY_LAST
-} TwKeySpecial;
-
-TW_API int TW_CALL TwKeyPressed(int key, int modifiers);
-TW_API int TW_CALL TwKeyTest(int key, int modifiers);
-
-typedef enum ETwMouseAction
-{
- TW_MOUSE_RELEASED,
- TW_MOUSE_PRESSED
-} TwMouseAction;
-typedef enum ETwMouseButtonID
-{
- TW_MOUSE_LEFT = 1, // same code as SDL_BUTTON_LEFT
- TW_MOUSE_MIDDLE = 2, // same code as SDL_BUTTON_MIDDLE
- TW_MOUSE_RIGHT = 3 // same code as SDL_BUTTON_RIGHT
-} TwMouseButtonID;
-
-TW_API int TW_CALL TwMouseButton(TwMouseAction action, TwMouseButtonID button);
-TW_API int TW_CALL TwMouseMotion(int mouseX, int mouseY);
-TW_API int TW_CALL TwMouseWheel(int pos);
-
-TW_API const char * TW_CALL TwGetLastError();
-typedef void (TW_CALL * TwErrorHandler)(const char *errorMessage);
-TW_API void TW_CALL TwHandleErrors(TwErrorHandler errorHandler);
-
-
-// ----------------------------------------------------------------------------
-// Helper functions to translate events from some common window management
-// frameworks to AntTweakBar.
-// They call TwKeyPressed, TwMouse* and TwWindowSize for you (implemented in
-// files TwEventWin.c TwEventSDL*.c TwEventGLFW.c TwEventGLUT.c)
-// ----------------------------------------------------------------------------
-
-// For Windows message proc
-#ifndef _W64 // Microsoft specific (detection of 64 bits portability issues)
-# define _W64
-#endif // _W64
-#ifdef _WIN64
- TW_API int TW_CALL TwEventWin(void *wnd, unsigned int msg, unsigned __int64 _W64 wParam, __int64 _W64 lParam);
-#else
- TW_API int TW_CALL TwEventWin(void *wnd, unsigned int msg, unsigned int _W64 wParam, int _W64 lParam);
-#endif
-#define TwEventWin32 TwEventWin // For compatibility with AntTweakBar versions prior to 1.11
-
-// For libSDL event loop
-TW_API int TW_CALL TwEventSDL(const void *sdlEvent, unsigned char sdlMajorVersion, unsigned char sdlMinorVersion);
-
-// For GLFW event callbacks
-// You should define GLFW_CDECL before including AntTweakBar.h if your version of GLFW uses cdecl calling convensions
-#ifdef GLFW_CDECL
- TW_API int TW_CDECL_CALL TwEventMouseButtonGLFWcdecl(int glfwButton, int glfwAction);
- TW_API int TW_CDECL_CALL TwEventKeyGLFWcdecl(int glfwKey, int glfwAction);
- TW_API int TW_CDECL_CALL TwEventCharGLFWcdecl(int glfwChar, int glfwAction);
- TW_API int TW_CDECL_CALL TwEventMousePosGLFWcdecl(int mouseX, int mouseY);
- TW_API int TW_CDECL_CALL TwEventMouseWheelGLFWcdecl(int wheelPos);
-# define TwEventMouseButtonGLFW TwEventMouseButtonGLFWcdecl
-# define TwEventKeyGLFW TwEventKeyGLFWcdecl
-# define TwEventCharGLFW TwEventCharGLFWcdecl
-# define TwEventMousePosGLFW TwEventMousePosGLFWcdecl
-# define TwEventMouseWheelGLFW TwEventMouseWheelGLFWcdecl
-#else
- TW_API int TW_CALL TwEventMouseButtonGLFW(int glfwButton, int glfwAction);
- TW_API int TW_CALL TwEventKeyGLFW(int glfwKey, int glfwAction);
- TW_API int TW_CALL TwEventCharGLFW(int glfwChar, int glfwAction);
-# define TwEventMousePosGLFW TwMouseMotion
-# define TwEventMouseWheelGLFW TwMouseWheel
-#endif
-
-// For GLUT event callbacks (Windows calling convention for GLUT callbacks is cdecl)
-#if defined(_WIN32) || defined(_WIN64)
-# define TW_GLUT_CALL TW_CDECL_CALL
-#else
-# define TW_GLUT_CALL
-#endif
-TW_API int TW_GLUT_CALL TwEventMouseButtonGLUT(int glutButton, int glutState, int mouseX, int mouseY);
-TW_API int TW_GLUT_CALL TwEventMouseMotionGLUT(int mouseX, int mouseY);
-TW_API int TW_GLUT_CALL TwEventKeyboardGLUT(unsigned char glutKey, int mouseX, int mouseY);
-TW_API int TW_GLUT_CALL TwEventSpecialGLUT(int glutKey, int mouseX, int mouseY);
-TW_API int TW_CALL TwGLUTModifiersFunc(int (TW_CALL *glutGetModifiersFunc)(void));
-typedef void (TW_GLUT_CALL *GLUTmousebuttonfun)(int glutButton, int glutState, int mouseX, int mouseY);
-typedef void (TW_GLUT_CALL *GLUTmousemotionfun)(int mouseX, int mouseY);
-typedef void (TW_GLUT_CALL *GLUTkeyboardfun)(unsigned char glutKey, int mouseX, int mouseY);
-typedef void (TW_GLUT_CALL *GLUTspecialfun)(int glutKey, int mouseX, int mouseY);
-
-// For SFML event loop
-TW_API int TW_CALL TwEventSFML(const void *sfmlEvent, unsigned char sfmlMajorVersion, unsigned char sfmlMinorVersion);
-
-// For X11 event loop
-#if defined(_UNIX)
- TW_API int TW_CDECL_CALL TwEventX11(void *xevent);
-#endif
-
-// ----------------------------------------------------------------------------
-// Make sure the types have the right sizes
-// ----------------------------------------------------------------------------
-
-#define TW_COMPILE_TIME_ASSERT(name, x) typedef int TW_DUMMY_ ## name[(x) * 2 - 1]
-
-TW_COMPILE_TIME_ASSERT(TW_CHAR, sizeof(char) == 1);
-TW_COMPILE_TIME_ASSERT(TW_SHORT, sizeof(short) == 2);
-TW_COMPILE_TIME_ASSERT(TW_INT, sizeof(int) == 4);
-TW_COMPILE_TIME_ASSERT(TW_FLOAT, sizeof(float) == 4);
-TW_COMPILE_TIME_ASSERT(TW_DOUBLE, sizeof(double) == 8);
-
-// Check pointer size on Windows
-#if !defined(_WIN64) && defined(_WIN32)
- // If the following assert failed, the platform is not 32-bit and _WIN64 is not defined.
- // When targetting 64-bit Windows platform, _WIN64 must be defined.
- TW_COMPILE_TIME_ASSERT(TW_PTR32, sizeof(void*) == 4);
-#elif defined(_WIN64)
- // If the following assert failed, _WIN64 is defined but the targeted platform is not 64-bit.
- TW_COMPILE_TIME_ASSERT(TW_PTR64, sizeof(void*) == 8);
-#endif
-
-// ---------------------------------------------------------------------------
-
-
-#ifdef __cplusplus
- } // extern "C"
-#endif // __cplusplus
-
-
-#endif // !defined TW_INCLUDED
diff --git a/external/AntTweakBar/lib/Readme.txt b/external/AntTweakBar/lib/Readme.txt
deleted file mode 100644
index c54c5e1..0000000
--- a/external/AntTweakBar/lib/Readme.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-These files are part of the AntTweakBar library.
-http://anttweakbar.sourceforge.net/doc
diff --git a/external/AntTweakBar/src/AntPerfTimer.h b/external/AntTweakBar/src/AntPerfTimer.h
deleted file mode 100644
index bd969a6..0000000
--- a/external/AntTweakBar/src/AntPerfTimer.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file AntPerfTimer.h
-// @brief A performance (precision) timer for benchs
-// @author Philippe Decaudin
-// @license This file is part of the AntTweakBar library.
-// For conditions of distribution and use, see License.txt
-//
-// note: No cpp file is needed, everything is defined in this header
-//
-// ---------------------------------------------------------------------------
-
-#if !defined ANT_PERF_TIMER_INCLUDED
-#define ANT_PERF_TIMER_INCLUDED
-
-#ifndef __cplusplus
-# error This is a C++ header
-#endif // __cplusplus
-
-
-#if defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64)
-
- #include
- #include
-
- struct PerfTimer
- {
- inline PerfTimer() { if( !QueryPerformanceFrequency(&Freq) ) MessageBox(NULL, _T("Precision timer not supported"), _T("Problem"), MB_ICONEXCLAMATION); Reset(); }
- inline void Reset() { QueryPerformanceCounter(&Start); }
- inline double GetTime() { if( QueryPerformanceCounter(&End) ) return ((double)End.QuadPart - (double)Start.QuadPart)/((double)Freq.QuadPart); else return 0; }
- protected:
- LARGE_INTEGER Start, End, Freq;
- };
-
-#else // !_WIN (-> LINUX)
-
- #include
- #include
-
- struct PerfTimer
- {
- inline PerfTimer() { Reset(); }
- inline void Reset() { gettimeofday(&Start, &TZ); }
- inline double GetTime() { gettimeofday(&End,&TZ);
- double t1 = (double)Start.tv_sec + (double)Start.tv_usec/(1000*1000);
- double t2 = (double)End.tv_sec + (double)End.tv_usec/(1000*1000);
- return t2-t1; }
- protected:
- struct timeval Start, End;
- struct timezone TZ;
- };
-
-#endif // _WIN
-
-
-#endif // ANT_PERF_TIMER_INCLUDED
diff --git a/external/AntTweakBar/src/AntTweakBar.rc b/external/AntTweakBar/src/AntTweakBar.rc
deleted file mode 100644
index 07ae955..0000000
--- a/external/AntTweakBar/src/AntTweakBar.rc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-//#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Français (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-#ifdef _WIN32
-//LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Cursor
-//
-
-IDC_CURSOR1 CURSOR "res\\cur00013.cur"
-IDC_CURSOR2 CURSOR "res\\cur00000.cur"
-IDC_CURSOR3 CURSOR "res\\cur00001.cur"
-IDC_CURSOR4 CURSOR "res\\cur00002.cur"
-IDC_CURSOR5 CURSOR "res\\cur00003.cur"
-IDC_CURSOR6 CURSOR "res\\cur00004.cur"
-IDC_CURSOR7 CURSOR "res\\cur00005.cur"
-IDC_CURSOR8 CURSOR "res\\cur00006.cur"
-IDC_CURSOR9 CURSOR "res\\cur00007.cur"
-IDC_CURSOR10 CURSOR "res\\cur00008.cur"
-IDC_CURSOR11 CURSOR "res\\cur00009.cur"
-IDC_CURSOR12 CURSOR "res\\cur00010.cur"
-IDC_CURSOR13 CURSOR "res\\cur00011.cur"
-IDC_CURSOR14 CURSOR "res\\cur00012.cur"
-#endif // Français (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/external/AntTweakBar/src/AntTweakBar.vcproj b/external/AntTweakBar/src/AntTweakBar.vcproj
deleted file mode 100644
index 53655cf..0000000
--- a/external/AntTweakBar/src/AntTweakBar.vcproj
+++ /dev/null
@@ -1,1025 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/external/AntTweakBar/src/AntTweakBar.vcxproj b/external/AntTweakBar/src/AntTweakBar.vcxproj
deleted file mode 100644
index cd019db..0000000
--- a/external/AntTweakBar/src/AntTweakBar.vcxproj
+++ /dev/null
@@ -1,491 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}
- AntTweakBar
-
-
-
- DynamicLibrary
- v110
- false
- MultiByte
-
-
- DynamicLibrary
- v110
- false
- MultiByte
- true
-
-
- DynamicLibrary
- v110
- false
- MultiByte
-
-
- DynamicLibrary
- v110
- false
- MultiByte
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>11.0.50727.1
-
-
- $(SolutionDir)$(Configuration)\
- release32\
- false
- false
-
-
- $(SolutionDir)$(Configuration)\
- release64\
- false
- false
- $(ProjectName)64
-
-
- $(SolutionDir)$(Configuration)\
- debug32\
- true
-
-
- $(SolutionDir)$(Configuration)\
- debug64\
- true
- $(ProjectName)64
-
-
-
- fxc /T vs_4_0_level_9_1 /E LineRectVS /Fh $(IntDir)TwDirect3D11_LineRectVS.h TwDirect3D11.hlsl
-fxc /T vs_4_0_level_9_1 /E LineRectCstColorVS /Fh $(IntDir)TwDirect3D11_LineRectCstColorVS.h TwDirect3D11.hlsl
-fxc /T ps_4_0_level_9_1 /E LineRectPS /Fh $(IntDir)TwDirect3D11_LineRectPS.h TwDirect3D11.hlsl
-fxc /T vs_4_0_level_9_1 /E TextVS /Fh $(IntDir)TwDirect3D11_TextVS.h TwDirect3D11.hlsl
-fxc /T vs_4_0_level_9_1 /E TextCstColorVS /Fh $(IntDir)TwDirect3D11_TextCstColorVS.h TwDirect3D11.hlsl
-fxc /T ps_4_0_level_9_1 /E TextPS /Fh $(IntDir)TwDirect3D11_TextPS.h TwDirect3D11.hlsl
-
-
-
- NDEBUG;%(PreprocessorDefinitions)
- true
- true
- Win32
- $(OutDir)AntTweakBar.tlb
-
-
- Full
- OnlyExplicitInline
- true
- Speed
- ../include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;_USRDLL;TW_EXPORTS;%(PreprocessorDefinitions)
- true
-
- MultiThreaded
- true
- true
- Use
- TwPrecomp.h
- $(IntDir)AntTweakBar.pch
- $(IntDir)
- $(IntDir)
- $(IntDir)
- Level4
- true
-
- Default
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x0409
- res;%(AdditionalIncludeDirectories)
-
-
- false
- $(OutDir)AntTweakBar.dll
- true
- false
- $(OutDir)$(TargetName).pdb
- false
- true
- false
-
- $(OutDir)$(TargetName).lib
- MachineX86
-
-
-
-
-
-
-
-
- fxc /T vs_4_0_level_9_1 /E LineRectVS /Fh $(IntDir)TwDirect3D11_LineRectVS.h TwDirect3D11.hlsl
-fxc/T vs_4_0_level_9_1 /E LineRectCstColorVS /Fh $(IntDir)TwDirect3D11_LineRectCstColorVS.h TwDirect3D11.hlsl
-fxc /T ps_4_0_level_9_1 /E LineRectPS /Fh $(IntDir)TwDirect3D11_LineRectPS.h TwDirect3D11.hlsl
-fxc /T vs_4_0_level_9_1 /E TextVS /Fh $(IntDir)TwDirect3D11_TextVS.h TwDirect3D11.hlsl
-fxc /T vs_4_0_level_9_1 /E TextCstColorVS /Fh $(IntDir)TwDirect3D11_TextCstColorVS.h TwDirect3D11.hlsl
-fxc /T ps_4_0_level_9_1 /E TextPS /Fh $(IntDir)TwDirect3D11_TextPS.h TwDirect3D11.hlsl
-
-
-
- NDEBUG;%(PreprocessorDefinitions)
- true
- true
- X64
- $(OutDir)AntTweakBar.tlb
-
-
- Full
- OnlyExplicitInline
- true
- Speed
- ../include;%(AdditionalIncludeDirectories)
- WIN64;_WIN64;NDEBUG;_WINDOWS;_USRDLL;TW_EXPORTS;%(PreprocessorDefinitions)
- true
-
- MultiThreaded
- true
- true
- Use
- TwPrecomp.h
- $(IntDir)AntTweakBar.pch
- $(IntDir)
- $(IntDir)
- $(IntDir)
- Level4
- true
-
- Default
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x0409
- res;%(AdditionalIncludeDirectories)
-
-
- false
- $(OutDir)AntTweakBar64.dll
- true
- false
- $(OutDir)$(TargetName).pdb
- false
- true
- false
-
- $(OutDir)$(TargetName).lib
- MachineX64
-
-
- xcopy /y /f ..\lib\AntTweakBar64.dll ..\examples\bin64
-
-
-
-
- fxc /Od /Zi /T vs_4_0_level_9_1 /E LineRectVS /Fh $(IntDir)TwDirect3D11_LineRectVS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T vs_4_0_level_9_1 /E LineRectCstColorVS /Fh $(IntDir)TwDirect3D11_LineRectCstColorVS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T ps_4_0_level_9_1 /E LineRectPS /Fh $(IntDir)TwDirect3D11_LineRectPS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T vs_4_0_level_9_1 /E TextVS /Fh $(IntDir)TwDirect3D11_TextVS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T vs_4_0_level_9_1 /E TextCstColorVS /Fh $(IntDir)TwDirect3D11_TextCstColorVS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T ps_4_0_level_9_1 /E TextPS /Fh $(IntDir)TwDirect3D11_TextPS.h TwDirect3D11.hlsl
-
-
-
- _DEBUG;%(PreprocessorDefinitions)
- true
- true
- Win32
- $(OutDir)AntTweakBar.tlb
-
-
- Disabled
- ../include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_WINDOWS;_USRDLL;TW_EXPORTS;%(PreprocessorDefinitions)
- EnableFastChecks
- MultiThreadedDebug
- Use
- TwPrecomp.h
- $(IntDir)AntTweakBar.pch
- $(IntDir)
- $(IntDir)
- $(IntDir)
- Level4
- true
- EditAndContinue
- Default
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0409
- res;%(AdditionalIncludeDirectories)
-
-
- $(OutDir)AntTweakBar.dll
- true
- true
- $(OutDir)$(TargetName).pdb
- false
-
- $(OutDir)$(TargetName).lib
- MachineX86
- false
-
-
- if exist ..\examples\debug32 xcopy /y /f ..\lib\debug\AntTweakBar.dll ..\examples\debug32\.
-
-
-
-
- fxc /Od /Zi /T vs_4_0_level_9_1 /E LineRectVS /Fh $(IntDir)TwDirect3D11_LineRectVS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T vs_4_0_level_9_1 /E LineRectCstColorVS /Fh $(IntDir)TwDirect3D11_LineRectCstColorVS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T ps_4_0_level_9_1 /E LineRectPS /Fh $(IntDir)TwDirect3D11_LineRectPS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T vs_4_0_level_9_1 /E TextVS /Fh $(IntDir)TwDirect3D11_TextVS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T vs_4_0_level_9_1 /E TextCstColorVS /Fh $(IntDir)TwDirect3D11_TextCstColorVS.h TwDirect3D11.hlsl
-fxc /Od /Zi /T ps_4_0_level_9_1 /E TextPS /Fh $(IntDir)TwDirect3D11_TextPS.h TwDirect3D11.hlsl
-
-
-
- _DEBUG;%(PreprocessorDefinitions)
- true
- true
- X64
- $(OutDir)AntTweakBar.tlb
-
-
- Disabled
- ../include;%(AdditionalIncludeDirectories)
- WIN64;_WIN64;_DEBUG;_WINDOWS;_USRDLL;TW_EXPORTS;%(PreprocessorDefinitions)
- EnableFastChecks
- MultiThreadedDebug
- Use
- TwPrecomp.h
- $(IntDir)AntTweakBar.pch
- $(IntDir)
- $(IntDir)
- $(IntDir)
- Level4
- true
- ProgramDatabase
- Default
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0409
- res;%(AdditionalIncludeDirectories)
-
-
- $(OutDir)AntTweakBar64.dll
- true
- true
- $(OutDir)$(TargetName).pdb
- false
-
- $(OutDir)$(TargetName).lib
- MachineX64
-
-
- if exist ..\examples\debug64 xcopy /y /f ..\lib\debug\AntTweakBar64.dll ..\examples\debug64\.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Default
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Create
- Create
- Create
- Create
-
-
-
-
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/external/AntTweakBar/src/AntTweakBar.vcxproj.filters b/external/AntTweakBar/src/AntTweakBar.vcxproj.filters
deleted file mode 100644
index afd8448..0000000
--- a/external/AntTweakBar/src/AntTweakBar.vcxproj.filters
+++ /dev/null
@@ -1,217 +0,0 @@
-
-
-
-
- {f83ca079-8ea0-4739-a811-1271c1da7b99}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {9fa95835-d0ac-461f-9e15-970d83af4629}
- h;hpp;hxx;hm;inl
-
-
- {87a5b5f8-eb1d-4589-96fd-f8e516fc15e7}
-
-
- {d4d938bf-b5f6-43d3-896f-a3fff1885877}
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Public Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
- Private Header Files
-
-
-
-
- Resource Files
-
-
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
-
-
- Resource Files
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/external/AntTweakBar/src/AntTweakBar.vcxproj.user b/external/AntTweakBar/src/AntTweakBar.vcxproj.user
deleted file mode 100644
index 7cbb321..0000000
--- a/external/AntTweakBar/src/AntTweakBar.vcxproj.user
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/external/AntTweakBar/src/AntTweakBar_VS2008.sln b/external/AntTweakBar/src/AntTweakBar_VS2008.sln
deleted file mode 100644
index fe13245..0000000
--- a/external/AntTweakBar/src/AntTweakBar_VS2008.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual C++ Express 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AntTweakBar", "AntTweakBar.vcproj", "{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|Win32.ActiveCfg = Debug|Win32
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|Win32.Build.0 = Debug|Win32
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|x64.ActiveCfg = Debug|x64
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|x64.Build.0 = Debug|x64
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|Win32.ActiveCfg = Release|Win32
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|Win32.Build.0 = Release|Win32
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|x64.ActiveCfg = Release|x64
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/external/AntTweakBar/src/AntTweakBar_VS2012.sln b/external/AntTweakBar/src/AntTweakBar_VS2012.sln
deleted file mode 100644
index 2483db1..0000000
--- a/external/AntTweakBar/src/AntTweakBar_VS2012.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Express 2012 for Windows Desktop
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AntTweakBar", "AntTweakBar.vcxproj", "{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|Win32.ActiveCfg = Debug|Win32
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|Win32.Build.0 = Debug|Win32
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|x64.ActiveCfg = Debug|x64
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|x64.Build.0 = Debug|x64
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|Win32.ActiveCfg = Release|Win32
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|Win32.Build.0 = Release|Win32
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|x64.ActiveCfg = Release|x64
- {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/external/AntTweakBar/src/LoadOGL.cpp b/external/AntTweakBar/src/LoadOGL.cpp
deleted file mode 100644
index 9c260c3..0000000
--- a/external/AntTweakBar/src/LoadOGL.cpp
+++ /dev/null
@@ -1,545 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file LoadOGL.cpp
-// @author Philippe Decaudin
-// @license This file is part of the AntTweakBar library.
-// For conditions of distribution and use, see License.txt
-//
-// ---------------------------------------------------------------------------
-
-
-#include "TwPrecomp.h"
-#include "LoadOGL.h"
-
-
-// ---------------------------------------------------------------------------
-
-#define ANT_NB_OGL_FUNC_MAX 1024
-
-struct COGLFuncRec
-{
- const char * m_Name;
- GL::PFNOpenGL * m_FuncPtr;
- COGLFuncRec() : m_Name(NULL), m_FuncPtr(NULL) {}
-};
-COGLFuncRec g_OGLFuncRec[ANT_NB_OGL_FUNC_MAX];
-int g_NbOGLFunc = 0;
-#if defined(ANT_WINDOWS)
-HMODULE g_OGLModule = NULL;
-#endif
-
-// ---------------------------------------------------------------------------
-
-ANT_GL_IMPL(glAccum)
-ANT_GL_IMPL(glAlphaFunc)
-ANT_GL_IMPL(glAreTexturesResident)
-ANT_GL_IMPL(glArrayElement)
-ANT_GL_IMPL(glBegin)
-ANT_GL_IMPL(glBindTexture)
-ANT_GL_IMPL(glBitmap)
-ANT_GL_IMPL(glBlendFunc)
-ANT_GL_IMPL(glCallList)
-ANT_GL_IMPL(glCallLists)
-ANT_GL_IMPL(glClear)
-ANT_GL_IMPL(glClearAccum)
-ANT_GL_IMPL(glClearColor)
-ANT_GL_IMPL(glClearDepth)
-ANT_GL_IMPL(glClearIndex)
-ANT_GL_IMPL(glClearStencil)
-ANT_GL_IMPL(glClipPlane)
-ANT_GL_IMPL(glColor3b)
-ANT_GL_IMPL(glColor3bv)
-ANT_GL_IMPL(glColor3d)
-ANT_GL_IMPL(glColor3dv)
-ANT_GL_IMPL(glColor3f)
-ANT_GL_IMPL(glColor3fv)
-ANT_GL_IMPL(glColor3i)
-ANT_GL_IMPL(glColor3iv)
-ANT_GL_IMPL(glColor3s)
-ANT_GL_IMPL(glColor3sv)
-ANT_GL_IMPL(glColor3ub)
-ANT_GL_IMPL(glColor3ubv)
-ANT_GL_IMPL(glColor3ui)
-ANT_GL_IMPL(glColor3uiv)
-ANT_GL_IMPL(glColor3us)
-ANT_GL_IMPL(glColor3usv)
-ANT_GL_IMPL(glColor4b)
-ANT_GL_IMPL(glColor4bv)
-ANT_GL_IMPL(glColor4d)
-ANT_GL_IMPL(glColor4dv)
-ANT_GL_IMPL(glColor4f)
-ANT_GL_IMPL(glColor4fv)
-ANT_GL_IMPL(glColor4i)
-ANT_GL_IMPL(glColor4iv)
-ANT_GL_IMPL(glColor4s)
-ANT_GL_IMPL(glColor4sv)
-ANT_GL_IMPL(glColor4ub)
-ANT_GL_IMPL(glColor4ubv)
-ANT_GL_IMPL(glColor4ui)
-ANT_GL_IMPL(glColor4uiv)
-ANT_GL_IMPL(glColor4us)
-ANT_GL_IMPL(glColor4usv)
-ANT_GL_IMPL(glColorMask)
-ANT_GL_IMPL(glColorMaterial)
-ANT_GL_IMPL(glColorPointer)
-ANT_GL_IMPL(glCopyPixels)
-ANT_GL_IMPL(glCopyTexImage1D)
-ANT_GL_IMPL(glCopyTexImage2D)
-ANT_GL_IMPL(glCopyTexSubImage1D)
-ANT_GL_IMPL(glCopyTexSubImage2D)
-ANT_GL_IMPL(glCullFace)
-ANT_GL_IMPL(glDeleteLists)
-ANT_GL_IMPL(glDeleteTextures)
-ANT_GL_IMPL(glDepthFunc)
-ANT_GL_IMPL(glDepthMask)
-ANT_GL_IMPL(glDepthRange)
-ANT_GL_IMPL(glDisable)
-ANT_GL_IMPL(glDisableClientState)
-ANT_GL_IMPL(glDrawArrays)
-ANT_GL_IMPL(glDrawBuffer)
-ANT_GL_IMPL(glDrawElements)
-ANT_GL_IMPL(glDrawPixels)
-ANT_GL_IMPL(glEdgeFlag)
-ANT_GL_IMPL(glEdgeFlagPointer)
-ANT_GL_IMPL(glEdgeFlagv)
-ANT_GL_IMPL(glEnable)
-ANT_GL_IMPL(glEnableClientState)
-ANT_GL_IMPL(glEnd)
-ANT_GL_IMPL(glEndList)
-ANT_GL_IMPL(glEvalCoord1d)
-ANT_GL_IMPL(glEvalCoord1dv)
-ANT_GL_IMPL(glEvalCoord1f)
-ANT_GL_IMPL(glEvalCoord1fv)
-ANT_GL_IMPL(glEvalCoord2d)
-ANT_GL_IMPL(glEvalCoord2dv)
-ANT_GL_IMPL(glEvalCoord2f)
-ANT_GL_IMPL(glEvalCoord2fv)
-ANT_GL_IMPL(glEvalMesh1)
-ANT_GL_IMPL(glEvalMesh2)
-ANT_GL_IMPL(glEvalPoint1)
-ANT_GL_IMPL(glEvalPoint2)
-ANT_GL_IMPL(glFeedbackBuffer)
-ANT_GL_IMPL(glFinish)
-ANT_GL_IMPL(glFlush)
-ANT_GL_IMPL(glFogf)
-ANT_GL_IMPL(glFogfv)
-ANT_GL_IMPL(glFogi)
-ANT_GL_IMPL(glFogiv)
-ANT_GL_IMPL(glFrontFace)
-ANT_GL_IMPL(glFrustum)
-ANT_GL_IMPL(glGenLists)
-ANT_GL_IMPL(glGenTextures)
-ANT_GL_IMPL(glGetBooleanv)
-ANT_GL_IMPL(glGetClipPlane)
-ANT_GL_IMPL(glGetDoublev)
-ANT_GL_IMPL(glGetError)
-ANT_GL_IMPL(glGetFloatv)
-ANT_GL_IMPL(glGetIntegerv)
-ANT_GL_IMPL(glGetLightfv)
-ANT_GL_IMPL(glGetLightiv)
-ANT_GL_IMPL(glGetMapdv)
-ANT_GL_IMPL(glGetMapfv)
-ANT_GL_IMPL(glGetMapiv)
-ANT_GL_IMPL(glGetMaterialfv)
-ANT_GL_IMPL(glGetMaterialiv)
-ANT_GL_IMPL(glGetPixelMapfv)
-ANT_GL_IMPL(glGetPixelMapuiv)
-ANT_GL_IMPL(glGetPixelMapusv)
-ANT_GL_IMPL(glGetPointerv)
-ANT_GL_IMPL(glGetPolygonStipple)
-ANT_GL_IMPL(glGetString)
-ANT_GL_IMPL(glGetTexEnvfv)
-ANT_GL_IMPL(glGetTexEnviv)
-ANT_GL_IMPL(glGetTexGendv)
-ANT_GL_IMPL(glGetTexGenfv)
-ANT_GL_IMPL(glGetTexGeniv)
-ANT_GL_IMPL(glGetTexImage)
-ANT_GL_IMPL(glGetTexLevelParameterfv)
-ANT_GL_IMPL(glGetTexLevelParameteriv)
-ANT_GL_IMPL(glGetTexParameterfv)
-ANT_GL_IMPL(glGetTexParameteriv)
-ANT_GL_IMPL(glHint)
-ANT_GL_IMPL(glIndexMask)
-ANT_GL_IMPL(glIndexPointer)
-ANT_GL_IMPL(glIndexd)
-ANT_GL_IMPL(glIndexdv)
-ANT_GL_IMPL(glIndexf)
-ANT_GL_IMPL(glIndexfv)
-ANT_GL_IMPL(glIndexi)
-ANT_GL_IMPL(glIndexiv)
-ANT_GL_IMPL(glIndexs)
-ANT_GL_IMPL(glIndexsv)
-ANT_GL_IMPL(glIndexub)
-ANT_GL_IMPL(glIndexubv)
-ANT_GL_IMPL(glInitNames)
-ANT_GL_IMPL(glInterleavedArrays)
-ANT_GL_IMPL(glIsEnabled)
-ANT_GL_IMPL(glIsList)
-ANT_GL_IMPL(glIsTexture)
-ANT_GL_IMPL(glLightModelf)
-ANT_GL_IMPL(glLightModelfv)
-ANT_GL_IMPL(glLightModeli)
-ANT_GL_IMPL(glLightModeliv)
-ANT_GL_IMPL(glLightf)
-ANT_GL_IMPL(glLightfv)
-ANT_GL_IMPL(glLighti)
-ANT_GL_IMPL(glLightiv)
-ANT_GL_IMPL(glLineStipple)
-ANT_GL_IMPL(glLineWidth)
-ANT_GL_IMPL(glListBase)
-ANT_GL_IMPL(glLoadIdentity)
-ANT_GL_IMPL(glLoadMatrixd)
-ANT_GL_IMPL(glLoadMatrixf)
-ANT_GL_IMPL(glLoadName)
-ANT_GL_IMPL(glLogicOp)
-ANT_GL_IMPL(glMap1d)
-ANT_GL_IMPL(glMap1f)
-ANT_GL_IMPL(glMap2d)
-ANT_GL_IMPL(glMap2f)
-ANT_GL_IMPL(glMapGrid1d)
-ANT_GL_IMPL(glMapGrid1f)
-ANT_GL_IMPL(glMapGrid2d)
-ANT_GL_IMPL(glMapGrid2f)
-ANT_GL_IMPL(glMaterialf)
-ANT_GL_IMPL(glMaterialfv)
-ANT_GL_IMPL(glMateriali)
-ANT_GL_IMPL(glMaterialiv)
-ANT_GL_IMPL(glMatrixMode)
-ANT_GL_IMPL(glMultMatrixd)
-ANT_GL_IMPL(glMultMatrixf)
-ANT_GL_IMPL(glNewList)
-ANT_GL_IMPL(glNormal3b)
-ANT_GL_IMPL(glNormal3bv)
-ANT_GL_IMPL(glNormal3d)
-ANT_GL_IMPL(glNormal3dv)
-ANT_GL_IMPL(glNormal3f)
-ANT_GL_IMPL(glNormal3fv)
-ANT_GL_IMPL(glNormal3i)
-ANT_GL_IMPL(glNormal3iv)
-ANT_GL_IMPL(glNormal3s)
-ANT_GL_IMPL(glNormal3sv)
-ANT_GL_IMPL(glNormalPointer)
-ANT_GL_IMPL(glOrtho)
-ANT_GL_IMPL(glPassThrough)
-ANT_GL_IMPL(glPixelMapfv)
-ANT_GL_IMPL(glPixelMapuiv)
-ANT_GL_IMPL(glPixelMapusv)
-ANT_GL_IMPL(glPixelStoref)
-ANT_GL_IMPL(glPixelStorei)
-ANT_GL_IMPL(glPixelTransferf)
-ANT_GL_IMPL(glPixelTransferi)
-ANT_GL_IMPL(glPixelZoom)
-ANT_GL_IMPL(glPointSize)
-ANT_GL_IMPL(glPolygonMode)
-ANT_GL_IMPL(glPolygonOffset)
-ANT_GL_IMPL(glPolygonStipple)
-ANT_GL_IMPL(glPopAttrib)
-ANT_GL_IMPL(glPopClientAttrib)
-ANT_GL_IMPL(glPopMatrix)
-ANT_GL_IMPL(glPopName)
-ANT_GL_IMPL(glPrioritizeTextures)
-ANT_GL_IMPL(glPushAttrib)
-ANT_GL_IMPL(glPushClientAttrib)
-ANT_GL_IMPL(glPushMatrix)
-ANT_GL_IMPL(glPushName)
-ANT_GL_IMPL(glRasterPos2d)
-ANT_GL_IMPL(glRasterPos2dv)
-ANT_GL_IMPL(glRasterPos2f)
-ANT_GL_IMPL(glRasterPos2fv)
-ANT_GL_IMPL(glRasterPos2i)
-ANT_GL_IMPL(glRasterPos2iv)
-ANT_GL_IMPL(glRasterPos2s)
-ANT_GL_IMPL(glRasterPos2sv)
-ANT_GL_IMPL(glRasterPos3d)
-ANT_GL_IMPL(glRasterPos3dv)
-ANT_GL_IMPL(glRasterPos3f)
-ANT_GL_IMPL(glRasterPos3fv)
-ANT_GL_IMPL(glRasterPos3i)
-ANT_GL_IMPL(glRasterPos3iv)
-ANT_GL_IMPL(glRasterPos3s)
-ANT_GL_IMPL(glRasterPos3sv)
-ANT_GL_IMPL(glRasterPos4d)
-ANT_GL_IMPL(glRasterPos4dv)
-ANT_GL_IMPL(glRasterPos4f)
-ANT_GL_IMPL(glRasterPos4fv)
-ANT_GL_IMPL(glRasterPos4i)
-ANT_GL_IMPL(glRasterPos4iv)
-ANT_GL_IMPL(glRasterPos4s)
-ANT_GL_IMPL(glRasterPos4sv)
-ANT_GL_IMPL(glReadBuffer)
-ANT_GL_IMPL(glReadPixels)
-ANT_GL_IMPL(glRectd)
-ANT_GL_IMPL(glRectdv)
-ANT_GL_IMPL(glRectf)
-ANT_GL_IMPL(glRectfv)
-ANT_GL_IMPL(glRecti)
-ANT_GL_IMPL(glRectiv)
-ANT_GL_IMPL(glRects)
-ANT_GL_IMPL(glRectsv)
-ANT_GL_IMPL(glRenderMode)
-ANT_GL_IMPL(glRotated)
-ANT_GL_IMPL(glRotatef)
-ANT_GL_IMPL(glScaled)
-ANT_GL_IMPL(glScalef)
-ANT_GL_IMPL(glScissor)
-ANT_GL_IMPL(glSelectBuffer)
-ANT_GL_IMPL(glShadeModel)
-ANT_GL_IMPL(glStencilFunc)
-ANT_GL_IMPL(glStencilMask)
-ANT_GL_IMPL(glStencilOp)
-ANT_GL_IMPL(glTexCoord1d)
-ANT_GL_IMPL(glTexCoord1dv)
-ANT_GL_IMPL(glTexCoord1f)
-ANT_GL_IMPL(glTexCoord1fv)
-ANT_GL_IMPL(glTexCoord1i)
-ANT_GL_IMPL(glTexCoord1iv)
-ANT_GL_IMPL(glTexCoord1s)
-ANT_GL_IMPL(glTexCoord1sv)
-ANT_GL_IMPL(glTexCoord2d)
-ANT_GL_IMPL(glTexCoord2dv)
-ANT_GL_IMPL(glTexCoord2f)
-ANT_GL_IMPL(glTexCoord2fv)
-ANT_GL_IMPL(glTexCoord2i)
-ANT_GL_IMPL(glTexCoord2iv)
-ANT_GL_IMPL(glTexCoord2s)
-ANT_GL_IMPL(glTexCoord2sv)
-ANT_GL_IMPL(glTexCoord3d)
-ANT_GL_IMPL(glTexCoord3dv)
-ANT_GL_IMPL(glTexCoord3f)
-ANT_GL_IMPL(glTexCoord3fv)
-ANT_GL_IMPL(glTexCoord3i)
-ANT_GL_IMPL(glTexCoord3iv)
-ANT_GL_IMPL(glTexCoord3s)
-ANT_GL_IMPL(glTexCoord3sv)
-ANT_GL_IMPL(glTexCoord4d)
-ANT_GL_IMPL(glTexCoord4dv)
-ANT_GL_IMPL(glTexCoord4f)
-ANT_GL_IMPL(glTexCoord4fv)
-ANT_GL_IMPL(glTexCoord4i)
-ANT_GL_IMPL(glTexCoord4iv)
-ANT_GL_IMPL(glTexCoord4s)
-ANT_GL_IMPL(glTexCoord4sv)
-ANT_GL_IMPL(glTexCoordPointer)
-ANT_GL_IMPL(glTexEnvf)
-ANT_GL_IMPL(glTexEnvfv)
-ANT_GL_IMPL(glTexEnvi)
-ANT_GL_IMPL(glTexEnviv)
-ANT_GL_IMPL(glTexGend)
-ANT_GL_IMPL(glTexGendv)
-ANT_GL_IMPL(glTexGenf)
-ANT_GL_IMPL(glTexGenfv)
-ANT_GL_IMPL(glTexGeni)
-ANT_GL_IMPL(glTexGeniv)
-ANT_GL_IMPL(glTexImage1D)
-ANT_GL_IMPL(glTexImage2D)
-ANT_GL_IMPL(glTexParameterf)
-ANT_GL_IMPL(glTexParameterfv)
-ANT_GL_IMPL(glTexParameteri)
-ANT_GL_IMPL(glTexParameteriv)
-ANT_GL_IMPL(glTexSubImage1D)
-ANT_GL_IMPL(glTexSubImage2D)
-ANT_GL_IMPL(glTranslated)
-ANT_GL_IMPL(glTranslatef)
-ANT_GL_IMPL(glVertex2d)
-ANT_GL_IMPL(glVertex2dv)
-ANT_GL_IMPL(glVertex2f)
-ANT_GL_IMPL(glVertex2fv)
-ANT_GL_IMPL(glVertex2i)
-ANT_GL_IMPL(glVertex2iv)
-ANT_GL_IMPL(glVertex2s)
-ANT_GL_IMPL(glVertex2sv)
-ANT_GL_IMPL(glVertex3d)
-ANT_GL_IMPL(glVertex3dv)
-ANT_GL_IMPL(glVertex3f)
-ANT_GL_IMPL(glVertex3fv)
-ANT_GL_IMPL(glVertex3i)
-ANT_GL_IMPL(glVertex3iv)
-ANT_GL_IMPL(glVertex3s)
-ANT_GL_IMPL(glVertex3sv)
-ANT_GL_IMPL(glVertex4d)
-ANT_GL_IMPL(glVertex4dv)
-ANT_GL_IMPL(glVertex4f)
-ANT_GL_IMPL(glVertex4fv)
-ANT_GL_IMPL(glVertex4i)
-ANT_GL_IMPL(glVertex4iv)
-ANT_GL_IMPL(glVertex4s)
-ANT_GL_IMPL(glVertex4sv)
-ANT_GL_IMPL(glVertexPointer)
-ANT_GL_IMPL(glViewport)
-#if defined(ANT_WINDOWS)
-ANT_GL_IMPL(wglGetProcAddress)
-#endif
-
-namespace GL { PFNGLGetProcAddress _glGetProcAddress = NULL; }
-
-// ---------------------------------------------------------------------------
-
-#if defined(ANT_WINDOWS)
-
- // ---------------------------------------------------------------------------
-
- int LoadOpenGL()
- {
- if( g_OGLModule!=NULL )
- {
- return 1; // "OpenGL library already loaded"
- }
-
- g_OGLModule = LoadLibrary("OPENGL32.DLL");
- if( g_OGLModule )
- {
- // Info(VERB_LOW, "Load %d OpenGL functions", g_NbOGLFunc);
-
- int Res = 1;
- for(int i=0; i0);
- *(g_OGLFuncRec[i].m_FuncPtr) = reinterpret_cast(GetProcAddress(g_OGLModule, g_OGLFuncRec[i].m_Name));
- if( *(g_OGLFuncRec[i].m_FuncPtr)==NULL )
- Res = 0; // Error("cannot find OpenGL function");
-
- }
-
- _glGetProcAddress = reinterpret_cast(_wglGetProcAddress);
- if( _glGetProcAddress==NULL )
- Res = 0;
-
- return Res;
- }
- else
- {
- // InternDisplayLastErrorWIN("Cannot load opengl32 DLL", false);
- return 0; // cannot load DLL
- }
- }
-
- // ---------------------------------------------------------------------------
-
- int UnloadOpenGL()
- {
- if( g_OGLModule==NULL )
- {
- return 1; // "OpenGL library not loaded"
- }
-
- // Info(VERB_LOW, "Unload %d OpenGL functions", g_NbOGLFunc);
- for(int i=0; i0);
- *(g_OGLFuncRec[i].m_FuncPtr) = NULL;
- }
- if( FreeLibrary(g_OGLModule) )
- {
- // Info(VERB_LOW, "OpenGL library unloaded");
- g_OGLModule = NULL;
- return 1;
- }
- else
- {
- // InternDisplayLastErrorWIN("Cannot unload opengl32 DLL", false);
- return 0; // cannot unload opengl32.dll
- }
- }
-
- // ---------------------------------------------------------------------------
-
- namespace GL
- {
-
- PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr)
- {
- if( g_NbOGLFunc>=ANT_NB_OGL_FUNC_MAX )
- {
- fprintf(stderr, "Too many OpenGL functions declared. Change ANT_NB_OGL_FUNC_MAX.");
- exit(-1);
- }
-
- g_OGLFuncRec[g_NbOGLFunc].m_Name = _FuncName;
- g_OGLFuncRec[g_NbOGLFunc].m_FuncPtr = _FuncPtr;
- ++g_NbOGLFunc;
-
- return NULL;
- }
-
- } // namespace GL
-
- // ---------------------------------------------------------------------------
-
-#endif // defined(ANT_WINDOWS)
-
-// ---------------------------------------------------------------------------
-
-#if defined(ANT_UNIX)
-
- int LoadOpenGL()
- {
- _glGetProcAddress = reinterpret_cast(glXGetProcAddressARB);
-
- return 1; // "OpenGL library is statically linked"
- }
-
- int UnloadOpenGL()
- {
- return 1; // "OpenGL library is statically linked"
- }
-
-#elif defined(ANT_OSX)
-
- #include
-
- static void *gl_dyld = NULL;
- static const char *gl_prefix = "_";
- void *NSGLGetProcAddressNew(const GLubyte *name)
- {
- void *proc=NULL;
- if (gl_dyld == NULL)
- {
- gl_dyld = dlopen("OpenGL",RTLD_LAZY);
- }
- if (gl_dyld)
- {
- NSString *sym = [[NSString alloc] initWithFormat: @"%s%s",gl_prefix,name];
- proc = dlsym(gl_dyld,[sym UTF8String]);
- [sym release];
- }
- return proc;
- }
-
- int LoadOpenGL()
- {
- _glGetProcAddress = reinterpret_cast(NSGLGetProcAddressNew);
-
- // try to load a symbol
- if (_glGetProcAddress("glBindBufferARB") == NULL)
- {
- // remove the symbols underscore prefix (OSX 10.7 and later)
- gl_prefix = "";
- if (_glGetProcAddress("glBindBufferARB") == NULL)
- {
- // fail: fall back to underscore
- gl_prefix = "_";
- }
- }
-
- return 1;
- }
-
- int UnloadOpenGL()
- {
- if (gl_dyld)
- {
- dlclose(gl_dyld);
- gl_dyld = NULL;
- }
- return 1;
- }
-
-#endif // defined(ANT_UNIX)
-
-// ---------------------------------------------------------------------------
diff --git a/external/AntTweakBar/src/LoadOGL.h b/external/AntTweakBar/src/LoadOGL.h
deleted file mode 100644
index 613473d..0000000
--- a/external/AntTweakBar/src/LoadOGL.h
+++ /dev/null
@@ -1,397 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file LoadOGL.h
-// @brief OpenGL declarations for dynamic loading
-// @author Philippe Decaudin
-// @license This file is part of the AntTweakBar library.
-// For conditions of distribution and use, see License.txt
-//
-// note: Private header
-//
-// ---------------------------------------------------------------------------
-
-
-#if !defined ANT_LOAD_OGL_INCLUDED
-#define ANT_LOAD_OGL_INCLUDED
-
-
-#define ANT_GL_DECL(_Ret, _Fct, _Params) \
- extern "C" { typedef _Ret (APIENTRY* PFN##_Fct)_Params; } \
- namespace GL { extern PFN##_Fct _##_Fct; } \
- using GL::_##_Fct;
-
-#if defined(ANT_WINDOWS)
-# define ANT_GL_IMPL(_Fct) \
- namespace GL { PFN##_Fct _##_Fct = (PFN##_Fct)Record(#_Fct, (PFNOpenGL*)(&_##_Fct)); }
-#elif defined(ANT_UNIX) || defined(ANT_OSX)
-# define ANT_GL_IMPL(_Fct) \
- namespace GL { PFN##_Fct _##_Fct = _Fct; }
-# if !defined(APIENTRY)
-# define APIENTRY
-# endif
-#endif
-
-
-int LoadOpenGL();
-int UnloadOpenGL();
-
-namespace GL
-{
- extern "C" { typedef void (APIENTRY* PFNOpenGL)(); }
- PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr);
-
- extern "C" { typedef PFNOpenGL (APIENTRY *PFNGLGetProcAddress)(const char *); }
- extern PFNGLGetProcAddress _glGetProcAddress;
-}
-using GL::_glGetProcAddress;
-
-
-ANT_GL_DECL(void, glAccum, (GLenum op, GLfloat value))
-ANT_GL_DECL(void, glAlphaFunc, (GLenum func, GLclampf ref))
-ANT_GL_DECL(GLboolean, glAreTexturesResident, (GLsizei n, const GLuint *textures, GLboolean *residences))
-ANT_GL_DECL(void, glArrayElement, (GLint i))
-ANT_GL_DECL(void, glBegin, (GLenum mode))
-ANT_GL_DECL(void, glBindTexture, (GLenum target, GLuint texture))
-ANT_GL_DECL(void, glBitmap, (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap))
-ANT_GL_DECL(void, glBlendFunc, (GLenum sfactor, GLenum dfactor))
-ANT_GL_DECL(void, glCallList, (GLuint list))
-ANT_GL_DECL(void, glCallLists, (GLsizei n, GLenum type, const GLvoid *lists))
-ANT_GL_DECL(void, glClear, (GLbitfield mask))
-ANT_GL_DECL(void, glClearAccum, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha))
-ANT_GL_DECL(void, glClearColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha))
-ANT_GL_DECL(void, glClearDepth, (GLclampd depth))
-ANT_GL_DECL(void, glClearIndex, (GLfloat c))
-ANT_GL_DECL(void, glClearStencil, (GLint s))
-ANT_GL_DECL(void, glClipPlane, (GLenum plane, const GLdouble *equation))
-ANT_GL_DECL(void, glColor3b, (GLbyte red, GLbyte green, GLbyte blue))
-ANT_GL_DECL(void, glColor3bv, (const GLbyte *v))
-ANT_GL_DECL(void, glColor3d, (GLdouble red, GLdouble green, GLdouble blue))
-ANT_GL_DECL(void, glColor3dv, (const GLdouble *v))
-ANT_GL_DECL(void, glColor3f, (GLfloat red, GLfloat green, GLfloat blue))
-ANT_GL_DECL(void, glColor3fv, (const GLfloat *v))
-ANT_GL_DECL(void, glColor3i, (GLint red, GLint green, GLint blue))
-ANT_GL_DECL(void, glColor3iv, (const GLint *v))
-ANT_GL_DECL(void, glColor3s, (GLshort red, GLshort green, GLshort blue))
-ANT_GL_DECL(void, glColor3sv, (const GLshort *v))
-ANT_GL_DECL(void, glColor3ub, (GLubyte red, GLubyte green, GLubyte blue))
-ANT_GL_DECL(void, glColor3ubv, (const GLubyte *v))
-ANT_GL_DECL(void, glColor3ui, (GLuint red, GLuint green, GLuint blue))
-ANT_GL_DECL(void, glColor3uiv, (const GLuint *v))
-ANT_GL_DECL(void, glColor3us, (GLushort red, GLushort green, GLushort blue))
-ANT_GL_DECL(void, glColor3usv, (const GLushort *v))
-ANT_GL_DECL(void, glColor4b, (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha))
-ANT_GL_DECL(void, glColor4bv, (const GLbyte *v))
-ANT_GL_DECL(void, glColor4d, (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha))
-ANT_GL_DECL(void, glColor4dv, (const GLdouble *v))
-ANT_GL_DECL(void, glColor4f, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha))
-ANT_GL_DECL(void, glColor4fv, (const GLfloat *v))
-ANT_GL_DECL(void, glColor4i, (GLint red, GLint green, GLint blue, GLint alpha))
-ANT_GL_DECL(void, glColor4iv, (const GLint *v))
-ANT_GL_DECL(void, glColor4s, (GLshort red, GLshort green, GLshort blue, GLshort alpha))
-ANT_GL_DECL(void, glColor4sv, (const GLshort *v))
-ANT_GL_DECL(void, glColor4ub, (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha))
-ANT_GL_DECL(void, glColor4ubv, (const GLubyte *v))
-ANT_GL_DECL(void, glColor4ui, (GLuint red, GLuint green, GLuint blue, GLuint alpha))
-ANT_GL_DECL(void, glColor4uiv, (const GLuint *v))
-ANT_GL_DECL(void, glColor4us, (GLushort red, GLushort green, GLushort blue, GLushort alpha))
-ANT_GL_DECL(void, glColor4usv, (const GLushort *v))
-ANT_GL_DECL(void, glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha))
-ANT_GL_DECL(void, glColorMaterial, (GLenum face, GLenum mode))
-ANT_GL_DECL(void, glColorPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer))
-ANT_GL_DECL(void, glCopyPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type))
-ANT_GL_DECL(void, glCopyTexImage1D, (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border))
-ANT_GL_DECL(void, glCopyTexImage2D, (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border))
-ANT_GL_DECL(void, glCopyTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width))
-ANT_GL_DECL(void, glCopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height))
-ANT_GL_DECL(void, glCullFace, (GLenum mode))
-ANT_GL_DECL(void, glDeleteLists, (GLuint list, GLsizei range))
-ANT_GL_DECL(void, glDeleteTextures, (GLsizei n, const GLuint *textures))
-ANT_GL_DECL(void, glDepthFunc, (GLenum func))
-ANT_GL_DECL(void, glDepthMask, (GLboolean flag))
-ANT_GL_DECL(void, glDepthRange, (GLclampd zNear, GLclampd zFar))
-ANT_GL_DECL(void, glDisable, (GLenum cap))
-ANT_GL_DECL(void, glDisableClientState, (GLenum array))
-ANT_GL_DECL(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count))
-ANT_GL_DECL(void, glDrawBuffer, (GLenum mode))
-ANT_GL_DECL(void, glDrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices))
-ANT_GL_DECL(void, glDrawPixels, (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_DECL(void, glEdgeFlag, (GLboolean flag))
-ANT_GL_DECL(void, glEdgeFlagPointer, (GLsizei stride, const void *pointer))
-ANT_GL_DECL(void, glEdgeFlagv, (const GLboolean *flag))
-ANT_GL_DECL(void, glEnable, (GLenum cap))
-ANT_GL_DECL(void, glEnableClientState, (GLenum array))
-ANT_GL_DECL(void, glEnd, (void))
-ANT_GL_DECL(void, glEndList, (void))
-ANT_GL_DECL(void, glEvalCoord1d, (GLdouble u))
-ANT_GL_DECL(void, glEvalCoord1dv, (const GLdouble *u))
-ANT_GL_DECL(void, glEvalCoord1f, (GLfloat u))
-ANT_GL_DECL(void, glEvalCoord1fv, (const GLfloat *u))
-ANT_GL_DECL(void, glEvalCoord2d, (GLdouble u, GLdouble v))
-ANT_GL_DECL(void, glEvalCoord2dv, (const GLdouble *u))
-ANT_GL_DECL(void, glEvalCoord2f, (GLfloat u, GLfloat v))
-ANT_GL_DECL(void, glEvalCoord2fv, (const GLfloat *u))
-ANT_GL_DECL(void, glEvalMesh1, (GLenum mode, GLint i1, GLint i2))
-ANT_GL_DECL(void, glEvalMesh2, (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2))
-ANT_GL_DECL(void, glEvalPoint1, (GLint i))
-ANT_GL_DECL(void, glEvalPoint2, (GLint i, GLint j))
-ANT_GL_DECL(void, glFeedbackBuffer, (GLsizei size, GLenum type, GLfloat *buffer))
-ANT_GL_DECL(void, glFinish, (void))
-ANT_GL_DECL(void, glFlush, (void))
-ANT_GL_DECL(void, glFogf, (GLenum pname, GLfloat param))
-ANT_GL_DECL(void, glFogfv, (GLenum pname, const GLfloat *params))
-ANT_GL_DECL(void, glFogi, (GLenum pname, GLint param))
-ANT_GL_DECL(void, glFogiv, (GLenum pname, const GLint *params))
-ANT_GL_DECL(void, glFrontFace, (GLenum mode))
-ANT_GL_DECL(void, glFrustum, (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar))
-ANT_GL_DECL(GLuint, glGenLists, (GLsizei range))
-ANT_GL_DECL(void, glGenTextures, (GLsizei n, GLuint *textures))
-ANT_GL_DECL(void, glGetBooleanv, (GLenum pname, GLboolean *params))
-ANT_GL_DECL(void, glGetClipPlane, (GLenum plane, GLdouble *equation))
-ANT_GL_DECL(void, glGetDoublev, (GLenum pname, GLdouble *params))
-ANT_GL_DECL(GLenum, glGetError, (void))
-ANT_GL_DECL(void, glGetFloatv, (GLenum pname, GLfloat *params))
-ANT_GL_DECL(void, glGetIntegerv, (GLenum pname, GLint *params))
-ANT_GL_DECL(void, glGetLightfv, (GLenum light, GLenum pname, GLfloat *params))
-ANT_GL_DECL(void, glGetLightiv, (GLenum light, GLenum pname, GLint *params))
-ANT_GL_DECL(void, glGetMapdv, (GLenum target, GLenum query, GLdouble *v))
-ANT_GL_DECL(void, glGetMapfv, (GLenum target, GLenum query, GLfloat *v))
-ANT_GL_DECL(void, glGetMapiv, (GLenum target, GLenum query, GLint *v))
-ANT_GL_DECL(void, glGetMaterialfv, (GLenum face, GLenum pname, GLfloat *params))
-ANT_GL_DECL(void, glGetMaterialiv, (GLenum face, GLenum pname, GLint *params))
-ANT_GL_DECL(void, glGetPixelMapfv, (GLenum map, GLfloat *values))
-ANT_GL_DECL(void, glGetPixelMapuiv, (GLenum map, GLuint *values))
-ANT_GL_DECL(void, glGetPixelMapusv, (GLenum map, GLushort *values))
-ANT_GL_DECL(void, glGetPointerv, (GLenum pname, GLvoid* *params))
-ANT_GL_DECL(void, glGetPolygonStipple, (GLubyte *mask))
-ANT_GL_DECL(const GLubyte *, glGetString, (GLenum name))
-ANT_GL_DECL(void, glGetTexEnvfv, (GLenum target, GLenum pname, GLfloat *params))
-ANT_GL_DECL(void, glGetTexEnviv, (GLenum target, GLenum pname, GLint *params))
-ANT_GL_DECL(void, glGetTexGendv, (GLenum coord, GLenum pname, GLdouble *params))
-ANT_GL_DECL(void, glGetTexGenfv, (GLenum coord, GLenum pname, GLfloat *params))
-ANT_GL_DECL(void, glGetTexGeniv, (GLenum coord, GLenum pname, GLint *params))
-ANT_GL_DECL(void, glGetTexImage, (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels))
-ANT_GL_DECL(void, glGetTexLevelParameterfv, (GLenum target, GLint level, GLenum pname, GLfloat *params))
-ANT_GL_DECL(void, glGetTexLevelParameteriv, (GLenum target, GLint level, GLenum pname, GLint *params))
-ANT_GL_DECL(void, glGetTexParameterfv, (GLenum target, GLenum pname, GLfloat *params))
-ANT_GL_DECL(void, glGetTexParameteriv, (GLenum target, GLenum pname, GLint *params))
-ANT_GL_DECL(void, glHint, (GLenum target, GLenum mode))
-ANT_GL_DECL(void, glIndexMask, (GLuint mask))
-ANT_GL_DECL(void, glIndexPointer, (GLenum type, GLsizei stride, const GLvoid *pointer))
-ANT_GL_DECL(void, glIndexd, (GLdouble c))
-ANT_GL_DECL(void, glIndexdv, (const GLdouble *c))
-ANT_GL_DECL(void, glIndexf, (GLfloat c))
-ANT_GL_DECL(void, glIndexfv, (const GLfloat *c))
-ANT_GL_DECL(void, glIndexi, (GLint c))
-ANT_GL_DECL(void, glIndexiv, (const GLint *c))
-ANT_GL_DECL(void, glIndexs, (GLshort c))
-ANT_GL_DECL(void, glIndexsv, (const GLshort *c))
-ANT_GL_DECL(void, glIndexub, (GLubyte c))
-ANT_GL_DECL(void, glIndexubv, (const GLubyte *c))
-ANT_GL_DECL(void, glInitNames, (void))
-ANT_GL_DECL(void, glInterleavedArrays, (GLenum format, GLsizei stride, const GLvoid *pointer))
-ANT_GL_DECL(GLboolean, glIsEnabled, (GLenum cap))
-ANT_GL_DECL(GLboolean, glIsList, (GLuint list))
-ANT_GL_DECL(GLboolean, glIsTexture, (GLuint texture))
-ANT_GL_DECL(void, glLightModelf, (GLenum pname, GLfloat param))
-ANT_GL_DECL(void, glLightModelfv, (GLenum pname, const GLfloat *params))
-ANT_GL_DECL(void, glLightModeli, (GLenum pname, GLint param))
-ANT_GL_DECL(void, glLightModeliv, (GLenum pname, const GLint *params))
-ANT_GL_DECL(void, glLightf, (GLenum light, GLenum pname, GLfloat param))
-ANT_GL_DECL(void, glLightfv, (GLenum light, GLenum pname, const GLfloat *params))
-ANT_GL_DECL(void, glLighti, (GLenum light, GLenum pname, GLint param))
-ANT_GL_DECL(void, glLightiv, (GLenum light, GLenum pname, const GLint *params))
-ANT_GL_DECL(void, glLineStipple, (GLint factor, GLushort pattern))
-ANT_GL_DECL(void, glLineWidth, (GLfloat width))
-ANT_GL_DECL(void, glListBase, (GLuint base))
-ANT_GL_DECL(void, glLoadIdentity, (void))
-ANT_GL_DECL(void, glLoadMatrixd, (const GLdouble *m))
-ANT_GL_DECL(void, glLoadMatrixf, (const GLfloat *m))
-ANT_GL_DECL(void, glLoadName, (GLuint name))
-ANT_GL_DECL(void, glLogicOp, (GLenum opcode))
-ANT_GL_DECL(void, glMap1d, (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points))
-ANT_GL_DECL(void, glMap1f, (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points))
-ANT_GL_DECL(void, glMap2d, (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points))
-ANT_GL_DECL(void, glMap2f, (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points))
-ANT_GL_DECL(void, glMapGrid1d, (GLint un, GLdouble u1, GLdouble u2))
-ANT_GL_DECL(void, glMapGrid1f, (GLint un, GLfloat u1, GLfloat u2))
-ANT_GL_DECL(void, glMapGrid2d, (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2))
-ANT_GL_DECL(void, glMapGrid2f, (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2))
-ANT_GL_DECL(void, glMaterialf, (GLenum face, GLenum pname, GLfloat param))
-ANT_GL_DECL(void, glMaterialfv, (GLenum face, GLenum pname, const GLfloat *params))
-ANT_GL_DECL(void, glMateriali, (GLenum face, GLenum pname, GLint param))
-ANT_GL_DECL(void, glMaterialiv, (GLenum face, GLenum pname, const GLint *params))
-ANT_GL_DECL(void, glMatrixMode, (GLenum mode))
-ANT_GL_DECL(void, glMultMatrixd, (const GLdouble *m))
-ANT_GL_DECL(void, glMultMatrixf, (const GLfloat *m))
-ANT_GL_DECL(void, glNewList, (GLuint list, GLenum mode))
-ANT_GL_DECL(void, glNormal3b, (GLbyte nx, GLbyte ny, GLbyte nz))
-ANT_GL_DECL(void, glNormal3bv, (const GLbyte *v))
-ANT_GL_DECL(void, glNormal3d, (GLdouble nx, GLdouble ny, GLdouble nz))
-ANT_GL_DECL(void, glNormal3dv, (const GLdouble *v))
-ANT_GL_DECL(void, glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz))
-ANT_GL_DECL(void, glNormal3fv, (const GLfloat *v))
-ANT_GL_DECL(void, glNormal3i, (GLint nx, GLint ny, GLint nz))
-ANT_GL_DECL(void, glNormal3iv, (const GLint *v))
-ANT_GL_DECL(void, glNormal3s, (GLshort nx, GLshort ny, GLshort nz))
-ANT_GL_DECL(void, glNormal3sv, (const GLshort *v))
-ANT_GL_DECL(void, glNormalPointer, (GLenum type, GLsizei stride, const GLvoid *pointer))
-ANT_GL_DECL(void, glOrtho, (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar))
-ANT_GL_DECL(void, glPassThrough, (GLfloat token))
-ANT_GL_DECL(void, glPixelMapfv, (GLenum map, GLsizei mapsize, const GLfloat *values))
-ANT_GL_DECL(void, glPixelMapuiv, (GLenum map, GLsizei mapsize, const GLuint *values))
-ANT_GL_DECL(void, glPixelMapusv, (GLenum map, GLsizei mapsize, const GLushort *values))
-ANT_GL_DECL(void, glPixelStoref, (GLenum pname, GLfloat param))
-ANT_GL_DECL(void, glPixelStorei, (GLenum pname, GLint param))
-ANT_GL_DECL(void, glPixelTransferf, (GLenum pname, GLfloat param))
-ANT_GL_DECL(void, glPixelTransferi, (GLenum pname, GLint param))
-ANT_GL_DECL(void, glPixelZoom, (GLfloat xfactor, GLfloat yfactor))
-ANT_GL_DECL(void, glPointSize, (GLfloat size))
-ANT_GL_DECL(void, glPolygonMode, (GLenum face, GLenum mode))
-ANT_GL_DECL(void, glPolygonOffset, (GLfloat factor, GLfloat units))
-ANT_GL_DECL(void, glPolygonStipple, (const GLubyte *mask))
-ANT_GL_DECL(void, glPopAttrib, (void))
-ANT_GL_DECL(void, glPopClientAttrib, (void))
-ANT_GL_DECL(void, glPopMatrix, (void))
-ANT_GL_DECL(void, glPopName, (void))
-ANT_GL_DECL(void, glPrioritizeTextures, (GLsizei n, const GLuint *textures, const GLclampf *priorities))
-ANT_GL_DECL(void, glPushAttrib, (GLbitfield mask))
-ANT_GL_DECL(void, glPushClientAttrib, (GLbitfield mask))
-ANT_GL_DECL(void, glPushMatrix, (void))
-ANT_GL_DECL(void, glPushName, (GLuint name))
-ANT_GL_DECL(void, glRasterPos2d, (GLdouble x, GLdouble y))
-ANT_GL_DECL(void, glRasterPos2dv, (const GLdouble *v))
-ANT_GL_DECL(void, glRasterPos2f, (GLfloat x, GLfloat y))
-ANT_GL_DECL(void, glRasterPos2fv, (const GLfloat *v))
-ANT_GL_DECL(void, glRasterPos2i, (GLint x, GLint y))
-ANT_GL_DECL(void, glRasterPos2iv, (const GLint *v))
-ANT_GL_DECL(void, glRasterPos2s, (GLshort x, GLshort y))
-ANT_GL_DECL(void, glRasterPos2sv, (const GLshort *v))
-ANT_GL_DECL(void, glRasterPos3d, (GLdouble x, GLdouble y, GLdouble z))
-ANT_GL_DECL(void, glRasterPos3dv, (const GLdouble *v))
-ANT_GL_DECL(void, glRasterPos3f, (GLfloat x, GLfloat y, GLfloat z))
-ANT_GL_DECL(void, glRasterPos3fv, (const GLfloat *v))
-ANT_GL_DECL(void, glRasterPos3i, (GLint x, GLint y, GLint z))
-ANT_GL_DECL(void, glRasterPos3iv, (const GLint *v))
-ANT_GL_DECL(void, glRasterPos3s, (GLshort x, GLshort y, GLshort z))
-ANT_GL_DECL(void, glRasterPos3sv, (const GLshort *v))
-ANT_GL_DECL(void, glRasterPos4d, (GLdouble x, GLdouble y, GLdouble z, GLdouble w))
-ANT_GL_DECL(void, glRasterPos4dv, (const GLdouble *v))
-ANT_GL_DECL(void, glRasterPos4f, (GLfloat x, GLfloat y, GLfloat z, GLfloat w))
-ANT_GL_DECL(void, glRasterPos4fv, (const GLfloat *v))
-ANT_GL_DECL(void, glRasterPos4i, (GLint x, GLint y, GLint z, GLint w))
-ANT_GL_DECL(void, glRasterPos4iv, (const GLint *v))
-ANT_GL_DECL(void, glRasterPos4s, (GLshort x, GLshort y, GLshort z, GLshort w))
-ANT_GL_DECL(void, glRasterPos4sv, (const GLshort *v))
-ANT_GL_DECL(void, glReadBuffer, (GLenum mode))
-ANT_GL_DECL(void, glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels))
-ANT_GL_DECL(void, glRectd, (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2))
-ANT_GL_DECL(void, glRectdv, (const GLdouble *v1, const GLdouble *v2))
-ANT_GL_DECL(void, glRectf, (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2))
-ANT_GL_DECL(void, glRectfv, (const GLfloat *v1, const GLfloat *v2))
-ANT_GL_DECL(void, glRecti, (GLint x1, GLint y1, GLint x2, GLint y2))
-ANT_GL_DECL(void, glRectiv, (const GLint *v1, const GLint *v2))
-ANT_GL_DECL(void, glRects, (GLshort x1, GLshort y1, GLshort x2, GLshort y2))
-ANT_GL_DECL(void, glRectsv, (const GLshort *v1, const GLshort *v2))
-ANT_GL_DECL(GLint, glRenderMode, (GLenum mode))
-ANT_GL_DECL(void, glRotated, (GLdouble angle, GLdouble x, GLdouble y, GLdouble z))
-ANT_GL_DECL(void, glRotatef, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z))
-ANT_GL_DECL(void, glScaled, (GLdouble x, GLdouble y, GLdouble z))
-ANT_GL_DECL(void, glScalef, (GLfloat x, GLfloat y, GLfloat z))
-ANT_GL_DECL(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height))
-ANT_GL_DECL(void, glSelectBuffer, (GLsizei size, GLuint *buffer))
-ANT_GL_DECL(void, glShadeModel, (GLenum mode))
-ANT_GL_DECL(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask))
-ANT_GL_DECL(void, glStencilMask, (GLuint mask))
-ANT_GL_DECL(void, glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass))
-ANT_GL_DECL(void, glTexCoord1d, (GLdouble s))
-ANT_GL_DECL(void, glTexCoord1dv, (const GLdouble *v))
-ANT_GL_DECL(void, glTexCoord1f, (GLfloat s))
-ANT_GL_DECL(void, glTexCoord1fv, (const GLfloat *v))
-ANT_GL_DECL(void, glTexCoord1i, (GLint s))
-ANT_GL_DECL(void, glTexCoord1iv, (const GLint *v))
-ANT_GL_DECL(void, glTexCoord1s, (GLshort s))
-ANT_GL_DECL(void, glTexCoord1sv, (const GLshort *v))
-ANT_GL_DECL(void, glTexCoord2d, (GLdouble s, GLdouble t))
-ANT_GL_DECL(void, glTexCoord2dv, (const GLdouble *v))
-ANT_GL_DECL(void, glTexCoord2f, (GLfloat s, GLfloat t))
-ANT_GL_DECL(void, glTexCoord2fv, (const GLfloat *v))
-ANT_GL_DECL(void, glTexCoord2i, (GLint s, GLint t))
-ANT_GL_DECL(void, glTexCoord2iv, (const GLint *v))
-ANT_GL_DECL(void, glTexCoord2s, (GLshort s, GLshort t))
-ANT_GL_DECL(void, glTexCoord2sv, (const GLshort *v))
-ANT_GL_DECL(void, glTexCoord3d, (GLdouble s, GLdouble t, GLdouble r))
-ANT_GL_DECL(void, glTexCoord3dv, (const GLdouble *v))
-ANT_GL_DECL(void, glTexCoord3f, (GLfloat s, GLfloat t, GLfloat r))
-ANT_GL_DECL(void, glTexCoord3fv, (const GLfloat *v))
-ANT_GL_DECL(void, glTexCoord3i, (GLint s, GLint t, GLint r))
-ANT_GL_DECL(void, glTexCoord3iv, (const GLint *v))
-ANT_GL_DECL(void, glTexCoord3s, (GLshort s, GLshort t, GLshort r))
-ANT_GL_DECL(void, glTexCoord3sv, (const GLshort *v))
-ANT_GL_DECL(void, glTexCoord4d, (GLdouble s, GLdouble t, GLdouble r, GLdouble q))
-ANT_GL_DECL(void, glTexCoord4dv, (const GLdouble *v))
-ANT_GL_DECL(void, glTexCoord4f, (GLfloat s, GLfloat t, GLfloat r, GLfloat q))
-ANT_GL_DECL(void, glTexCoord4fv, (const GLfloat *v))
-ANT_GL_DECL(void, glTexCoord4i, (GLint s, GLint t, GLint r, GLint q))
-ANT_GL_DECL(void, glTexCoord4iv, (const GLint *v))
-ANT_GL_DECL(void, glTexCoord4s, (GLshort s, GLshort t, GLshort r, GLshort q))
-ANT_GL_DECL(void, glTexCoord4sv, (const GLshort *v))
-ANT_GL_DECL(void, glTexCoordPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer))
-ANT_GL_DECL(void, glTexEnvf, (GLenum target, GLenum pname, GLfloat param))
-ANT_GL_DECL(void, glTexEnvfv, (GLenum target, GLenum pname, const GLfloat *params))
-ANT_GL_DECL(void, glTexEnvi, (GLenum target, GLenum pname, GLint param))
-ANT_GL_DECL(void, glTexEnviv, (GLenum target, GLenum pname, const GLint *params))
-ANT_GL_DECL(void, glTexGend, (GLenum coord, GLenum pname, GLdouble param))
-ANT_GL_DECL(void, glTexGendv, (GLenum coord, GLenum pname, const GLdouble *params))
-ANT_GL_DECL(void, glTexGenf, (GLenum coord, GLenum pname, GLfloat param))
-ANT_GL_DECL(void, glTexGenfv, (GLenum coord, GLenum pname, const GLfloat *params))
-ANT_GL_DECL(void, glTexGeni, (GLenum coord, GLenum pname, GLint param))
-ANT_GL_DECL(void, glTexGeniv, (GLenum coord, GLenum pname, const GLint *params))
-#if defined(ANT_OSX) && (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
-// Mac OSX < 10.7 redefines these OpenGL calls: glTexImage1D, glTexImage2D
-ANT_GL_DECL(void, glTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_DECL(void, glTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-#else
-ANT_GL_DECL(void, glTexImage1D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_DECL(void, glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-#endif
-ANT_GL_DECL(void, glTexParameterf, (GLenum target, GLenum pname, GLfloat param))
-ANT_GL_DECL(void, glTexParameterfv, (GLenum target, GLenum pname, const GLfloat *params))
-ANT_GL_DECL(void, glTexParameteri, (GLenum target, GLenum pname, GLint param))
-ANT_GL_DECL(void, glTexParameteriv, (GLenum target, GLenum pname, const GLint *params))
-ANT_GL_DECL(void, glTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_DECL(void, glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_DECL(void, glTranslated, (GLdouble x, GLdouble y, GLdouble z))
-ANT_GL_DECL(void, glTranslatef, (GLfloat x, GLfloat y, GLfloat z))
-ANT_GL_DECL(void, glVertex2d, (GLdouble x, GLdouble y))
-ANT_GL_DECL(void, glVertex2dv, (const GLdouble *v))
-ANT_GL_DECL(void, glVertex2f, (GLfloat x, GLfloat y))
-ANT_GL_DECL(void, glVertex2fv, (const GLfloat *v))
-ANT_GL_DECL(void, glVertex2i, (GLint x, GLint y))
-ANT_GL_DECL(void, glVertex2iv, (const GLint *v))
-ANT_GL_DECL(void, glVertex2s, (GLshort x, GLshort y))
-ANT_GL_DECL(void, glVertex2sv, (const GLshort *v))
-ANT_GL_DECL(void, glVertex3d, (GLdouble x, GLdouble y, GLdouble z))
-ANT_GL_DECL(void, glVertex3dv, (const GLdouble *v))
-ANT_GL_DECL(void, glVertex3f, (GLfloat x, GLfloat y, GLfloat z))
-ANT_GL_DECL(void, glVertex3fv, (const GLfloat *v))
-ANT_GL_DECL(void, glVertex3i, (GLint x, GLint y, GLint z))
-ANT_GL_DECL(void, glVertex3iv, (const GLint *v))
-ANT_GL_DECL(void, glVertex3s, (GLshort x, GLshort y, GLshort z))
-ANT_GL_DECL(void, glVertex3sv, (const GLshort *v))
-ANT_GL_DECL(void, glVertex4d, (GLdouble x, GLdouble y, GLdouble z, GLdouble w))
-ANT_GL_DECL(void, glVertex4dv, (const GLdouble *v))
-ANT_GL_DECL(void, glVertex4f, (GLfloat x, GLfloat y, GLfloat z, GLfloat w))
-ANT_GL_DECL(void, glVertex4fv, (const GLfloat *v))
-ANT_GL_DECL(void, glVertex4i, (GLint x, GLint y, GLint z, GLint w))
-ANT_GL_DECL(void, glVertex4iv, (const GLint *v))
-ANT_GL_DECL(void, glVertex4s, (GLshort x, GLshort y, GLshort z, GLshort w))
-ANT_GL_DECL(void, glVertex4sv, (const GLshort *v))
-ANT_GL_DECL(void, glVertexPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer))
-ANT_GL_DECL(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height))
-
-#ifdef ANT_WINDOWS
-ANT_GL_DECL(PROC, wglGetProcAddress, (LPCSTR))
-#endif
-
-
-#endif // !defined ANT_LOAD_OGL_INCLUDED
diff --git a/external/AntTweakBar/src/LoadOGLCore.cpp b/external/AntTweakBar/src/LoadOGLCore.cpp
deleted file mode 100644
index 2daa573..0000000
--- a/external/AntTweakBar/src/LoadOGLCore.cpp
+++ /dev/null
@@ -1,539 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file LoadOGLCore.cpp
-// @author Philippe Decaudin
-// @license This file is part of the AntTweakBar library.
-// For conditions of distribution and use, see License.txt
-//
-// ---------------------------------------------------------------------------
-
-
-#include "TwPrecomp.h"
-#include "LoadOGLCore.h"
-
-// ---------------------------------------------------------------------------
-
-#define ANT_NB_OGL_CORE_FUNC_MAX 512
-
-struct COGLCoreFuncRec
-{
- const char * m_Name;
- GLCore::PFNOpenGL * m_FuncPtr;
- COGLCoreFuncRec() : m_Name(NULL), m_FuncPtr(NULL) {}
-};
-COGLCoreFuncRec g_OGLCoreFuncRec[ANT_NB_OGL_CORE_FUNC_MAX];
-int g_NbOGLCoreFunc = 0;
-#if defined(ANT_WINDOWS)
-HMODULE g_OGLCoreModule = NULL;
-#endif
-
-// ---------------------------------------------------------------------------
-
-// GL 1.0
-ANT_GL_CORE_IMPL(glCullFace)
-ANT_GL_CORE_IMPL(glFrontFace)
-ANT_GL_CORE_IMPL(glHint)
-ANT_GL_CORE_IMPL(glLineWidth)
-ANT_GL_CORE_IMPL(glPointSize)
-ANT_GL_CORE_IMPL(glPolygonMode)
-ANT_GL_CORE_IMPL(glScissor)
-ANT_GL_CORE_IMPL(glTexParameterf)
-ANT_GL_CORE_IMPL(glTexParameterfv)
-ANT_GL_CORE_IMPL(glTexParameteri)
-ANT_GL_CORE_IMPL(glTexParameteriv)
-ANT_GL_CORE_IMPL(glTexImage1D)
-ANT_GL_CORE_IMPL(glTexImage2D)
-ANT_GL_CORE_IMPL(glDrawBuffer)
-ANT_GL_CORE_IMPL(glClear)
-ANT_GL_CORE_IMPL(glClearColor)
-ANT_GL_CORE_IMPL(glClearStencil)
-ANT_GL_CORE_IMPL(glClearDepth)
-ANT_GL_CORE_IMPL(glStencilMask)
-ANT_GL_CORE_IMPL(glColorMask)
-ANT_GL_CORE_IMPL(glDepthMask)
-ANT_GL_CORE_IMPL(glDisable)
-ANT_GL_CORE_IMPL(glEnable)
-ANT_GL_CORE_IMPL(glFinish)
-ANT_GL_CORE_IMPL(glFlush)
-ANT_GL_CORE_IMPL(glBlendFunc)
-ANT_GL_CORE_IMPL(glLogicOp)
-ANT_GL_CORE_IMPL(glStencilFunc)
-ANT_GL_CORE_IMPL(glStencilOp)
-ANT_GL_CORE_IMPL(glDepthFunc)
-ANT_GL_CORE_IMPL(glPixelStoref)
-ANT_GL_CORE_IMPL(glPixelStorei)
-ANT_GL_CORE_IMPL(glReadBuffer)
-ANT_GL_CORE_IMPL(glReadPixels)
-ANT_GL_CORE_IMPL(glGetBooleanv)
-ANT_GL_CORE_IMPL(glGetDoublev)
-ANT_GL_CORE_IMPL(glGetError)
-ANT_GL_CORE_IMPL(glGetFloatv)
-ANT_GL_CORE_IMPL(glGetIntegerv)
-ANT_GL_CORE_IMPL(glGetString)
-ANT_GL_CORE_IMPL(glGetTexImage)
-ANT_GL_CORE_IMPL(glGetTexParameterfv)
-ANT_GL_CORE_IMPL(glGetTexParameteriv)
-ANT_GL_CORE_IMPL(glGetTexLevelParameterfv)
-ANT_GL_CORE_IMPL(glGetTexLevelParameteriv)
-ANT_GL_CORE_IMPL(glIsEnabled)
-ANT_GL_CORE_IMPL(glDepthRange)
-ANT_GL_CORE_IMPL(glViewport)
-// GL 1.1
-ANT_GL_CORE_IMPL(glDrawArrays)
-ANT_GL_CORE_IMPL(glDrawElements)
-ANT_GL_CORE_IMPL(glGetPointerv)
-ANT_GL_CORE_IMPL(glPolygonOffset)
-ANT_GL_CORE_IMPL(glCopyTexImage1D)
-ANT_GL_CORE_IMPL(glCopyTexImage2D)
-ANT_GL_CORE_IMPL(glCopyTexSubImage1D)
-ANT_GL_CORE_IMPL(glCopyTexSubImage2D)
-ANT_GL_CORE_IMPL(glTexSubImage1D)
-ANT_GL_CORE_IMPL(glTexSubImage2D)
-ANT_GL_CORE_IMPL(glBindTexture)
-ANT_GL_CORE_IMPL(glDeleteTextures)
-ANT_GL_CORE_IMPL(glGenTextures)
-ANT_GL_CORE_IMPL(glIsTexture)
-// GL 1.2
-ANT_GL_CORE_IMPL(glBlendColor)
-ANT_GL_CORE_IMPL(glBlendEquation)
-ANT_GL_CORE_IMPL(glDrawRangeElements)
-ANT_GL_CORE_IMPL(glTexImage3D)
-ANT_GL_CORE_IMPL(glTexSubImage3D)
-ANT_GL_CORE_IMPL(glCopyTexSubImage3D)
-// GL 1.3
-ANT_GL_CORE_IMPL(glActiveTexture)
-ANT_GL_CORE_IMPL(glSampleCoverage)
-ANT_GL_CORE_IMPL(glCompressedTexImage3D)
-ANT_GL_CORE_IMPL(glCompressedTexImage2D)
-ANT_GL_CORE_IMPL(glCompressedTexImage1D)
-ANT_GL_CORE_IMPL(glCompressedTexSubImage3D)
-ANT_GL_CORE_IMPL(glCompressedTexSubImage2D)
-ANT_GL_CORE_IMPL(glCompressedTexSubImage1D)
-ANT_GL_CORE_IMPL(glGetCompressedTexImage)
-// GL 1.4
-ANT_GL_CORE_IMPL(glBlendFuncSeparate)
-ANT_GL_CORE_IMPL(glMultiDrawArrays)
-ANT_GL_CORE_IMPL(glMultiDrawElements)
-ANT_GL_CORE_IMPL(glPointParameterf)
-ANT_GL_CORE_IMPL(glPointParameterfv)
-ANT_GL_CORE_IMPL(glPointParameteri)
-ANT_GL_CORE_IMPL(glPointParameteriv)
-// GL 1.5
-ANT_GL_CORE_IMPL(glGenQueries)
-ANT_GL_CORE_IMPL(glDeleteQueries)
-ANT_GL_CORE_IMPL(glIsQuery)
-ANT_GL_CORE_IMPL(glBeginQuery)
-ANT_GL_CORE_IMPL(glEndQuery)
-ANT_GL_CORE_IMPL(glGetQueryiv)
-ANT_GL_CORE_IMPL(glGetQueryObjectiv)
-ANT_GL_CORE_IMPL(glGetQueryObjectuiv)
-ANT_GL_CORE_IMPL(glBindBuffer)
-ANT_GL_CORE_IMPL(glDeleteBuffers)
-ANT_GL_CORE_IMPL(glGenBuffers)
-ANT_GL_CORE_IMPL(glIsBuffer)
-ANT_GL_CORE_IMPL(glBufferData)
-ANT_GL_CORE_IMPL(glBufferSubData)
-ANT_GL_CORE_IMPL(glGetBufferSubData)
-ANT_GL_CORE_IMPL(glMapBuffer)
-ANT_GL_CORE_IMPL(glUnmapBuffer)
-ANT_GL_CORE_IMPL(glGetBufferParameteriv)
-ANT_GL_CORE_IMPL(glGetBufferPointerv)
-// GL 2.0
-ANT_GL_CORE_IMPL(glBlendEquationSeparate)
-ANT_GL_CORE_IMPL(glDrawBuffers)
-ANT_GL_CORE_IMPL(glStencilOpSeparate)
-ANT_GL_CORE_IMPL(glStencilFuncSeparate)
-ANT_GL_CORE_IMPL(glStencilMaskSeparate)
-ANT_GL_CORE_IMPL(glAttachShader)
-ANT_GL_CORE_IMPL(glBindAttribLocation)
-ANT_GL_CORE_IMPL(glCompileShader)
-ANT_GL_CORE_IMPL(glCreateProgram)
-ANT_GL_CORE_IMPL(glCreateShader)
-ANT_GL_CORE_IMPL(glDeleteProgram)
-ANT_GL_CORE_IMPL(glDeleteShader)
-ANT_GL_CORE_IMPL(glDetachShader)
-ANT_GL_CORE_IMPL(glDisableVertexAttribArray)
-ANT_GL_CORE_IMPL(glEnableVertexAttribArray)
-ANT_GL_CORE_IMPL(glGetActiveAttrib)
-ANT_GL_CORE_IMPL(glGetActiveUniform)
-ANT_GL_CORE_IMPL(glGetAttachedShaders)
-ANT_GL_CORE_IMPL(glGetAttribLocation)
-ANT_GL_CORE_IMPL(glGetProgramiv)
-ANT_GL_CORE_IMPL(glGetProgramInfoLog)
-ANT_GL_CORE_IMPL(glGetShaderiv)
-ANT_GL_CORE_IMPL(glGetShaderInfoLog)
-ANT_GL_CORE_IMPL(glGetShaderSource)
-ANT_GL_CORE_IMPL(glGetUniformLocation)
-ANT_GL_CORE_IMPL(glGetUniformfv)
-ANT_GL_CORE_IMPL(glGetUniformiv)
-ANT_GL_CORE_IMPL(glGetVertexAttribdv)
-ANT_GL_CORE_IMPL(glGetVertexAttribfv)
-ANT_GL_CORE_IMPL(glGetVertexAttribiv)
-ANT_GL_CORE_IMPL(glGetVertexAttribPointerv)
-ANT_GL_CORE_IMPL(glIsProgram)
-ANT_GL_CORE_IMPL(glIsShader)
-ANT_GL_CORE_IMPL(glLinkProgram)
-ANT_GL_CORE_IMPL(glShaderSource)
-ANT_GL_CORE_IMPL(glUseProgram)
-ANT_GL_CORE_IMPL(glUniform1f)
-ANT_GL_CORE_IMPL(glUniform2f)
-ANT_GL_CORE_IMPL(glUniform3f)
-ANT_GL_CORE_IMPL(glUniform4f)
-ANT_GL_CORE_IMPL(glUniform1i)
-ANT_GL_CORE_IMPL(glUniform2i)
-ANT_GL_CORE_IMPL(glUniform3i)
-ANT_GL_CORE_IMPL(glUniform4i)
-ANT_GL_CORE_IMPL(glUniform1fv)
-ANT_GL_CORE_IMPL(glUniform2fv)
-ANT_GL_CORE_IMPL(glUniform3fv)
-ANT_GL_CORE_IMPL(glUniform4fv)
-ANT_GL_CORE_IMPL(glUniform1iv)
-ANT_GL_CORE_IMPL(glUniform2iv)
-ANT_GL_CORE_IMPL(glUniform3iv)
-ANT_GL_CORE_IMPL(glUniform4iv)
-ANT_GL_CORE_IMPL(glUniformMatrix2fv)
-ANT_GL_CORE_IMPL(glUniformMatrix3fv)
-ANT_GL_CORE_IMPL(glUniformMatrix4fv)
-ANT_GL_CORE_IMPL(glValidateProgram)
-ANT_GL_CORE_IMPL(glVertexAttrib1d)
-ANT_GL_CORE_IMPL(glVertexAttrib1dv)
-ANT_GL_CORE_IMPL(glVertexAttrib1f)
-ANT_GL_CORE_IMPL(glVertexAttrib1fv)
-ANT_GL_CORE_IMPL(glVertexAttrib1s)
-ANT_GL_CORE_IMPL(glVertexAttrib1sv)
-ANT_GL_CORE_IMPL(glVertexAttrib2d)
-ANT_GL_CORE_IMPL(glVertexAttrib2dv)
-ANT_GL_CORE_IMPL(glVertexAttrib2f)
-ANT_GL_CORE_IMPL(glVertexAttrib2fv)
-ANT_GL_CORE_IMPL(glVertexAttrib2s)
-ANT_GL_CORE_IMPL(glVertexAttrib2sv)
-ANT_GL_CORE_IMPL(glVertexAttrib3d)
-ANT_GL_CORE_IMPL(glVertexAttrib3dv)
-ANT_GL_CORE_IMPL(glVertexAttrib3f)
-ANT_GL_CORE_IMPL(glVertexAttrib3fv)
-ANT_GL_CORE_IMPL(glVertexAttrib3s)
-ANT_GL_CORE_IMPL(glVertexAttrib3sv)
-ANT_GL_CORE_IMPL(glVertexAttrib4Nbv)
-ANT_GL_CORE_IMPL(glVertexAttrib4Niv)
-ANT_GL_CORE_IMPL(glVertexAttrib4Nsv)
-ANT_GL_CORE_IMPL(glVertexAttrib4Nub)
-ANT_GL_CORE_IMPL(glVertexAttrib4Nubv)
-ANT_GL_CORE_IMPL(glVertexAttrib4Nuiv)
-ANT_GL_CORE_IMPL(glVertexAttrib4Nusv)
-ANT_GL_CORE_IMPL(glVertexAttrib4bv)
-ANT_GL_CORE_IMPL(glVertexAttrib4d)
-ANT_GL_CORE_IMPL(glVertexAttrib4dv)
-ANT_GL_CORE_IMPL(glVertexAttrib4f)
-ANT_GL_CORE_IMPL(glVertexAttrib4fv)
-ANT_GL_CORE_IMPL(glVertexAttrib4iv)
-ANT_GL_CORE_IMPL(glVertexAttrib4s)
-ANT_GL_CORE_IMPL(glVertexAttrib4sv)
-ANT_GL_CORE_IMPL(glVertexAttrib4ubv)
-ANT_GL_CORE_IMPL(glVertexAttrib4uiv)
-ANT_GL_CORE_IMPL(glVertexAttrib4usv)
-ANT_GL_CORE_IMPL(glVertexAttribPointer)
-/*
-// GL 2.1
-ANT_GL_CORE_IMPL(glUniformMatrix2x3fv)
-ANT_GL_CORE_IMPL(glUniformMatrix3x2fv)
-ANT_GL_CORE_IMPL(glUniformMatrix2x4fv)
-ANT_GL_CORE_IMPL(glUniformMatrix4x2fv)
-ANT_GL_CORE_IMPL(glUniformMatrix3x4fv)
-ANT_GL_CORE_IMPL(glUniformMatrix4x3fv)
-// GL 3.0
-ANT_GL_CORE_IMPL(glColorMaski)
-ANT_GL_CORE_IMPL(glGetBooleani_v)
-ANT_GL_CORE_IMPL(glGetIntegeri_v)
-ANT_GL_CORE_IMPL(glEnablei)
-ANT_GL_CORE_IMPL(glDisablei)
-ANT_GL_CORE_IMPL(glIsEnabledi)
-ANT_GL_CORE_IMPL(glBeginTransformFeedback)
-ANT_GL_CORE_IMPL(glEndTransformFeedback)
-ANT_GL_CORE_IMPL(glBindBufferRange)
-ANT_GL_CORE_IMPL(glBindBufferBase)
-ANT_GL_CORE_IMPL(glTransformFeedbackVaryings)
-ANT_GL_CORE_IMPL(glGetTransformFeedbackVarying)
-ANT_GL_CORE_IMPL(glClampColor)
-ANT_GL_CORE_IMPL(glBeginConditionalRender)
-ANT_GL_CORE_IMPL(glEndConditionalRender)
-ANT_GL_CORE_IMPL(glVertexAttribIPointer)
-ANT_GL_CORE_IMPL(glGetVertexAttribIiv)
-ANT_GL_CORE_IMPL(glGetVertexAttribIuiv)
-ANT_GL_CORE_IMPL(glVertexAttribI1i)
-ANT_GL_CORE_IMPL(glVertexAttribI2i)
-ANT_GL_CORE_IMPL(glVertexAttribI3i)
-ANT_GL_CORE_IMPL(glVertexAttribI4i)
-ANT_GL_CORE_IMPL(glVertexAttribI1ui)
-ANT_GL_CORE_IMPL(glVertexAttribI2ui)
-ANT_GL_CORE_IMPL(glVertexAttribI3ui)
-ANT_GL_CORE_IMPL(glVertexAttribI4ui)
-ANT_GL_CORE_IMPL(glVertexAttribI1iv)
-ANT_GL_CORE_IMPL(glVertexAttribI2iv)
-ANT_GL_CORE_IMPL(glVertexAttribI3iv)
-ANT_GL_CORE_IMPL(glVertexAttribI4iv)
-ANT_GL_CORE_IMPL(glVertexAttribI1uiv)
-ANT_GL_CORE_IMPL(glVertexAttribI2uiv)
-ANT_GL_CORE_IMPL(glVertexAttribI3uiv)
-ANT_GL_CORE_IMPL(glVertexAttribI4uiv)
-ANT_GL_CORE_IMPL(glVertexAttribI4bv)
-ANT_GL_CORE_IMPL(glVertexAttribI4sv)
-ANT_GL_CORE_IMPL(glVertexAttribI4ubv)
-ANT_GL_CORE_IMPL(glVertexAttribI4usv)
-ANT_GL_CORE_IMPL(glGetUniformuiv)
-ANT_GL_CORE_IMPL(glBindFragDataLocation)
-ANT_GL_CORE_IMPL(glGetFragDataLocation)
-ANT_GL_CORE_IMPL(glUniform1ui)
-ANT_GL_CORE_IMPL(glUniform2ui)
-ANT_GL_CORE_IMPL(glUniform3ui)
-ANT_GL_CORE_IMPL(glUniform4ui)
-ANT_GL_CORE_IMPL(glUniform1uiv)
-ANT_GL_CORE_IMPL(glUniform2uiv)
-ANT_GL_CORE_IMPL(glUniform3uiv)
-ANT_GL_CORE_IMPL(glUniform4uiv)
-ANT_GL_CORE_IMPL(glTexParameterIiv)
-ANT_GL_CORE_IMPL(glTexParameterIuiv)
-ANT_GL_CORE_IMPL(glGetTexParameterIiv)
-ANT_GL_CORE_IMPL(glGetTexParameterIuiv)
-ANT_GL_CORE_IMPL(glClearBufferiv)
-ANT_GL_CORE_IMPL(glClearBufferuiv)
-ANT_GL_CORE_IMPL(glClearBufferfv)
-ANT_GL_CORE_IMPL(glClearBufferfi)
-ANT_GL_CORE_IMPL(glGetStringi)
-// GL 3.1
-ANT_GL_CORE_IMPL(glDrawArraysInstanced)
-ANT_GL_CORE_IMPL(glDrawElementsInstanced)
-ANT_GL_CORE_IMPL(glTexBuffer)
-ANT_GL_CORE_IMPL(glPrimitiveRestartIndex)
-// GL 3.2
-//ANT_GL_CORE_IMPL(glGetInteger64i_v)
-//ANT_GL_CORE_IMPL(glGetBufferParameteri64v)
-ANT_GL_CORE_IMPL(glFramebufferTexture)
-*/
-
-// GL_ARB_vertex_array_object
-#if defined(ANT_WINDOWS)
- ANT_GL_CORE_IMPL(glBindVertexArray)
- ANT_GL_CORE_IMPL(glDeleteVertexArrays)
- ANT_GL_CORE_IMPL(glGenVertexArrays)
- ANT_GL_CORE_IMPL(glIsVertexArray)
-#else
- // these extensions are loaded explicitely by LoadOpenGLCore
- // because they may not be avialable on non-OpenGL 3.2 environments
- namespace GLCore
- {
- PFNglBindVertexArray _glBindVertexArray = NULL;
- PFNglDeleteVertexArrays _glDeleteVertexArrays = NULL;
- PFNglGenVertexArrays _glGenVertexArrays = NULL;
- PFNglIsVertexArray _glIsVertexArray = NULL;
- }
-#endif
-
-#if defined(ANT_WINDOWS)
- ANT_GL_CORE_IMPL(wglGetProcAddress)
-#endif
-
-namespace GLCore { PFNGLGetProcAddress _glGetProcAddress = NULL; }
-
-// ---------------------------------------------------------------------------
-
-#if defined(ANT_WINDOWS)
-
- // ---------------------------------------------------------------------------
-
- int LoadOpenGLCore()
- {
- if( g_OGLCoreModule!=NULL )
- {
- return 1; // "OpenGL library already loaded"
- }
-
- g_OGLCoreModule = LoadLibrary("OPENGL32.DLL");
- if( g_OGLCoreModule )
- {
- // Info(VERB_LOW, "Load %d OpenGL Core functions", g_NbOGLCoreFunc);
-
- int Res = 1;
-
- // Use wglGetProcAddress to retreive Core functions
- _glGetProcAddress = reinterpret_cast(GetProcAddress(g_OGLCoreModule, "wglGetProcAddress"));
- if( _glGetProcAddress!=NULL )
- for(int i=0; i0);
- // Try to get the function pointer with wglGetProcAddress
- *(g_OGLCoreFuncRec[i].m_FuncPtr) = reinterpret_cast(_glGetProcAddress(g_OGLCoreFuncRec[i].m_Name));
- if( *(g_OGLCoreFuncRec[i].m_FuncPtr)==NULL )
- {
- // Try to get the function pointer with GetProcAddress
- *(g_OGLCoreFuncRec[i].m_FuncPtr) = reinterpret_cast(GetProcAddress(g_OGLCoreModule, g_OGLCoreFuncRec[i].m_Name));
- if( *(g_OGLCoreFuncRec[i].m_FuncPtr)==NULL )
- {
- #ifdef _DEBUG
- fprintf(stderr, "AntTweakBar: Cannot load function %s\n", g_OGLCoreFuncRec[i].m_Name);
- #endif
- Res = 0; // Error("cannot find OpenGL Core function");
- }
- }
-
- }
-
- return Res;
- }
- else
- {
- // InternDisplayLastErrorWIN("Cannot load opengl32 DLL", false);
- return 0; // cannot load DLL
- }
- }
-
- // ---------------------------------------------------------------------------
-
- int UnloadOpenGLCore()
- {
- if( g_OGLCoreModule==NULL )
- {
- return 1; // "OpenGL library not loaded"
- }
-
- // Info(VERB_LOW, "Unload %d OpenGL Core functions", g_NbOGLCoreFunc);
- for(int i=0; i0);
- *(g_OGLCoreFuncRec[i].m_FuncPtr) = NULL;
- }
- if( FreeLibrary(g_OGLCoreModule) )
- {
- // Info(VERB_LOW, "OpenGL library unloaded");
- g_OGLCoreModule = NULL;
- return 1;
- }
- else
- {
- // InternDisplayLastErrorWIN("Cannot unload opengl32 DLL", false);
- return 0; // cannot unload opengl32.dll
- }
- }
-
- // ---------------------------------------------------------------------------
-
- namespace GLCore
- {
-
- PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr)
- {
- if( g_NbOGLCoreFunc>=ANT_NB_OGL_CORE_FUNC_MAX )
- {
- fprintf(stderr, "Too many OpenGL Core functions declared. Change ANT_NB_OGL_CORE_FUNC_MAX.");
- exit(-1);
- }
-
- g_OGLCoreFuncRec[g_NbOGLCoreFunc].m_Name = _FuncName;
- g_OGLCoreFuncRec[g_NbOGLCoreFunc].m_FuncPtr = _FuncPtr;
- ++g_NbOGLCoreFunc;
-
- return NULL;
- }
-
- } // namespace GL
-
- // ---------------------------------------------------------------------------
-
-#endif // defined(ANT_WINDOWS)
-
-// ---------------------------------------------------------------------------
-
-#if defined(ANT_UNIX)
-
- int LoadOpenGLCore()
- {
- _glGetProcAddress = reinterpret_cast(glXGetProcAddressARB);
-
- _glBindVertexArray = reinterpret_cast(_glGetProcAddress("glBindVertexArray"));
- _glDeleteVertexArrays = reinterpret_cast(_glGetProcAddress("glDeleteVertexArrays"));
- _glGenVertexArrays = reinterpret_cast(_glGetProcAddress("glGenVertexArrays"));
- _glIsVertexArray = reinterpret_cast(_glGetProcAddress("glIsVertexArray"));
-
- if( _glBindVertexArray==NULL || _glDeleteVertexArrays==NULL || _glGenVertexArrays==NULL || _glIsVertexArray==NULL )
- {
- fprintf(stderr, "AntTweakBar: OpenGL Core Profile functions cannot be loaded.\n");
- return 0;
- }
- else
- return 1;
- }
-
- int UnloadOpenGLCore()
- {
- return 1;
- }
-
-#elif defined(ANT_OSX)
-
- #include
-
- static void *gl_dyld = NULL;
- static const char *gl_prefix = "_";
- void *NSGLCoreGetProcAddressNew(const GLubyte *name)
- {
- void *proc=NULL;
- if (gl_dyld == NULL)
- {
- gl_dyld = dlopen("OpenGL",RTLD_LAZY);
- }
- if (gl_dyld)
- {
- NSString *sym = [[NSString alloc] initWithFormat: @"%s%s",gl_prefix,name];
- proc = dlsym(gl_dyld,[sym UTF8String]);
- [sym release];
- }
- return proc;
- }
-
- int LoadOpenGLCore()
- {
- _glGetProcAddress = reinterpret_cast(NSGLCoreGetProcAddressNew);
-
- _glBindVertexArray = reinterpret_cast(_glGetProcAddress("glBindVertexArray"));
- _glDeleteVertexArrays = reinterpret_cast(_glGetProcAddress("glDeleteVertexArrays"));
- _glGenVertexArrays = reinterpret_cast(_glGetProcAddress("glGenVertexArrays"));
- _glIsVertexArray = reinterpret_cast(_glGetProcAddress("glIsVertexArray"));
-
- if( _glBindVertexArray==NULL || _glDeleteVertexArrays==NULL || _glGenVertexArrays==NULL || _glIsVertexArray==NULL )
- {
- // remove the symbols underscore prefix (OSX 10.7 and later)
- gl_prefix = "";
-
- _glBindVertexArray = reinterpret_cast(_glGetProcAddress("glBindVertexArray"));
- _glDeleteVertexArrays = reinterpret_cast(_glGetProcAddress("glDeleteVertexArrays"));
- _glGenVertexArrays = reinterpret_cast(_glGetProcAddress("glGenVertexArrays"));
- _glIsVertexArray = reinterpret_cast(_glGetProcAddress("glIsVertexArray"));
-
- if( _glBindVertexArray==NULL || _glDeleteVertexArrays==NULL || _glGenVertexArrays==NULL || _glIsVertexArray==NULL )
- {
- fprintf(stderr, "AntTweakBar: OpenGL Core Profile functions cannot be loaded.\n");
- return 0;
- }
- }
-
- return 1;
- }
-
- int UnloadOpenGLCore()
- {
- if (gl_dyld)
- {
- dlclose(gl_dyld);
- gl_dyld = NULL;
- }
- return 1;
- }
-
-#endif
-
-// ---------------------------------------------------------------------------
diff --git a/external/AntTweakBar/src/LoadOGLCore.h b/external/AntTweakBar/src/LoadOGLCore.h
deleted file mode 100644
index be29b14..0000000
--- a/external/AntTweakBar/src/LoadOGLCore.h
+++ /dev/null
@@ -1,403 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file LoadOGLCore.h
-// @brief OpenGL Core Profile declarations for dynamic loading
-// @author Philippe Decaudin
-// @license This file is part of the AntTweakBar library.
-// For conditions of distribution and use, see License.txt
-//
-// note: Private header
-//
-// ---------------------------------------------------------------------------
-
-
-#if !defined ANT_LOAD_OGL_CORE_INCLUDED
-#define ANT_LOAD_OGL_CORE_INCLUDED
-
-
-#define ANT_GL_CORE_DECL_NO_FORWARD(_Ret, _Fct, _Params) \
- extern "C" { typedef _Ret (APIENTRY* PFN##_Fct)_Params; } \
- namespace GLCore { extern PFN##_Fct _##_Fct; } \
- using GLCore::_##_Fct;
-
-#if defined(ANT_WINDOWS)
-# define ANT_GL_CORE_DECL(_Ret, _Fct, _Params) \
- ANT_GL_CORE_DECL_NO_FORWARD(_Ret, _Fct, _Params)
-# define ANT_GL_CORE_IMPL(_Fct) \
- namespace GLCore { PFN##_Fct _##_Fct = (PFN##_Fct)Record(#_Fct, (PFNOpenGL*)(&_##_Fct)); }
-#elif defined(ANT_UNIX) || defined(ANT_OSX)
-# if !defined(APIENTRY)
-# define APIENTRY
-# endif
-# define ANT_GL_CORE_DECL(_Ret, _Fct, _Params) \
- ANT_GL_CORE_DECL_NO_FORWARD(_Ret, _Fct, _Params) \
- extern "C" { _Ret APIENTRY _Fct _Params; }
-# define ANT_GL_CORE_IMPL(_Fct) \
- namespace GLCore { PFN##_Fct _##_Fct = _Fct; }
-#endif
-
-
-int LoadOpenGLCore();
-int UnloadOpenGLCore();
-
-namespace GLCore
-{
- extern "C" { typedef void (APIENTRY* PFNOpenGL)(); }
- PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr);
-
- extern "C" { typedef PFNOpenGL (APIENTRY *PFNGLGetProcAddress)(const char *); }
- extern PFNGLGetProcAddress _glGetProcAddress;
-}
-using GLCore::_glGetProcAddress;
-
-
-// GL 1.0
-ANT_GL_CORE_DECL(void, glCullFace, (GLenum mode))
-ANT_GL_CORE_DECL(void, glFrontFace, (GLenum mode))
-ANT_GL_CORE_DECL(void, glHint, (GLenum target, GLenum mode))
-ANT_GL_CORE_DECL(void, glLineWidth, (GLfloat width))
-ANT_GL_CORE_DECL(void, glPointSize, (GLfloat size))
-ANT_GL_CORE_DECL(void, glPolygonMode, (GLenum face, GLenum mode))
-ANT_GL_CORE_DECL(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height))
-ANT_GL_CORE_DECL(void, glTexParameterf, (GLenum target, GLenum pname, GLfloat param))
-ANT_GL_CORE_DECL(void, glTexParameterfv, (GLenum target, GLenum pname, const GLfloat *params))
-ANT_GL_CORE_DECL(void, glTexParameteri, (GLenum target, GLenum pname, GLint param))
-ANT_GL_CORE_DECL(void, glTexParameteriv, (GLenum target, GLenum pname, const GLint *params))
-#if defined(ANT_OSX) && (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
-// Mac OSX < 10.7 redefines these OpenGL calls: glTexImage1D, glTexImage2D
-ANT_GL_CORE_DECL(void, glTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_CORE_DECL(void, glTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-#else
-ANT_GL_CORE_DECL(void, glTexImage1D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_CORE_DECL(void, glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-#endif
-ANT_GL_CORE_DECL(void, glDrawBuffer, (GLenum mode))
-ANT_GL_CORE_DECL(void, glClear, (GLbitfield mask))
-ANT_GL_CORE_DECL(void, glClearColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha))
-ANT_GL_CORE_DECL(void, glClearStencil, (GLint s))
-ANT_GL_CORE_DECL(void, glClearDepth, (GLclampd depth))
-ANT_GL_CORE_DECL(void, glStencilMask, (GLuint mask))
-ANT_GL_CORE_DECL(void, glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha))
-ANT_GL_CORE_DECL(void, glDepthMask, (GLboolean flag))
-ANT_GL_CORE_DECL(void, glDisable, (GLenum cap))
-ANT_GL_CORE_DECL(void, glEnable, (GLenum cap))
-ANT_GL_CORE_DECL(void, glFinish, (void))
-ANT_GL_CORE_DECL(void, glFlush, (void))
-ANT_GL_CORE_DECL(void, glBlendFunc, (GLenum sfactor, GLenum dfactor))
-ANT_GL_CORE_DECL(void, glLogicOp, (GLenum opcode))
-ANT_GL_CORE_DECL(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask))
-ANT_GL_CORE_DECL(void, glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass))
-ANT_GL_CORE_DECL(void, glDepthFunc, (GLenum func))
-ANT_GL_CORE_DECL(void, glPixelStoref, (GLenum pname, GLfloat param))
-ANT_GL_CORE_DECL(void, glPixelStorei, (GLenum pname, GLint param))
-ANT_GL_CORE_DECL(void, glReadBuffer, (GLenum mode))
-ANT_GL_CORE_DECL(void, glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels))
-ANT_GL_CORE_DECL(void, glGetBooleanv, (GLenum pname, GLboolean *params))
-ANT_GL_CORE_DECL(void, glGetDoublev, (GLenum pname, GLdouble *params))
-ANT_GL_CORE_DECL(GLenum, glGetError, (void))
-ANT_GL_CORE_DECL(void, glGetFloatv, (GLenum pname, GLfloat *params))
-ANT_GL_CORE_DECL(void, glGetIntegerv, (GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(const GLubyte *, glGetString, (GLenum name))
-ANT_GL_CORE_DECL(void, glGetTexImage, (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels))
-ANT_GL_CORE_DECL(void, glGetTexParameterfv, (GLenum target, GLenum pname, GLfloat *params))
-ANT_GL_CORE_DECL(void, glGetTexParameteriv, (GLenum target, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(void, glGetTexLevelParameterfv, (GLenum target, GLint level, GLenum pname, GLfloat *params))
-ANT_GL_CORE_DECL(void, glGetTexLevelParameteriv, (GLenum target, GLint level, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(GLboolean, glIsEnabled, (GLenum cap))
-ANT_GL_CORE_DECL(void, glDepthRange, (GLclampd near, GLclampd far))
-ANT_GL_CORE_DECL(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height))
-// GL 1.1
-ANT_GL_CORE_DECL(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count))
-ANT_GL_CORE_DECL(void, glDrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices))
-ANT_GL_CORE_DECL(void, glGetPointerv, (GLenum pname, GLvoid* *params))
-ANT_GL_CORE_DECL(void, glPolygonOffset, (GLfloat factor, GLfloat units))
-ANT_GL_CORE_DECL(void, glCopyTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border))
-ANT_GL_CORE_DECL(void, glCopyTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border))
-ANT_GL_CORE_DECL(void, glCopyTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width))
-ANT_GL_CORE_DECL(void, glCopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height))
-ANT_GL_CORE_DECL(void, glTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_CORE_DECL(void, glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_CORE_DECL(void, glBindTexture, (GLenum target, GLuint texture))
-ANT_GL_CORE_DECL(void, glDeleteTextures, (GLsizei n, const GLuint *textures))
-ANT_GL_CORE_DECL(void, glGenTextures, (GLsizei n, GLuint *textures))
-ANT_GL_CORE_DECL(GLboolean, glIsTexture, (GLuint texture))
-// GL 1.2
-ANT_GL_CORE_DECL(void, glBlendColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha))
-ANT_GL_CORE_DECL(void, glBlendEquation, (GLenum mode))
-ANT_GL_CORE_DECL(void, glDrawRangeElements, (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices))
-#if defined(ANT_OSX) && (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
-// Mac OSX < 10.7 redefines this OpenGL call: glTexImage3D
-ANT_GL_CORE_DECL(void, glTexImage3D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-#else
-ANT_GL_CORE_DECL(void, glTexImage3D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
-#endif
-ANT_GL_CORE_DECL(void, glTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels))
-ANT_GL_CORE_DECL(void, glCopyTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height))
-// GL 1.3
-ANT_GL_CORE_DECL(void, glActiveTexture, (GLenum texture))
-ANT_GL_CORE_DECL(void, glSampleCoverage, (GLclampf value, GLboolean invert))
-ANT_GL_CORE_DECL(void, glCompressedTexImage3D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data))
-ANT_GL_CORE_DECL(void, glCompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data))
-ANT_GL_CORE_DECL(void, glCompressedTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data))
-ANT_GL_CORE_DECL(void, glCompressedTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data))
-ANT_GL_CORE_DECL(void, glCompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data))
-ANT_GL_CORE_DECL(void, glCompressedTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data))
-ANT_GL_CORE_DECL(void, glGetCompressedTexImage, (GLenum target, GLint level, GLvoid *img))
-// GL 1.4
-ANT_GL_CORE_DECL(void, glBlendFuncSeparate, (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha))
-ANT_GL_CORE_DECL(void, glMultiDrawArrays, (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount))
-ANT_GL_CORE_DECL(void, glMultiDrawElements, (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount))
-ANT_GL_CORE_DECL(void, glPointParameterf, (GLenum pname, GLfloat param))
-ANT_GL_CORE_DECL(void, glPointParameterfv, (GLenum pname, const GLfloat *params))
-ANT_GL_CORE_DECL(void, glPointParameteri, (GLenum pname, GLint param))
-ANT_GL_CORE_DECL(void, glPointParameteriv, (GLenum pname, const GLint *params))
-// GL 1.5
-#ifndef ANT_OSX
- typedef ptrdiff_t GLintptr;
- typedef ptrdiff_t GLsizeiptr;
-#endif
-ANT_GL_CORE_DECL(void, glGenQueries, (GLsizei n, GLuint *ids))
-ANT_GL_CORE_DECL(void, glDeleteQueries, (GLsizei n, const GLuint *ids))
-ANT_GL_CORE_DECL(GLboolean, glIsQuery, (GLuint id))
-ANT_GL_CORE_DECL(void, glBeginQuery, (GLenum target, GLuint id))
-ANT_GL_CORE_DECL(void, glEndQuery, (GLenum target))
-ANT_GL_CORE_DECL(void, glGetQueryiv, (GLenum target, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(void, glGetQueryObjectiv, (GLuint id, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(void, glGetQueryObjectuiv, (GLuint id, GLenum pname, GLuint *params))
-ANT_GL_CORE_DECL(void, glBindBuffer, (GLenum target, GLuint buffer))
-ANT_GL_CORE_DECL(void, glDeleteBuffers, (GLsizei n, const GLuint *buffers))
-ANT_GL_CORE_DECL(void, glGenBuffers, (GLsizei n, GLuint *buffers))
-ANT_GL_CORE_DECL(GLboolean, glIsBuffer, (GLuint buffer))
-ANT_GL_CORE_DECL(void, glBufferData, (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage))
-ANT_GL_CORE_DECL(void, glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data))
-ANT_GL_CORE_DECL(void, glGetBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data))
-ANT_GL_CORE_DECL(GLvoid*, glMapBuffer, (GLenum target, GLenum access))
-ANT_GL_CORE_DECL(GLboolean, glUnmapBuffer, (GLenum target))
-ANT_GL_CORE_DECL(void, glGetBufferParameteriv, (GLenum target, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(void, glGetBufferPointerv, (GLenum target, GLenum pname, GLvoid* *params))
-// GL 2.0
-typedef char GLchar;
-ANT_GL_CORE_DECL(void, glBlendEquationSeparate, (GLenum modeRGB, GLenum modeAlpha))
-ANT_GL_CORE_DECL(void, glDrawBuffers, (GLsizei n, const GLenum *bufs))
-ANT_GL_CORE_DECL(void, glStencilOpSeparate, (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass))
-ANT_GL_CORE_DECL(void, glStencilFuncSeparate, (GLenum face, GLenum func, GLint ref, GLuint mask))
-ANT_GL_CORE_DECL(void, glStencilMaskSeparate, (GLenum face, GLuint mask))
-ANT_GL_CORE_DECL(void, glAttachShader, (GLuint program, GLuint shader))
-ANT_GL_CORE_DECL(void, glBindAttribLocation, (GLuint program, GLuint index, const GLchar *name))
-ANT_GL_CORE_DECL(void, glCompileShader, (GLuint shader))
-ANT_GL_CORE_DECL(GLuint, glCreateProgram, (void))
-ANT_GL_CORE_DECL(GLuint, glCreateShader, (GLenum type))
-ANT_GL_CORE_DECL(void, glDeleteProgram, (GLuint program))
-ANT_GL_CORE_DECL(void, glDeleteShader, (GLuint shader))
-ANT_GL_CORE_DECL(void, glDetachShader, (GLuint program, GLuint shader))
-ANT_GL_CORE_DECL(void, glDisableVertexAttribArray, (GLuint index))
-ANT_GL_CORE_DECL(void, glEnableVertexAttribArray, (GLuint index))
-ANT_GL_CORE_DECL(void, glGetActiveAttrib, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name))
-ANT_GL_CORE_DECL(void, glGetActiveUniform, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name))
-ANT_GL_CORE_DECL(void, glGetAttachedShaders, (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj))
-ANT_GL_CORE_DECL(GLint, glGetAttribLocation, (GLuint program, const GLchar *name))
-ANT_GL_CORE_DECL(void, glGetProgramiv, (GLuint program, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(void, glGetProgramInfoLog, (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog))
-ANT_GL_CORE_DECL(void, glGetShaderiv, (GLuint shader, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(void, glGetShaderInfoLog, (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog))
-ANT_GL_CORE_DECL(void, glGetShaderSource, (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source))
-ANT_GL_CORE_DECL(GLint, glGetUniformLocation, (GLuint program, const GLchar *name))
-ANT_GL_CORE_DECL(void, glGetUniformfv, (GLuint program, GLint location, GLfloat *params))
-ANT_GL_CORE_DECL(void, glGetUniformiv, (GLuint program, GLint location, GLint *params))
-ANT_GL_CORE_DECL(void, glGetVertexAttribdv, (GLuint index, GLenum pname, GLdouble *params))
-ANT_GL_CORE_DECL(void, glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat *params))
-ANT_GL_CORE_DECL(void, glGetVertexAttribiv, (GLuint index, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(void, glGetVertexAttribPointerv, (GLuint index, GLenum pname, GLvoid* *pointer))
-ANT_GL_CORE_DECL(GLboolean, glIsProgram, (GLuint program))
-ANT_GL_CORE_DECL(GLboolean, glIsShader, (GLuint shader))
-ANT_GL_CORE_DECL(void, glLinkProgram, (GLuint program))
-ANT_GL_CORE_DECL(void, glShaderSource, (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length))
-ANT_GL_CORE_DECL(void, glUseProgram, (GLuint program))
-ANT_GL_CORE_DECL(void, glUniform1f, (GLint location, GLfloat v0))
-ANT_GL_CORE_DECL(void, glUniform2f, (GLint location, GLfloat v0, GLfloat v1))
-ANT_GL_CORE_DECL(void, glUniform3f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2))
-ANT_GL_CORE_DECL(void, glUniform4f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3))
-ANT_GL_CORE_DECL(void, glUniform1i, (GLint location, GLint v0))
-ANT_GL_CORE_DECL(void, glUniform2i, (GLint location, GLint v0, GLint v1))
-ANT_GL_CORE_DECL(void, glUniform3i, (GLint location, GLint v0, GLint v1, GLint v2))
-ANT_GL_CORE_DECL(void, glUniform4i, (GLint location, GLint v0, GLint v1, GLint v2, GLint v3))
-ANT_GL_CORE_DECL(void, glUniform1fv, (GLint location, GLsizei count, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniform2fv, (GLint location, GLsizei count, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniform3fv, (GLint location, GLsizei count, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniform4fv, (GLint location, GLsizei count, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniform1iv, (GLint location, GLsizei count, const GLint *value))
-ANT_GL_CORE_DECL(void, glUniform2iv, (GLint location, GLsizei count, const GLint *value))
-ANT_GL_CORE_DECL(void, glUniform3iv, (GLint location, GLsizei count, const GLint *value))
-ANT_GL_CORE_DECL(void, glUniform4iv, (GLint location, GLsizei count, const GLint *value))
-ANT_GL_CORE_DECL(void, glUniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glValidateProgram, (GLuint program))
-ANT_GL_CORE_DECL(void, glVertexAttrib1d, (GLuint index, GLdouble x))
-ANT_GL_CORE_DECL(void, glVertexAttrib1dv, (GLuint index, const GLdouble *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib1f, (GLuint index, GLfloat x))
-ANT_GL_CORE_DECL(void, glVertexAttrib1fv, (GLuint index, const GLfloat *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib1s, (GLuint index, GLshort x))
-ANT_GL_CORE_DECL(void, glVertexAttrib1sv, (GLuint index, const GLshort *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib2d, (GLuint index, GLdouble x, GLdouble y))
-ANT_GL_CORE_DECL(void, glVertexAttrib2dv, (GLuint index, const GLdouble *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib2f, (GLuint index, GLfloat x, GLfloat y))
-ANT_GL_CORE_DECL(void, glVertexAttrib2fv, (GLuint index, const GLfloat *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib2s, (GLuint index, GLshort x, GLshort y))
-ANT_GL_CORE_DECL(void, glVertexAttrib2sv, (GLuint index, const GLshort *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib3d, (GLuint index, GLdouble x, GLdouble y, GLdouble z))
-ANT_GL_CORE_DECL(void, glVertexAttrib3dv, (GLuint index, const GLdouble *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib3f, (GLuint index, GLfloat x, GLfloat y, GLfloat z))
-ANT_GL_CORE_DECL(void, glVertexAttrib3fv, (GLuint index, const GLfloat *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib3s, (GLuint index, GLshort x, GLshort y, GLshort z))
-ANT_GL_CORE_DECL(void, glVertexAttrib3sv, (GLuint index, const GLshort *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4Nbv, (GLuint index, const GLbyte *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4Niv, (GLuint index, const GLint *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4Nsv, (GLuint index, const GLshort *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4Nub, (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w))
-ANT_GL_CORE_DECL(void, glVertexAttrib4Nubv, (GLuint index, const GLubyte *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4Nuiv, (GLuint index, const GLuint *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4Nusv, (GLuint index, const GLushort *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4bv, (GLuint index, const GLbyte *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4d, (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w))
-ANT_GL_CORE_DECL(void, glVertexAttrib4dv, (GLuint index, const GLdouble *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4f, (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w))
-ANT_GL_CORE_DECL(void, glVertexAttrib4fv, (GLuint index, const GLfloat *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4iv, (GLuint index, const GLint *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4s, (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w))
-ANT_GL_CORE_DECL(void, glVertexAttrib4sv, (GLuint index, const GLshort *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4ubv, (GLuint index, const GLubyte *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4uiv, (GLuint index, const GLuint *v))
-ANT_GL_CORE_DECL(void, glVertexAttrib4usv, (GLuint index, const GLushort *v))
-ANT_GL_CORE_DECL(void, glVertexAttribPointer, (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer))
-/*
-// GL 2.1
-ANT_GL_CORE_DECL(void, glUniformMatrix2x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniformMatrix3x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniformMatrix2x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniformMatrix4x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniformMatrix3x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glUniformMatrix4x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
-// GL 3.0
-ANT_GL_CORE_DECL(void, glColorMaski, (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a))
-ANT_GL_CORE_DECL(void, glGetBooleani_v, (GLenum target, GLuint index, GLboolean *data))
-ANT_GL_CORE_DECL(void, glGetIntegeri_v, (GLenum target, GLuint index, GLint *data))
-ANT_GL_CORE_DECL(void, glEnablei, (GLenum target, GLuint index))
-ANT_GL_CORE_DECL(void, glDisablei, (GLenum target, GLuint index))
-ANT_GL_CORE_DECL(GLboolean, glIsEnabledi, (GLenum target, GLuint index))
-ANT_GL_CORE_DECL(void, glBeginTransformFeedback, (GLenum primitiveMode))
-ANT_GL_CORE_DECL(void, glEndTransformFeedback, (void))
-ANT_GL_CORE_DECL(void, glBindBufferRange, (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size))
-ANT_GL_CORE_DECL(void, glBindBufferBase, (GLenum target, GLuint index, GLuint buffer))
-ANT_GL_CORE_DECL(void, glTransformFeedbackVaryings, (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode))
-ANT_GL_CORE_DECL(void, glGetTransformFeedbackVarying, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name))
-ANT_GL_CORE_DECL(void, glClampColor, (GLenum target, GLenum clamp))
-ANT_GL_CORE_DECL(void, glBeginConditionalRender, (GLuint id, GLenum mode))
-ANT_GL_CORE_DECL(void, glEndConditionalRender, (void))
-ANT_GL_CORE_DECL(void, glVertexAttribIPointer, (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer))
-ANT_GL_CORE_DECL(void, glGetVertexAttribIiv, (GLuint index, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(void, glGetVertexAttribIuiv, (GLuint index, GLenum pname, GLuint *params))
-ANT_GL_CORE_DECL(void, glVertexAttribI1i, (GLuint index, GLint x))
-ANT_GL_CORE_DECL(void, glVertexAttribI2i, (GLuint index, GLint x, GLint y))
-ANT_GL_CORE_DECL(void, glVertexAttribI3i, (GLuint index, GLint x, GLint y, GLint z))
-ANT_GL_CORE_DECL(void, glVertexAttribI4i, (GLuint index, GLint x, GLint y, GLint z, GLint w))
-ANT_GL_CORE_DECL(void, glVertexAttribI1ui, (GLuint index, GLuint x))
-ANT_GL_CORE_DECL(void, glVertexAttribI2ui, (GLuint index, GLuint x, GLuint y))
-ANT_GL_CORE_DECL(void, glVertexAttribI3ui, (GLuint index, GLuint x, GLuint y, GLuint z))
-ANT_GL_CORE_DECL(void, glVertexAttribI4ui, (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w))
-ANT_GL_CORE_DECL(void, glVertexAttribI1iv, (GLuint index, const GLint *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI2iv, (GLuint index, const GLint *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI3iv, (GLuint index, const GLint *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI4iv, (GLuint index, const GLint *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI1uiv, (GLuint index, const GLuint *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI2uiv, (GLuint index, const GLuint *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI3uiv, (GLuint index, const GLuint *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI4uiv, (GLuint index, const GLuint *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI4bv, (GLuint index, const GLbyte *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI4sv, (GLuint index, const GLshort *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI4ubv, (GLuint index, const GLubyte *v))
-ANT_GL_CORE_DECL(void, glVertexAttribI4usv, (GLuint index, const GLushort *v))
-ANT_GL_CORE_DECL(void, glGetUniformuiv, (GLuint program, GLint location, GLuint *params))
-ANT_GL_CORE_DECL(void, glBindFragDataLocation, (GLuint program, GLuint color, const GLchar *name))
-ANT_GL_CORE_DECL(GLint, glGetFragDataLocation, (GLuint program, const GLchar *name))
-ANT_GL_CORE_DECL(void, glUniform1ui, (GLint location, GLuint v0))
-ANT_GL_CORE_DECL(void, glUniform2ui, (GLint location, GLuint v0, GLuint v1))
-ANT_GL_CORE_DECL(void, glUniform3ui, (GLint location, GLuint v0, GLuint v1, GLuint v2))
-ANT_GL_CORE_DECL(void, glUniform4ui, (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3))
-ANT_GL_CORE_DECL(void, glUniform1uiv, (GLint location, GLsizei count, const GLuint *value))
-ANT_GL_CORE_DECL(void, glUniform2uiv, (GLint location, GLsizei count, const GLuint *value))
-ANT_GL_CORE_DECL(void, glUniform3uiv, (GLint location, GLsizei count, const GLuint *value))
-ANT_GL_CORE_DECL(void, glUniform4uiv, (GLint location, GLsizei count, const GLuint *value))
-ANT_GL_CORE_DECL(void, glTexParameterIiv, (GLenum target, GLenum pname, const GLint *params))
-ANT_GL_CORE_DECL(void, glTexParameterIuiv, (GLenum target, GLenum pname, const GLuint *params))
-ANT_GL_CORE_DECL(void, glGetTexParameterIiv, (GLenum target, GLenum pname, GLint *params))
-ANT_GL_CORE_DECL(void, glGetTexParameterIuiv, (GLenum target, GLenum pname, GLuint *params))
-ANT_GL_CORE_DECL(void, glClearBufferiv, (GLenum buffer, GLint drawbuffer, const GLint *value))
-ANT_GL_CORE_DECL(void, glClearBufferuiv, (GLenum buffer, GLint drawbuffer, const GLuint *value))
-ANT_GL_CORE_DECL(void, glClearBufferfv, (GLenum buffer, GLint drawbuffer, const GLfloat *value))
-ANT_GL_CORE_DECL(void, glClearBufferfi, (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil))
-ANT_GL_CORE_DECL(const GLubyte *, glGetStringi, (GLenum name, GLuint index))
-// GL 3.1
-ANT_GL_CORE_DECL(void, glDrawArraysInstanced, (GLenum mode, GLint first, GLsizei count, GLsizei primcount))
-ANT_GL_CORE_DECL(void, glDrawElementsInstanced, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount))
-ANT_GL_CORE_DECL(void, glTexBuffer, (GLenum target, GLenum internalformat, GLuint buffer))
-ANT_GL_CORE_DECL(void, glPrimitiveRestartIndex, (GLuint index))
-// GL 3.2
-//typedef int64_t GLint64;
-//ANT_GL_CORE_DECL(void, glGetInteger64i_v, (GLenum target, GLuint index, GLint64 *data))
-//ANT_GL_CORE_DECL(void, glGetBufferParameteri64v, (GLenum target, GLenum pname, GLint64 *params))
-ANT_GL_CORE_DECL(void, glFramebufferTexture, (GLenum target, GLenum attachment, GLuint texture, GLint level))
-*/
-// GL_ARB_vertex_array_object
-ANT_GL_CORE_DECL_NO_FORWARD(void, glBindVertexArray, (GLuint array))
-ANT_GL_CORE_DECL_NO_FORWARD(void, glDeleteVertexArrays, (GLsizei n, const GLuint *arrays))
-ANT_GL_CORE_DECL_NO_FORWARD(void, glGenVertexArrays, (GLsizei n, GLuint *arrays))
-ANT_GL_CORE_DECL_NO_FORWARD(GLboolean, glIsVertexArray, (GLuint array))
-
-
-#ifdef ANT_WINDOWS
-ANT_GL_CORE_DECL(PROC, wglGetProcAddress, (LPCSTR))
-#endif
-
-#ifndef GL_CLAMP_TO_EDGE
-# define GL_CLAMP_TO_EDGE 0x812F
-#endif
-#ifndef GL_COMPILE_STATUS
-# define GL_COMPILE_STATUS 0x8B81
-#endif
-#ifndef GL_INFO_LOG_LENGTH
-# define GL_INFO_LOG_LENGTH 0x8B84
-#endif
-#ifndef GL_LINK_STATUS
-# define GL_LINK_STATUS 0x8B82
-#endif
-#ifndef GL_ARRAY_BUFFER
-# define GL_ARRAY_BUFFER 0x8892
-#endif
-#ifndef GL_DYNAMIC_DRAW
-# define GL_DYNAMIC_DRAW 0x88E8
-#endif
-#ifndef GL_VERTEX_SHADER
-# define GL_VERTEX_SHADER 0x8B31
-#endif
-#ifndef GL_FRAGMENT_SHADER
-# define GL_FRAGMENT_SHADER 0x8B30
-#endif
-#ifndef GL_VERTEX_ARRAY_BINDING
-# define GL_VERTEX_ARRAY_BINDING 0x85B5
-#endif
-#ifndef GL_CURRENT_PROGRAM
-# define GL_CURRENT_PROGRAM 0x8B8D
-#endif
-#ifndef GL_ACTIVE_TEXTURE
-# define GL_ACTIVE_TEXTURE 0x84E0
-#endif
-#ifndef GL_TEXTURE0
-# define GL_TEXTURE0 0x84C0
-#endif
-#ifndef GL_BGRA
-# define GL_BGRA 0x80E1
-#endif
-
-
-#endif // !defined ANT_LOAD_OGL_CORE_INCLUDED
diff --git a/external/AntTweakBar/src/Makefile b/external/AntTweakBar/src/Makefile
deleted file mode 100644
index 2d9e81d..0000000
--- a/external/AntTweakBar/src/Makefile
+++ /dev/null
@@ -1,102 +0,0 @@
-####### Compiler, tools and options
-
-#---- LINUX
-SO_EXT = .so
-# SO_VERSION = 1
-AR_EXT = .a
-
-#---- Release
-CXXCFG = -O3
-LFLAGS =
-OUT_DIR = ../lib
-#---- Debug
-#CXXCFG = -g -D_DEBUG
-#LFLAGS =
-#OUT_DIR = ../lib/debug
-
-
-CXX = gcc
-CXXFLAGS = $(CXXCFG) -Wall -fPIC -fno-strict-aliasing -D_UNIX -D__PLACEMENT_NEW_INLINE
-INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include
-LINK = gcc
-#LIBS = -L/usr/X11R6/lib -L. -lglfw -lGL -lGLU -lX11 -lXxf86vm -lXext -lpthread -lm
-# LIBS = -L/usr/X11R6/lib -lGL -lX11 -lXxf86vm -lXext -lpthread -lm
-LIBS =
-AR = ar cqs
-RANLIB =
-TAR = tar -cf
-GZIP = gzip -9f
-COPY = cp -f
-COPY_FILE = $(COPY) -p
-COPY_DIR = $(COPY) -pR
-DEL_FILE = rm -f
-SYMLINK = ln -sf
-DEL_DIR = rmdir
-MOVE = mv
-NO_STDERR = 2> /dev/null
-
-
-####### Files
-
-
-# name of the application:
-TARGET = AntTweakBar
-
-# source files without extension:
-SRC_FILES = TwColors.cpp TwFonts.cpp TwOpenGL.cpp TwOpenGLCore.cpp TwBar.cpp TwMgr.cpp TwPrecomp.cpp LoadOGL.cpp LoadOGLCore.cpp TwEventGLFW.c TwEventGLUT.c TwEventSDL.c TwEventSDL12.c TwEventSDL13.c TwEventSFML.cpp TwEventX11.c
-
-# build object list from source files
-OBJS_1 = $(SRC_FILES:.c=.o)
-OBJS = $(OBJS_1:.cpp=.o)
-
-
-####### Build rules
-
-
-#first: depend all
-first: all
-
-all: Makefile $(TARGET)
-
-# append dependencies to this Makefile
-#depend:
-# @echo "==== Make dependencies ====="
-# makedepend -Y
-# makedepend -a -Y -- $(CXXFLAGS) $(INCPATH) -- $(SRC_FILES) $(NO_STDERR)
-
-$(TARGET): $(OBJS)
- @echo "===== Link $@ ====="
- $(LINK) $(LFLAGS) -shared -Wl,-soname,lib$(TARGET)$(SO_EXT) -o $(OUT_DIR)/lib$(TARGET)$(SO_EXT) $(OBJS) $(LIBS)
- $(AR) $(OUT_DIR)/lib$(TARGET)$(AR_EXT) $(OBJS) $(LIBS)
-
-.cpp.o:
- @echo "===== Compile $< ====="
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-
-.c.o:
- @echo "===== Compile $< ====="
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-
-clean:
- @echo "===== Clean ====="
- -$(DEL_FILE) *.o
- -$(DEL_FILE) *~ core *.core *.stackdump
- -$(DEL_FILE) ../lib/*AntTweakBar.* ../lib/*AntTweakBar64.*
-
-
-####### DEPENDENCIES
-
-TwColors.o: TwPrecomp.h TwColors.h
-TwFonts.o: TwPrecomp.h ../include/AntTweakBar.h TwFonts.h TwMgr.h TwColors.h TwGraph.h AntPerfTimer.h
-TwOpenGL.o: TwPrecomp.h ../include/AntTweakBar.h TwOpenGL.h LoadOGL.h TwGraph.h TwColors.h TwFonts.h TwMgr.h AntPerfTimer.h
-TwOpenGLCore.o: TwPrecomp.h ../include/AntTweakBar.h TwOpenGLCore.h LoadOGLCore.h TwGraph.h TwColors.h TwFonts.h TwMgr.h AntPerfTimer.h
-TwBar.o: TwPrecomp.h ../include/AntTweakBar.h TwBar.h TwMgr.h TwColors.h TwFonts.h TwGraph.h AntPerfTimer.h
-TwMgr.o: TwPrecomp.h ../include/AntTweakBar.h TwMgr.h TwColors.h TwFonts.h TwGraph.h AntPerfTimer.h TwBar.h TwOpenGL.h res/TwXCursors.h
-TwPrecomp.o: TwPrecomp.h
-LoadOGL.o: TwPrecomp.h LoadOGL.h
-TwEventGLFW.o: ../include/AntTweakBar.h MiniGLFW.h
-TwEventGLUT.o: ../include/AntTweakBar.h MiniGLUT.h
-TwEventSDL.o: ../include/AntTweakBar.h
-TwEventSDL12.o: ../include/AntTweakBar.h MiniSDL12.h
-TwEventSDL13.o: ../include/AntTweakBar.h MiniSDL13.h
-TwEventX11.o: ../include/AntTweakBar.h
diff --git a/external/AntTweakBar/src/Makefile.osx b/external/AntTweakBar/src/Makefile.osx
deleted file mode 100644
index 3b15f74..0000000
--- a/external/AntTweakBar/src/Makefile.osx
+++ /dev/null
@@ -1,98 +0,0 @@
-####### Compiler, tools and options
-
-SO_EXT = .dylib
-AR_EXT = .a
-
-#---- Release
-CXXCFG = -O3
-LFLAGS =
-OUT_DIR = ../lib
-#---- Debug
-#CXXCFG = -g -D_DEBUG
-#LFLAGS =
-#OUT_DIR = ../lib/debug
-
-#BASE = /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks
-CXX = clang++
-CXXFLAGS = $(CXXCFG) -Wall -fPIC -fno-strict-aliasing -D_MACOSX -ObjC++ -D__PLACEMENT_NEW_INLINE
-INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include
-#-I$(BASE)/OpenGL.framework/Headers/ -I$(BASE)/GLUT.framework/Headers/ -I$(BASE)/AppKit.framework/Headers/
-LINK = clang++
-# LIBS = -framework OpenGL -framework GLUT -framework AppKit
-AR = ar cqs
-RANLIB =
-TAR = tar -cf
-GZIP = gzip -9f
-COPY = cp -f
-COPY_FILE = $(COPY) -p
-COPY_DIR = $(COPY) -pR
-DEL_FILE = rm -f
-SYMLINK = ln -sf
-DEL_DIR = rmdir
-MOVE = mv
-NO_STDERR = 2> /dev/null
-
-
-####### Files
-
-
-# name of the application:
-TARGET = AntTweakBar
-
-# source files without extension:
-SRC_FILES = TwColors.cpp TwFonts.cpp TwOpenGL.cpp TwOpenGLCore.cpp TwBar.cpp TwMgr.cpp LoadOGL.cpp LoadOGLCore.cpp TwEventGLFW.c TwEventGLUT.c TwEventSDL.c TwEventSDL12.c TwEventSDL13.c TwEventSFML.cpp
-
-# build object list from source files
-OBJS_1 = $(SRC_FILES:.c=.o)
-OBJS = $(OBJS_1:.cpp=.o)
-
-
-####### Build rules
-
-
-#first: depend all
-first: all
-
-all: Makefile $(TARGET)
-
-# append dependencies to this Makefile
-#depend:
-# @echo "==== Make dependencies ====="
-# makedepend -Y
-# makedepend -a -Y -- $(CXXFLAGS) $(INCPATH) -- $(SRC_FILES) $(NO_STDERR)
-
-$(TARGET): $(OBJS)
- @echo "===== Link $@ ====="
- $(LINK) $(LFLAGS) -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -install_name @rpath/lib$(TARGET)$(SO_EXT) -o $(OUT_DIR)/lib$(TARGET)$(SO_EXT) $(OBJS) $(LIBS)
- $(AR) $(OUT_DIR)/lib$(TARGET)$(AR_EXT) $(OBJS)
-
-.cpp.o:
- @echo "===== Compile $< ====="
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-
-.c.o:
- @echo "===== Compile $< ====="
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-
-clean:
- @echo "===== Clean ====="
- -$(DEL_FILE) *.o
- -$(DEL_FILE) *~ core *.core *.stackdump
- -$(DEL_FILE) ../lib/*AntTweakBar.* ../lib/*AntTweakBar64.*
-
-
-####### DEPENDENCIES
-
-TwColors.o: TwPrecomp.h TwColors.h
-TwFonts.o: TwPrecomp.h ../include/AntTweakBar.h TwFonts.h TwMgr.h TwColors.h TwGraph.h AntPerfTimer.h
-TwOpenGL.o: TwPrecomp.h ../include/AntTweakBar.h TwOpenGL.h LoadOGL.h TwGraph.h TwColors.h TwFonts.h TwMgr.h AntPerfTimer.h
-TwOpenGLCore.o: TwPrecomp.h ../include/AntTweakBar.h TwOpenGLCore.h LoadOGLCore.h TwGraph.h TwColors.h TwFonts.h TwMgr.h AntPerfTimer.h
-TwBar.o: TwPrecomp.h ../include/AntTweakBar.h TwBar.h TwMgr.h TwColors.h TwFonts.h TwGraph.h AntPerfTimer.h
-TwMgr.o: TwPrecomp.h ../include/AntTweakBar.h TwMgr.h TwColors.h TwFonts.h TwGraph.h AntPerfTimer.h TwBar.h TwOpenGL.h res/TwXCursors.h
-TwPrecomp.o: TwPrecomp.h
-LoadOGL.o: TwPrecomp.h LoadOGL.h
-TwEventGLFW.o: ../include/AntTweakBar.h MiniGLFW.h
-TwEventGLUT.o: ../include/AntTweakBar.h MiniGLUT.h
-TwEventSDL.o: ../include/AntTweakBar.h
-TwEventSDL12.o: ../include/AntTweakBar.h MiniSDL12.h
-TwEventSDL13.o: ../include/AntTweakBar.h MiniSDL13.h
diff --git a/external/AntTweakBar/src/MiniGLFW.h b/external/AntTweakBar/src/MiniGLFW.h
deleted file mode 100644
index 57c9f61..0000000
--- a/external/AntTweakBar/src/MiniGLFW.h
+++ /dev/null
@@ -1,109 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file MiniGLFW.h
-// @brief A subset of GLFW definitions needed to compile helper functions
-// implemented in TwEventGLFW.c
-//
-// notes: - Private header
-// - AntTweakBar.dll does not need to link with GLFW,
-// it just needs some definitions for its helper functions.
-// - This header is provided to avoid the need of having GLFW
-// installed to recompile AntTweakBar.
-// - Do not use this header in your own programs, better use the
-// glfw.h header from the actual GLFW library SDK :
-// http://www.glfw.org
-//
-// ---------------------------------------------------------------------------
-
-#if !defined MINI_GLFW_INCLUDED
-#define MINI_GLFW_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-// Key and button state/action definitions
-#define GLFW_RELEASE 0
-#define GLFW_PRESS 1
-
-// Keyboard key definitions
-#define GLFW_KEY_UNKNOWN -1
-#define GLFW_KEY_SPACE 32
-#define GLFW_KEY_SPECIAL 256
-#define GLFW_KEY_ESC (GLFW_KEY_SPECIAL+1)
-#define GLFW_KEY_F1 (GLFW_KEY_SPECIAL+2)
-#define GLFW_KEY_F2 (GLFW_KEY_SPECIAL+3)
-#define GLFW_KEY_F3 (GLFW_KEY_SPECIAL+4)
-#define GLFW_KEY_F4 (GLFW_KEY_SPECIAL+5)
-#define GLFW_KEY_F5 (GLFW_KEY_SPECIAL+6)
-#define GLFW_KEY_F6 (GLFW_KEY_SPECIAL+7)
-#define GLFW_KEY_F7 (GLFW_KEY_SPECIAL+8)
-#define GLFW_KEY_F8 (GLFW_KEY_SPECIAL+9)
-#define GLFW_KEY_F9 (GLFW_KEY_SPECIAL+10)
-#define GLFW_KEY_F10 (GLFW_KEY_SPECIAL+11)
-#define GLFW_KEY_F11 (GLFW_KEY_SPECIAL+12)
-#define GLFW_KEY_F12 (GLFW_KEY_SPECIAL+13)
-#define GLFW_KEY_F13 (GLFW_KEY_SPECIAL+14)
-#define GLFW_KEY_F14 (GLFW_KEY_SPECIAL+15)
-#define GLFW_KEY_F15 (GLFW_KEY_SPECIAL+16)
-#define GLFW_KEY_F16 (GLFW_KEY_SPECIAL+17)
-#define GLFW_KEY_F17 (GLFW_KEY_SPECIAL+18)
-#define GLFW_KEY_F18 (GLFW_KEY_SPECIAL+19)
-#define GLFW_KEY_F19 (GLFW_KEY_SPECIAL+20)
-#define GLFW_KEY_F20 (GLFW_KEY_SPECIAL+21)
-#define GLFW_KEY_F21 (GLFW_KEY_SPECIAL+22)
-#define GLFW_KEY_F22 (GLFW_KEY_SPECIAL+23)
-#define GLFW_KEY_F23 (GLFW_KEY_SPECIAL+24)
-#define GLFW_KEY_F24 (GLFW_KEY_SPECIAL+25)
-#define GLFW_KEY_F25 (GLFW_KEY_SPECIAL+26)
-#define GLFW_KEY_UP (GLFW_KEY_SPECIAL+27)
-#define GLFW_KEY_DOWN (GLFW_KEY_SPECIAL+28)
-#define GLFW_KEY_LEFT (GLFW_KEY_SPECIAL+29)
-#define GLFW_KEY_RIGHT (GLFW_KEY_SPECIAL+30)
-#define GLFW_KEY_LSHIFT (GLFW_KEY_SPECIAL+31)
-#define GLFW_KEY_RSHIFT (GLFW_KEY_SPECIAL+32)
-#define GLFW_KEY_LCTRL (GLFW_KEY_SPECIAL+33)
-#define GLFW_KEY_RCTRL (GLFW_KEY_SPECIAL+34)
-#define GLFW_KEY_LALT (GLFW_KEY_SPECIAL+35)
-#define GLFW_KEY_RALT (GLFW_KEY_SPECIAL+36)
-#define GLFW_KEY_TAB (GLFW_KEY_SPECIAL+37)
-#define GLFW_KEY_ENTER (GLFW_KEY_SPECIAL+38)
-#define GLFW_KEY_BACKSPACE (GLFW_KEY_SPECIAL+39)
-#define GLFW_KEY_INSERT (GLFW_KEY_SPECIAL+40)
-#define GLFW_KEY_DEL (GLFW_KEY_SPECIAL+41)
-#define GLFW_KEY_PAGEUP (GLFW_KEY_SPECIAL+42)
-#define GLFW_KEY_PAGEDOWN (GLFW_KEY_SPECIAL+43)
-#define GLFW_KEY_HOME (GLFW_KEY_SPECIAL+44)
-#define GLFW_KEY_END (GLFW_KEY_SPECIAL+45)
-#define GLFW_KEY_KP_0 (GLFW_KEY_SPECIAL+46)
-#define GLFW_KEY_KP_1 (GLFW_KEY_SPECIAL+47)
-#define GLFW_KEY_KP_2 (GLFW_KEY_SPECIAL+48)
-#define GLFW_KEY_KP_3 (GLFW_KEY_SPECIAL+49)
-#define GLFW_KEY_KP_4 (GLFW_KEY_SPECIAL+50)
-#define GLFW_KEY_KP_5 (GLFW_KEY_SPECIAL+51)
-#define GLFW_KEY_KP_6 (GLFW_KEY_SPECIAL+52)
-#define GLFW_KEY_KP_7 (GLFW_KEY_SPECIAL+53)
-#define GLFW_KEY_KP_8 (GLFW_KEY_SPECIAL+54)
-#define GLFW_KEY_KP_9 (GLFW_KEY_SPECIAL+55)
-#define GLFW_KEY_KP_DIVIDE (GLFW_KEY_SPECIAL+56)
-#define GLFW_KEY_KP_MULTIPLY (GLFW_KEY_SPECIAL+57)
-#define GLFW_KEY_KP_SUBTRACT (GLFW_KEY_SPECIAL+58)
-#define GLFW_KEY_KP_ADD (GLFW_KEY_SPECIAL+59)
-#define GLFW_KEY_KP_DECIMAL (GLFW_KEY_SPECIAL+60)
-#define GLFW_KEY_KP_EQUAL (GLFW_KEY_SPECIAL+61)
-#define GLFW_KEY_KP_ENTER (GLFW_KEY_SPECIAL+62)
-#define GLFW_KEY_LAST GLFW_KEY_KP_ENTER
-
-// Mouse button
-#define GLFW_MOUSE_BUTTON_LEFT 0
-#define GLFW_MOUSE_BUTTON_RIGHT 1
-#define GLFW_MOUSE_BUTTON_MIDDLE 2
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // !defined MINI_GLFW_INCLUDED
-
diff --git a/external/AntTweakBar/src/MiniGLUT.h b/external/AntTweakBar/src/MiniGLUT.h
deleted file mode 100644
index 8459264..0000000
--- a/external/AntTweakBar/src/MiniGLUT.h
+++ /dev/null
@@ -1,142 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file MiniGLUT.h
-// @brief A subset of GLUT definitions needed to compile helper functions
-// implemented in TwEventGLUT.c
-//
-// notes: - Private header
-// - AntTweakBar.dll does not need to link with GLUT,
-// it just needs some definitions for its helper functions.
-// - This header is provided to avoid the need of having GLUT
-// installed to recompile AntTweakBar.
-// - Do not use this header in your own programs, better use the
-// GLUT.h header from the actual GLUT library SDK :
-// http://opengl.org/resources/libraries/glut
-//
-// ---------------------------------------------------------------------------
-
-#if !defined MINI_GLUT_INCLUDED
-#define MINI_GLUT_INCLUDED
-
-#if defined(_WIN32) || defined(_WIN64)
-# define WIN32_LEAN_AND_MEAN
-# include // needed by gl.h
-# define GLUT_CALL __stdcall
-# define GLUT_CALLBACK __cdecl
-# define GLUT_API __declspec(dllimport)
-#else
-# define GLUT_CALL
-# define GLUT_CALLBACK
-# define GLUT_API extern
-#endif
-
-#if defined(_MACOSX)
-# include
-# include
-#else
-# include // must be included after windows.h
-# include
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-// Mouse buttons
-#define GLUT_LEFT_BUTTON 0
-#define GLUT_MIDDLE_BUTTON 1
-#define GLUT_RIGHT_BUTTON 2
-
-// Mouse button state
-#define GLUT_DOWN 0
-#define GLUT_UP 1
-
-// glutGetModifiers return mask
-#define GLUT_ACTIVE_SHIFT 1
-#define GLUT_ACTIVE_CTRL 2
-#define GLUT_ACTIVE_ALT 4
-
-// function keys
-#define GLUT_KEY_F1 1
-#define GLUT_KEY_F2 2
-#define GLUT_KEY_F3 3
-#define GLUT_KEY_F4 4
-#define GLUT_KEY_F5 5
-#define GLUT_KEY_F6 6
-#define GLUT_KEY_F7 7
-#define GLUT_KEY_F8 8
-#define GLUT_KEY_F9 9
-#define GLUT_KEY_F10 10
-#define GLUT_KEY_F11 11
-#define GLUT_KEY_F12 12
-
-// directional keys
-#define GLUT_KEY_LEFT 100
-#define GLUT_KEY_UP 101
-#define GLUT_KEY_RIGHT 102
-#define GLUT_KEY_DOWN 103
-#define GLUT_KEY_PAGE_UP 104
-#define GLUT_KEY_PAGE_DOWN 105
-#define GLUT_KEY_HOME 106
-#define GLUT_KEY_END 107
-#define GLUT_KEY_INSERT 108
-
-// display mode bit masks
-#define GLUT_RGB 0
-#define GLUT_RGBA GLUT_RGB
-#define GLUT_INDEX 1
-#define GLUT_SINGLE 0
-#define GLUT_DOUBLE 2
-#define GLUT_ACCUM 4
-#define GLUT_ALPHA 8
-#define GLUT_DEPTH 16
-#define GLUT_STENCIL 32
-
-// timer
-#define GLUT_ELAPSED_TIME ((GLenum) 700)
-
-
-// functions subset
-GLUT_API void GLUT_CALL glutInit(int *argcp, char **argv);
-GLUT_API void GLUT_CALL glutInitDisplayMode(unsigned int mode);
-GLUT_API int GLUT_CALL glutCreateWindow(const char *title);
-GLUT_API int GLUT_CALL glutGetWindow(void);
-GLUT_API void GLUT_CALL glutSetWindow(int win);
-GLUT_API int GLUT_CALL glutCreateSubWindow(int win, int x, int y, int width, int height);
-GLUT_API int GLUT_CALL glutGet(GLenum type);
-GLUT_API void GLUT_CALL glutSwapBuffers();
-GLUT_API void GLUT_CALL glutPostRedisplay();
-GLUT_API void GLUT_CALL glutInitWindowPosition(int x, int y);
-GLUT_API void GLUT_CALL glutInitWindowSize(int width, int height);
-GLUT_API void GLUT_CALL glutPositionWindow(int x, int y);
-GLUT_API void GLUT_CALL glutReshapeWindow(int width, int height);
-GLUT_API void GLUT_CALL glutMainLoop();
-GLUT_API int GLUT_CALL glutCreateMenu(void (GLUT_CALLBACK *func)(int));
-GLUT_API void GLUT_CALL glutDisplayFunc(void (GLUT_CALLBACK *func)(void));
-GLUT_API void GLUT_CALL glutReshapeFunc(void (GLUT_CALLBACK *func)(int width, int height));
-GLUT_API void GLUT_CALL glutKeyboardFunc(void (GLUT_CALLBACK *func)(unsigned char key, int x, int y));
-GLUT_API void GLUT_CALL glutMouseFunc(void (GLUT_CALLBACK *func)(int button, int state, int x, int y));
-GLUT_API void GLUT_CALL glutMotionFunc(void (GLUT_CALLBACK *func)(int x, int y));
-GLUT_API void GLUT_CALL glutPassiveMotionFunc(void (GLUT_CALLBACK *func)(int x, int y));
-GLUT_API void GLUT_CALL glutSpecialFunc(void (GLUT_CALLBACK *func)(int key, int x, int y));
-GLUT_API int GLUT_CALL glutGetModifiers(void);
-GLUT_API void GLUT_CALL glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUT_API void GLUT_CALL glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUT_API void GLUT_CALL glutSolidTeapot(GLdouble size);
-
-// GLUT exit problem workaround (see glut.h)
-#if (defined(_WIN32) || defined(_WIN64)) && !defined(GLUT_DISABLE_ATEXIT_HACK)
- extern void __cdecl exit(int);
- GLUT_API void GLUT_CALL __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
- static void GLUT_CALL glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
- #define glutInit glutInit_ATEXIT_HACK
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // !defined MINI_GLUT_INCLUDED
-
diff --git a/external/AntTweakBar/src/MiniSDL12.h b/external/AntTweakBar/src/MiniSDL12.h
deleted file mode 100644
index 36c968d..0000000
--- a/external/AntTweakBar/src/MiniSDL12.h
+++ /dev/null
@@ -1,339 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file MiniSDL12.h
-// @brief A subset of SDL 1.2 definitions needed to compile helper
-// functions implemented in TwEventSDL12.c
-//
-// notes: - Private header
-// - AntTweakBar.dll does not need to link with SDL,
-// it just needs some definitions for its helper functions.
-// - This header is provided to avoid the need of having SDL
-// installed to recompile AntTweakBar.
-// - Do not use this header in your own programs, better use the
-// SDL.h header from the actual SDL library SDK :
-// http://www.libsdl.org
-//
-// ---------------------------------------------------------------------------
-
-#if !defined MINI_SDL12_INCLUDED
-#define MINI_SDL12_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define SDL_MAJOR_VERSION 1
-#define SDL_MINOR_VERSION 2
-
-#if defined(_WIN32) || defined(_WIN64)
-# define SDL_DECLSPEC __declspec(dllimport)
-# define SDL_CALL __cdecl
-#else
-# define SDL_DECLSPEC
-# define SDL_CALL
-#endif
-
-typedef unsigned char Uint8;
-typedef signed char Sint8;
-typedef unsigned short Uint16;
-typedef signed short Sint16;
-typedef unsigned int Uint32;
-typedef signed int Sint32;
-
-// Subset of SDL keysym
-typedef enum {
- SDLK_BACKSPACE = 8,
- SDLK_TAB = 9,
- SDLK_CLEAR = 12,
- SDLK_RETURN = 13,
- SDLK_PAUSE = 19,
- SDLK_ESCAPE = 27,
- SDLK_DELETE = 127,
- SDLK_UP = 273,
- SDLK_DOWN = 274,
- SDLK_RIGHT = 275,
- SDLK_LEFT = 276,
- SDLK_INSERT = 277,
- SDLK_HOME = 278,
- SDLK_END = 279,
- SDLK_PAGEUP = 280,
- SDLK_PAGEDOWN = 281,
- SDLK_F1 = 282,
- SDLK_F2 = 283,
- SDLK_F3 = 284,
- SDLK_F4 = 285,
- SDLK_F5 = 286,
- SDLK_F6 = 287,
- SDLK_F7 = 288,
- SDLK_F8 = 289,
- SDLK_F9 = 290,
- SDLK_F10 = 291,
- SDLK_F11 = 292,
- SDLK_F12 = 293,
-} SDLKey;
-
-typedef enum {
- KMOD_NONE = 0x0000,
- KMOD_LSHIFT = 0x0001,
- KMOD_RSHIFT = 0x0002,
- KMOD_LCTRL = 0x0040,
- KMOD_RCTRL = 0x0080,
- KMOD_LALT = 0x0100,
- KMOD_RALT = 0x0200,
- KMOD_LMETA = 0x0400,
- KMOD_RMETA = 0x0800,
- KMOD_NUM = 0x1000,
- KMOD_CAPS = 0x2000,
- KMOD_MODE = 0x4000,
- KMOD_RESERVED = 0x8000
-} SDLMod;
-
-#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
-#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
-#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
-#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
-
-typedef enum {
- SDL_NOEVENT = 0,
- SDL_ACTIVEEVENT,
- SDL_KEYDOWN,
- SDL_KEYUP,
- SDL_MOUSEMOTION,
- SDL_MOUSEBUTTONDOWN,
- SDL_MOUSEBUTTONUP,
- SDL_JOYAXISMOTION,
- SDL_JOYBALLMOTION,
- SDL_JOYHATMOTION,
- SDL_JOYBUTTONDOWN,
- SDL_JOYBUTTONUP,
- SDL_QUIT,
- SDL_SYSWMEVENT,
- SDL_EVENT_RESERVEDA,
- SDL_EVENT_RESERVEDB,
- SDL_VIDEORESIZE,
- SDL_VIDEOEXPOSE,
- SDL_EVENT_RESERVED2,
- SDL_EVENT_RESERVED3,
- SDL_EVENT_RESERVED4,
- SDL_EVENT_RESERVED5,
- SDL_EVENT_RESERVED6,
- SDL_EVENT_RESERVED7,
- SDL_USEREVENT = 24,
- SDL_NUMEVENTS = 32
-} SDLEventEnum;
-
-typedef struct SDL_keysym {
- Uint8 scancode;
- SDLKey sym;
- SDLMod mod;
- Uint16 unicode;
-} SDL_keysym;
-
-typedef struct SDL_ActiveEvent {
- Uint8 type;
- Uint8 gain;
- Uint8 state;
-} SDL_ActiveEvent;
-
-typedef struct SDL_KeyboardEvent {
- Uint8 type;
- Uint8 which;
- Uint8 state;
- SDL_keysym keysym;
-} SDL_KeyboardEvent;
-
-typedef struct SDL_MouseMotionEvent {
- Uint8 type;
- Uint8 which;
- Uint8 state;
- Uint16 x, y;
- Sint16 xrel;
- Sint16 yrel;
-} SDL_MouseMotionEvent;
-
-typedef struct SDL_MouseButtonEvent {
- Uint8 type;
- Uint8 which;
- Uint8 button;
- Uint8 state;
- Uint16 x, y;
-} SDL_MouseButtonEvent;
-
-typedef struct SDL_JoyAxisEvent {
- Uint8 type;
- Uint8 which;
- Uint8 axis;
- Sint16 value;
-} SDL_JoyAxisEvent;
-
-typedef struct SDL_JoyBallEvent {
- Uint8 type;
- Uint8 which;
- Uint8 ball;
- Sint16 xrel;
- Sint16 yrel;
-} SDL_JoyBallEvent;
-
-typedef struct SDL_JoyHatEvent {
- Uint8 type;
- Uint8 which;
- Uint8 hat;
- Uint8 value;
-} SDL_JoyHatEvent;
-
-typedef struct SDL_JoyButtonEvent {
- Uint8 type;
- Uint8 which;
- Uint8 button;
- Uint8 state;
-} SDL_JoyButtonEvent;
-
-typedef struct SDL_ResizeEvent {
- Uint8 type;
- int w;
- int h;
-} SDL_ResizeEvent;
-
-typedef struct SDL_ExposeEvent {
- Uint8 type;
-} SDL_ExposeEvent;
-
-typedef struct SDL_QuitEvent {
- Uint8 type;
-} SDL_QuitEvent;
-
-typedef struct SDL_UserEvent {
- Uint8 type;
- int code;
- void *data1;
- void *data2;
-} SDL_UserEvent;
-
-struct SDL_SysWMmsg;
-typedef struct SDL_SysWMmsg SDL_SysWMmsg;
-typedef struct SDL_SysWMEvent {
- Uint8 type;
- SDL_SysWMmsg *msg;
-} SDL_SysWMEvent;
-
-typedef union {
- Uint8 type;
- SDL_ActiveEvent active;
- SDL_KeyboardEvent key;
- SDL_MouseMotionEvent motion;
- SDL_MouseButtonEvent button;
- SDL_JoyAxisEvent jaxis;
- SDL_JoyBallEvent jball;
- SDL_JoyHatEvent jhat;
- SDL_JoyButtonEvent jbutton;
- SDL_ResizeEvent resize;
- SDL_ExposeEvent expose;
- SDL_QuitEvent quit;
- SDL_UserEvent user;
- SDL_SysWMEvent syswm;
-char full[56];
-} SDL_Event;
-
-typedef struct SDL_PixelFormat {
- void *palette;
- Uint8 BitsPerPixel;
- Uint8 BytesPerPixel;
- Uint8 Rloss;
- Uint8 Gloss;
- Uint8 Bloss;
- Uint8 Aloss;
- Uint8 Rshift;
- Uint8 Gshift;
- Uint8 Bshift;
- Uint8 Ashift;
- Uint32 Rmask;
- Uint32 Gmask;
- Uint32 Bmask;
- Uint32 Amask;
- Uint32 colorkey;
- Uint8 alpha;
-} SDL_PixelFormat;
-
-typedef enum {
- SDL_GL_RED_SIZE,
- SDL_GL_GREEN_SIZE,
- SDL_GL_BLUE_SIZE,
- SDL_GL_ALPHA_SIZE,
- SDL_GL_BUFFER_SIZE,
- SDL_GL_DOUBLEBUFFER,
- SDL_GL_DEPTH_SIZE,
- SDL_GL_STENCIL_SIZE,
- SDL_GL_ACCUM_RED_SIZE,
- SDL_GL_ACCUM_GREEN_SIZE,
- SDL_GL_ACCUM_BLUE_SIZE,
- SDL_GL_ACCUM_ALPHA_SIZE,
- SDL_GL_STEREO,
- SDL_GL_MULTISAMPLEBUFFERS,
- SDL_GL_MULTISAMPLESAMPLES,
- SDL_GL_ACCELERATED_VISUAL,
- SDL_GL_RETAINED_BACKING,
- SDL_GL_CONTEXT_MAJOR_VERSION,
- SDL_GL_CONTEXT_MINOR_VERSION
-} SDL_GLattr;
-
-typedef struct SDL_VideoInfo {
- Uint32 hw_available :1;
- Uint32 wm_available :1;
- Uint32 UnusedBits1 :6;
- Uint32 UnusedBits2 :1;
- Uint32 blit_hw :1;
- Uint32 blit_hw_CC :1;
- Uint32 blit_hw_A :1;
- Uint32 blit_sw :1;
- Uint32 blit_sw_CC :1;
- Uint32 blit_sw_A :1;
- Uint32 blit_fill :1;
- Uint32 UnusedBits3 :16;
- Uint32 video_mem;
- SDL_PixelFormat *vfmt;
- int current_w;
- int current_h;
-} SDL_VideoInfo;
-
-#define SDL_INIT_VIDEO 0x00000020
-
-#define SDL_SWSURFACE 0x00000000
-#define SDL_HWSURFACE 0x00000001
-#define SDL_ASYNCBLIT 0x00000004
-#define SDL_ANYFORMAT 0x10000000
-#define SDL_HWPALETTE 0x20000000
-#define SDL_DOUBLEBUF 0x40000000
-#define SDL_FULLSCREEN 0x80000000
-#define SDL_OPENGL 0x00000002
-#define SDL_OPENGLBLIT 0x0000000A
-#define SDL_RESIZABLE 0x00000010
-#define SDL_NOFRAME 0x00000020
-
-#define SDL_DEFAULT_REPEAT_DELAY 500
-#define SDL_DEFAULT_REPEAT_INTERVAL 30
-
-
-// functions subset
-extern SDL_DECLSPEC int SDL_CALL SDL_Init(Uint32 flags);
-extern SDL_DECLSPEC void SDL_CALL SDL_Quit();
-extern SDL_DECLSPEC char * SDL_CALL SDL_GetError();
-extern SDL_DECLSPEC const SDL_VideoInfo * SDL_CALL SDL_GetVideoInfo();
-extern SDL_DECLSPEC struct SDL_Surface * SDL_CALL SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);
-extern SDL_DECLSPEC int SDL_CALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
-extern SDL_DECLSPEC void SDL_CALL SDL_GL_SwapBuffers();
-extern SDL_DECLSPEC void SDL_CALL SDL_WM_SetCaption(const char *title, const char *icon);
-extern SDL_DECLSPEC void SDL_CALL SDL_WM_GetCaption(char **title, char **icon);
-extern SDL_DECLSPEC int SDL_CALL SDL_EnableUNICODE(int enable);
-extern SDL_DECLSPEC int SDL_CALL SDL_EnableKeyRepeat(int delay, int interval);
-extern SDL_DECLSPEC Uint32 SDL_CALL SDL_GetTicks();
-extern SDL_DECLSPEC int SDL_CALL SDL_PollEvent(SDL_Event *event);
-extern SDL_DECLSPEC int SDL_CALL SDL_WaitEvent(SDL_Event *event);
-extern SDL_DECLSPEC int SDL_CALL SDL_PushEvent(SDL_Event *event);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // !defined MINI_SDL12_INCLUDED
-
diff --git a/external/AntTweakBar/src/MiniSDL13.h b/external/AntTweakBar/src/MiniSDL13.h
deleted file mode 100644
index c32a6d3..0000000
--- a/external/AntTweakBar/src/MiniSDL13.h
+++ /dev/null
@@ -1,428 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file MiniSDL13.h
-// @brief A subset of SDL 1.3 definitions needed to compile helper
-// functions implemented in TwEventSDL13.c
-//
-// notes: - Private header
-// - AntTweakBar.dll does not need to link with SDL,
-// it just needs some definitions for its helper functions.
-// - This header is provided to avoid the need of having SDL
-// installed to recompile AntTweakBar.
-// - Do not use this header in your own programs, better use the
-// SDL.h header from the actual SDL library SDK :
-// http://www.libsdl.org
-//
-// ---------------------------------------------------------------------------
-
-#if !defined MINI_SDL_INCLUDED
-#define MINI_SDL_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define SDL_MAJOR_VERSION 1
-#define SDL_MINOR_VERSION 3
-
-#if defined(_WIN32) || defined(_WIN64)
-# define SDL_DECLSPEC __declspec(dllimport)
-# define SDL_CALL __cdecl
-#else
-# define SDL_DECLSPEC
-# define SDL_CALL
-#endif
-
-typedef unsigned char Uint8;
-typedef signed char Sint8;
-typedef unsigned short Uint16;
-typedef signed short Sint16;
-typedef unsigned int Uint32;
-typedef signed int Sint32;
-
-#define SDLK_SCANCODE_MASK (1<<30)
-#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
-
-// Subset of SDL scancodes.
-// Note: some SDL scancodes seems to be wrong in the original
-// SDL scancode header file.
-typedef enum {
- SDL_SCANCODE_F1 = 58,
- SDL_SCANCODE_F2 = 59,
- SDL_SCANCODE_F3 = 60,
- SDL_SCANCODE_F4 = 61,
- SDL_SCANCODE_F5 = 62,
- SDL_SCANCODE_F6 = 63,
- SDL_SCANCODE_F7 = 64,
- SDL_SCANCODE_F8 = 65,
- SDL_SCANCODE_F9 = 66,
- SDL_SCANCODE_F10 = 67,
- SDL_SCANCODE_F11 = 68,
- SDL_SCANCODE_F12 = 69,
- SDL_SCANCODE_INSERT = 98, //73,
- SDL_SCANCODE_HOME = 95, //74,
- SDL_SCANCODE_PAGEUP = 97, //75,
- SDL_SCANCODE_DELETE = 99, //76,
- SDL_SCANCODE_END = 89, //77,
- SDL_SCANCODE_PAGEDOWN = 91, //78,
- SDL_SCANCODE_RIGHT = 94, //79,
- SDL_SCANCODE_LEFT = 92, //80,
- SDL_SCANCODE_DOWN = 90, //81,
- SDL_SCANCODE_UP = 96 //82
-} SDL_scancode;
-
-// Subset of SDL keysym
-typedef enum {
- SDLK_BACKSPACE = 8,
- SDLK_TAB = 9,
- SDLK_CLEAR = 12,
- SDLK_RETURN = 13,
- SDLK_PAUSE = 19,
- SDLK_ESCAPE = 27,
- SDLK_DELETE = 127,
- SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP),
- SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN),
- SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
- SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT),
- SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
- SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
- SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
- SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
- SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
- SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1),
- SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2),
- SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3),
- SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4),
- SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5),
- SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6),
- SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7),
- SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8),
- SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9),
- SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10),
- SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11),
- SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12)
-} SDLKey;
-
-typedef enum {
- KMOD_NONE = 0x0000,
- KMOD_LSHIFT = 0x0001,
- KMOD_RSHIFT = 0x0002,
- KMOD_LCTRL = 0x0040,
- KMOD_RCTRL = 0x0080,
- KMOD_LALT = 0x0100,
- KMOD_RALT = 0x0200,
- KMOD_LGUI = 0x0400,
- KMOD_RGUI = 0x0800,
- KMOD_NUM = 0x1000,
- KMOD_CAPS = 0x2000,
- KMOD_MODE = 0x4000,
- KMOD_RESERVED = 0x8000
-} SDLMod;
-
-#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
-#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
-#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
-#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI)
-
-typedef enum {
- SDL_NOEVENT = 0,
- SDL_WINDOWEVENT,
- SDL_KEYDOWN,
- SDL_KEYUP,
- SDL_TEXTEDITING,
- SDL_TEXTINPUT,
- SDL_MOUSEMOTION,
- SDL_MOUSEBUTTONDOWN,
- SDL_MOUSEBUTTONUP,
- SDL_MOUSEWHEEL,
- SDL_JOYAXISMOTION,
- SDL_JOYBALLMOTION,
- SDL_JOYHATMOTION,
- SDL_JOYBUTTONDOWN,
- SDL_JOYBUTTONUP,
- SDL_QUIT,
- SDL_SYSWMEVENT,
- SDL_PROXIMITYIN,
- SDL_PROXIMITYOUT,
- SDL_EVENT_RESERVED1,
- SDL_EVENT_RESERVED2,
- SDL_EVENT_RESERVED3,
- SDL_USEREVENT = 24,
- SDL_NUMEVENTS = 32
-} SDL_EventType;
-
-#define SDL_ACTIVEEVENT SDL_EVENT_RESERVED1
-#define SDL_VIDEORESIZE SDL_EVENT_RESERVED2
-#define SDL_VIDEOEXPOSE SDL_EVENT_RESERVED3
-
-typedef Uint32 SDL_WindowID;
-
-typedef struct SDL_keysym {
- SDL_scancode scancode;
- SDLKey sym;
- Uint16 mod;
- Uint32 unicode;
-} SDL_keysym;
-
-typedef struct SDL_WindowEvent {
- Uint8 type;
- SDL_WindowID windowID;
- Uint8 event;
- int data1;
- int data2;
-} SDL_WindowEvent;
-
-typedef struct SDL_KeyboardEvent {
- Uint8 type;
- SDL_WindowID windowID;
- Uint8 which;
- Uint8 state;
- SDL_keysym keysym;
-} SDL_KeyboardEvent;
-
-#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
-typedef struct SDL_TextEditingEvent {
- Uint8 type;
- char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
- int start;
- int length;
-} SDL_TextEditingEvent;
-
-#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
-typedef struct SDL_TextInputEvent {
- Uint8 type;
- SDL_WindowID windowID;
- Uint8 which;
- char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
-} SDL_TextInputEvent;
-
-typedef struct SDL_MouseMotionEvent {
- Uint8 type;
- SDL_WindowID windowID;
- Uint8 which;
- Uint8 state;
- int x;
- int y;
- int z;
- int pressure;
- int pressure_max;
- int pressure_min;
- int rotation;
- int tilt;
- int cursor;
- int xrel;
- int yrel;
-} SDL_MouseMotionEvent;
-
-typedef struct SDL_MouseButtonEvent {
- Uint8 type;
- SDL_WindowID windowID;
- Uint8 which;
- Uint8 button;
- Uint8 state;
- int x;
- int y;
-} SDL_MouseButtonEvent;
-
-typedef struct SDL_MouseWheelEvent {
- Uint8 type;
- SDL_WindowID windowID;
- Uint8 which;
- int x;
- int y;
-} SDL_MouseWheelEvent;
-
-typedef struct SDL_JoyAxisEvent {
- Uint8 type;
- Uint8 which;
- Uint8 axis;
- Sint16 value;
-} SDL_JoyAxisEvent;
-
-typedef struct SDL_JoyBallEvent {
- Uint8 type;
- Uint8 which;
- Uint8 ball;
- Sint16 xrel;
- Sint16 yrel;
-} SDL_JoyBallEvent;
-
-typedef struct SDL_JoyHatEvent {
- Uint8 type;
- Uint8 which;
- Uint8 hat;
- Uint8 value;
-} SDL_JoyHatEvent;
-
-typedef struct SDL_JoyButtonEvent {
- Uint8 type;
- Uint8 which;
- Uint8 button;
- Uint8 state;
-} SDL_JoyButtonEvent;
-
-typedef struct SDL_ActiveEvent
-{
- Uint8 type;
- Uint8 gain;
- Uint8 state;
-} SDL_ActiveEvent;
-
-typedef struct SDL_ResizeEvent {
- Uint8 type;
- int w;
- int h;
-} SDL_ResizeEvent;
-
-typedef struct SDL_ExposeEvent {
- Uint8 type;
-} SDL_ExposeEvent;
-
-typedef struct SDL_QuitEvent {
- Uint8 type;
-} SDL_QuitEvent;
-
-typedef struct SDL_UserEvent {
- Uint8 type;
- SDL_WindowID windowID;
- int code;
- void *data1;
- void *data2;
-} SDL_UserEvent;
-
-struct SDL_SysWMmsg;
-typedef struct SDL_SysWMmsg SDL_SysWMmsg;
-typedef struct SDL_SysWMEvent {
- Uint8 type;
- SDL_SysWMmsg *msg;
-} SDL_SysWMEvent;
-
-typedef struct SDL_ProximityEvent
-{
- Uint8 type;
- SDL_WindowID windowID;
- Uint8 which;
- int cursor;
- int x;
- int y;
-} SDL_ProximityEvent;
-
-typedef union SDL_Event {
- Uint8 type;
- SDL_WindowEvent window;
- SDL_KeyboardEvent key;
- SDL_TextEditingEvent edit;
- SDL_TextInputEvent text;
- SDL_MouseMotionEvent motion;
- SDL_MouseButtonEvent button;
- SDL_MouseWheelEvent wheel;
- SDL_JoyAxisEvent jaxis;
- SDL_JoyBallEvent jball;
- SDL_JoyHatEvent jhat;
- SDL_JoyButtonEvent jbutton;
- SDL_QuitEvent quit;
- SDL_UserEvent user;
- SDL_SysWMEvent syswm;
- SDL_ProximityEvent proximity;
- SDL_ActiveEvent active;
- SDL_ResizeEvent resize;
-} SDL_Event;
-
-typedef struct SDL_PixelFormat {
- void *palette;
- Uint8 BitsPerPixel;
- Uint8 BytesPerPixel;
- Uint8 Rloss;
- Uint8 Gloss;
- Uint8 Bloss;
- Uint8 Aloss;
- Uint8 Rshift;
- Uint8 Gshift;
- Uint8 Bshift;
- Uint8 Ashift;
- Uint32 Rmask;
- Uint32 Gmask;
- Uint32 Bmask;
- Uint32 Amask;
-} SDL_PixelFormat;
-
-typedef enum SDL_GLattr {
- SDL_GL_RED_SIZE,
- SDL_GL_GREEN_SIZE,
- SDL_GL_BLUE_SIZE,
- SDL_GL_ALPHA_SIZE,
- SDL_GL_BUFFER_SIZE,
- SDL_GL_DOUBLEBUFFER,
- SDL_GL_DEPTH_SIZE,
- SDL_GL_STENCIL_SIZE,
- SDL_GL_ACCUM_RED_SIZE,
- SDL_GL_ACCUM_GREEN_SIZE,
- SDL_GL_ACCUM_BLUE_SIZE,
- SDL_GL_ACCUM_ALPHA_SIZE,
- SDL_GL_STEREO,
- SDL_GL_MULTISAMPLEBUFFERS,
- SDL_GL_MULTISAMPLESAMPLES,
- SDL_GL_ACCELERATED_VISUAL,
- SDL_GL_RETAINED_BACKING,
- SDL_GL_CONTEXT_MAJOR_VERSION,
- SDL_GL_CONTEXT_MINOR_VERSION
-} SDL_GLattr;
-
-typedef struct SDL_VideoInfo {
- Uint32 hw_available :1;
- Uint32 wm_available :1;
- Uint32 UnusedBits1 :6;
- Uint32 UnusedBits2 :1;
- Uint32 blit_hw :1;
- Uint32 blit_hw_CC :1;
- Uint32 blit_hw_A :1;
- Uint32 blit_sw :1;
- Uint32 blit_sw_CC :1;
- Uint32 blit_sw_A :1;
- Uint32 blit_fill :1;
- Uint32 UnusedBits3 :16;
- Uint32 video_mem;
- SDL_PixelFormat *vfmt;
- int current_w;
- int current_h;
-} SDL_VideoInfo;
-
-#define SDL_INIT_VIDEO 0x00000020
-
-#define SDL_ANYFORMAT 0x00100000
-#define SDL_HWPALETTE 0x00200000
-#define SDL_DOUBLEBUF 0x00400000
-#define SDL_FULLSCREEN 0x00800000
-#define SDL_RESIZABLE 0x01000000
-#define SDL_NOFRAME 0x02000000
-#define SDL_OPENGL 0x04000000
-#define SDL_HWSURFACE 0x08000001
-
-#define SDL_DEFAULT_REPEAT_DELAY 500
-#define SDL_DEFAULT_REPEAT_INTERVAL 30
-
-
-// functions subset
-extern SDL_DECLSPEC int SDL_CALL SDL_Init(Uint32 flags);
-extern SDL_DECLSPEC void SDL_CALL SDL_Quit();
-extern SDL_DECLSPEC char * SDL_CALL SDL_GetError();
-extern SDL_DECLSPEC const SDL_VideoInfo * SDL_CALL SDL_GetVideoInfo();
-extern SDL_DECLSPEC struct SDL_Surface * SDL_CALL SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);
-extern SDL_DECLSPEC int SDL_CALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
-extern SDL_DECLSPEC void SDL_CALL SDL_GL_SwapBuffers();
-extern SDL_DECLSPEC void SDL_CALL SDL_WM_SetCaption(const char *title, const char *icon);
-extern SDL_DECLSPEC void SDL_CALL SDL_WM_GetCaption(char **title, char **icon);
-extern SDL_DECLSPEC int SDL_CALL SDL_EnableUNICODE(int enable);
-extern SDL_DECLSPEC int SDL_CALL SDL_EnableKeyRepeat(int delay, int interval);
-extern SDL_DECLSPEC Uint32 SDL_CALL SDL_GetTicks();
-extern SDL_DECLSPEC int SDL_CALL SDL_PollEvent(SDL_Event *event);
-extern SDL_DECLSPEC int SDL_CALL SDL_WaitEvent(SDL_Event *event);
-extern SDL_DECLSPEC int SDL_CALL SDL_PushEvent(SDL_Event *event);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // !defined MINI_SDL_INCLUDED
-
diff --git a/external/AntTweakBar/src/MiniSFML16.h b/external/AntTweakBar/src/MiniSFML16.h
deleted file mode 100644
index 672896d..0000000
--- a/external/AntTweakBar/src/MiniSFML16.h
+++ /dev/null
@@ -1,220 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file MiniSFML16.h
-// @brief A subset of SFML 1.6 definitions needed to compile helper
-// functions implemented in TwEventSFML.cpp
-//
-// notes: - Private header
-// - AntTweakBar.dll does not need to link with SFML,
-// it just needs some definitions for its helper functions.
-// - This header is provided to avoid the need of having SFML
-// installed to recompile AntTweakBar.
-// It declares a small and incomplete part of SFML classes.
-// For instance, many non-virtual methods have been stripped out.
-// - Do not use this header in your own programs, better use the
-// SFML headers from the actual SFML library SDK :
-// http://www.sfml-dev.org
-//
-// ---------------------------------------------------------------------------
-
-#if !defined MINI_SFML16_INCLUDED
-#define MINI_SFML16_INCLUDED
-
-namespace sf
-{
-
- namespace Key { enum Code
- {
- A = 'a', B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
- Num0 = '0', Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9,
- Escape = 256,
- LControl, LShift, LAlt, LSystem,
- RControl, RShift, RAlt, RSystem, Menu,
- LBracket, RBracket, SemiColon, Comma, Period, Quote, Slash, BackSlash,
- Tilde, Equal, Dash, Space, Return, Back, Tab,
- PageUp, PageDown, End, Home, Insert, Delete,
- Add, Subtract, Multiply, Divide, Left, Right, Up, Down,
- Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7, Numpad8, Numpad9,
- F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, Pause,
- Count
- }; }
-
- namespace Mouse { enum Button { Left, Right, Middle, XButton1, XButton2, Count }; }
-
- namespace Joy { enum Axis { AxisX, AxisY, AxisZ, AxisR, AxisU, AxisV, AxisPOV, AxisCount };
- enum { Count = 4, ButtonCount = 32}; }
-
- typedef unsigned char Uint8;
- typedef unsigned int Uint32;
-
- class Event
- {
- public :
- struct KeyEvent { Key::Code Code; bool Alt, Control, Shift; };
- struct TextEvent { Uint32 Unicode; };
- struct MouseMoveEvent { int X, Y; };
- struct MouseButtonEvent { Mouse::Button Button; int X, Y; };
- struct MouseWheelEvent { int Delta; };
- struct JoyMoveEvent { unsigned int JoystickId; Joy::Axis Axis; float Position; };
- struct JoyButtonEvent { unsigned int JoystickId, Button; };
- struct SizeEvent { unsigned int Width, Height; };
- enum EventType
- {
- Closed, Resized, LostFocus, GainedFocus, TextEntered, KeyPressed, KeyReleased,
- MouseWheelMoved, MouseButtonPressed, MouseButtonReleased, MouseMoved, MouseEntered, MouseLeft,
- JoyButtonPressed, JoyButtonReleased, JoyMoved
- };
- EventType Type;
- union
- {
- KeyEvent Key;
- TextEvent Text;
- MouseMoveEvent MouseMove;
- MouseButtonEvent MouseButton;
- MouseWheelEvent MouseWheel;
- JoyMoveEvent JoyMove;
- JoyButtonEvent JoyButton;
- SizeEvent Size;
- };
- };
-
-} // namespace sf
-
-
-#ifdef USE_MINI_SFML
-// we also need some the definition of sf::RenderWindow to compile our SFML example
-
-#include
-#include
-
-namespace sf
-{
-
- class Input;
- class Drawable;
- typedef void* WindowHandle;
- namespace priv { class WindowImpl; }
-
- class WindowListener
- {
- public :
- virtual void OnEvent(const Event& EventReceived) = 0;
- protected :
- virtual ~WindowListener();
- };
-
- class VideoMode
- {
- public :
- VideoMode(unsigned int ModeWidth, unsigned int ModeHeight, unsigned int ModeBpp = 32);
- unsigned int Width, Height, BitsPerPixel;
- };
-
- namespace Style { enum { None = 0, Titlebar = 1 << 0, Resize = 1 << 1, Close = 1 << 2, Fullscreen = 1 << 3 }; }
-
- struct WindowSettings
- {
- explicit WindowSettings(unsigned int Depth = 24, unsigned int Stencil = 8, unsigned int Antialiasing = 0);
- unsigned int DepthBits, StencilBits, AntialiasingLevel;
- };
-
- class Clock
- {
- public :
- Clock();
- float GetElapsedTime() const;
- void Reset();
- private :
- double myStartTime;
- };
-
- class Input : public WindowListener
- {
- private :
- virtual void OnEvent(const Event& EventReceived);
- bool myKeys[Key::Count];
- bool myMouseButtons[Mouse::Count];
- int myMouseX;
- int myMouseY;
- bool myJoystickButtons[Joy::Count][Joy::ButtonCount];
- float myJoystickAxis[Joy::Count][Joy::AxisCount];
- };
-
- class Window : public WindowListener
- {
- public :
- Window(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const WindowSettings& Params = WindowSettings());
- virtual ~Window();
- void Close();
- bool IsOpened() const;
- unsigned int GetWidth() const;
- unsigned int GetHeight() const;
- bool GetEvent(Event& EventReceived);
- void Display();
- private :
- virtual void OnCreate();
- virtual void OnEvent(const Event& EventReceived);
- priv::WindowImpl* myWindow;
- std::queue myEvents;
- Input myInput;
- Clock myClock;
- WindowSettings mySettings;
- float myLastFrameTime;
- bool myIsExternal;
- unsigned int myFramerateLimit;
- int mySetCursorPosX;
- int mySetCursorPosY;
- };
-
- template class Vector2 { public : T x, y; };
- typedef Vector2 Vector2f;
-
- template class Rect { public : T Left, Top, Right, Bottom; };
- typedef Rect FloatRect;
-
- class Matrix3 { private : float myData[16]; };
-
- class View
- {
- private :
- sf::Vector2f myCenter;
- sf::Vector2f myHalfSize;
- FloatRect myRect;
- Matrix3 myMatrix;
- bool myNeedUpdate;
- };
-
- class RenderTarget
- {
- public :
- virtual ~RenderTarget();
- virtual void Draw(const Drawable& Object);
- virtual unsigned int GetWidth() const = 0;
- virtual unsigned int GetHeight() const = 0;
- void PreserveOpenGLStates(bool Preserve);
- private :
- virtual bool Activate(bool Active) = 0;
- View myDefaultView;
- const View* myCurrentView;
- bool myPreserveStates;
- bool myIsDrawing;
- };
-
- class RenderWindow : public Window, public RenderTarget
- {
- public :
- RenderWindow(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const WindowSettings& Params = WindowSettings());
- virtual ~RenderWindow();
- virtual unsigned int GetWidth() const;
- virtual unsigned int GetHeight() const;
- private :
- virtual void OnCreate();
- virtual bool Activate(bool Active);
- };
-
-} // namespace sf
-
-#endif // USE_MINI_SFML
-
-#endif // !defined MINI_SFML16_INCLUDED
-
diff --git a/external/AntTweakBar/src/Readme.txt b/external/AntTweakBar/src/Readme.txt
deleted file mode 100644
index 325ec10..0000000
--- a/external/AntTweakBar/src/Readme.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Under Windows, it is not necessary to rebuild AntTweakBar since a precompiled
-version is provided in the lib directory. But if you want to recompile it,
-you can use the provided Visual Studio solution. You'd also need the DirectX
-SDK (http://msdn.microsoft.com/directx) and the path to the DirectX shader
-compiler fxc.exe (included in the DirectX SDK) must be listed in the VC++
-directories.
-
-To build the library on Linux, open a terminal, go in the src directory and
-type make
-
-To build the library on MacOSX, open a terminal, go in the src directory and
-type make -f Makefile.osx
diff --git a/external/AntTweakBar/src/TwBar.cpp b/external/AntTweakBar/src/TwBar.cpp
deleted file mode 100644
index 9507a21..0000000
--- a/external/AntTweakBar/src/TwBar.cpp
+++ /dev/null
@@ -1,7771 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// @file TwBar.cpp
-// @author Philippe Decaudin
-// @license This file is part of the AntTweakBar library.
-// For conditions of distribution and use, see License.txt
-//
-// ---------------------------------------------------------------------------
-
-
-#include "TwPrecomp.h"
-#include
-#include "TwMgr.h"
-#include "TwBar.h"
-#include "TwColors.h"
-
-using namespace std;
-
-extern const char *g_ErrNotFound;
-const char *g_ErrUnknownAttrib = "Unknown parameter";
-const char *g_ErrInvalidAttrib = "Invalid parameter";
-const char *g_ErrNotGroup = "Value is not a group";
-const char *g_ErrNoValue = "Value required";
-const char *g_ErrBadValue = "Bad value";
-const char *g_ErrUnknownType = "Unknown type";
-const char *g_ErrNotEnum = "Must be of type Enum";
-
-#undef PERF // comment to print benchs
-#define PERF(cmd)
-
-
-PerfTimer g_BarTimer;
-
-#define ANT_SET_CURSOR(_Name) g_TwMgr->SetCursor(g_TwMgr->m_Cursor##_Name)
-#define ANT_SET_ROTO_CURSOR(_Num) g_TwMgr->SetCursor(g_TwMgr->m_RotoCursors[_Num])
-
-#if !defined(ANT_WINDOWS)
-# define _stricmp strcasecmp
-# define _strdup strdup
-#endif // defined(ANT_WINDOWS)
-
-#if !defined(M_PI)
-# define M_PI 3.1415926535897932384626433832795
-#endif // !defined(M_PI)
-
-const float FLOAT_MAX = 3.0e+38f;
-const double DOUBLE_MAX = 1.0e+308;
-const double DOUBLE_EPS = 1.0e-307;
-
-bool IsCustomType(int _Type)
-{
- return (g_TwMgr && _Type>=TW_TYPE_CUSTOM_BASE && _Typem_Customs.size());
-}
-
-bool IsCSStringType(int _Type)
-{
- return (_Type>TW_TYPE_CSSTRING_BASE && _Type<=TW_TYPE_CSSTRING_MAX);
-}
-
-bool IsEnumType(int _Type)
-{
- return (g_TwMgr && _Type>=TW_TYPE_ENUM_BASE && _Typem_Enums.size());
-}
-
-// ---------------------------------------------------------------------------
-
-CTwVar::CTwVar()
-{
- m_IsRoot = false;
- m_DontClip = false;
- m_Visible = true;
- m_LeftMargin = 0;
- m_TopMargin = 0;
- m_ColorPtr = &COLOR32_WHITE;
- m_BgColorPtr = &COLOR32_ZERO; // default
-}
-
-CTwVarAtom::CTwVarAtom()
-{
- m_Type = TW_TYPE_UNDEF;
- m_Ptr = NULL;
- m_SetCallback = NULL;
- m_GetCallback = NULL;
- m_ClientData = NULL;
- m_ReadOnly = false;
- m_NoSlider = false;
- m_KeyIncr[0] = 0;
- m_KeyIncr[1] = 0;
- m_KeyDecr[0] = 0;
- m_KeyDecr[1] = 0;
- memset(&m_Val, 0, sizeof(UVal));
-}
-
-CTwVarAtom::~CTwVarAtom()
-{
- if( m_Type==TW_TYPE_BOOL8 || m_Type==TW_TYPE_BOOL16 || m_Type==TW_TYPE_BOOL32 || m_Type==TW_TYPE_BOOLCPP )
- {
- if( m_Val.m_Bool.m_FreeTrueString && m_Val.m_Bool.m_TrueString!=NULL )
- {
- free(m_Val.m_Bool.m_TrueString);
- m_Val.m_Bool.m_TrueString = NULL;
- }
- if( m_Val.m_Bool.m_FreeFalseString && m_Val.m_Bool.m_FalseString!=NULL )
- {
- free(m_Val.m_Bool.m_FalseString);
- m_Val.m_Bool.m_FalseString = NULL;
- }
- }
- else if( m_Type==TW_TYPE_CDSTDSTRING && m_GetCallback==CTwMgr::CCDStdString::GetCB && m_ClientData!=NULL && g_TwMgr!=NULL )
- {
- // delete corresponding g_TwMgr->m_CDStdStrings element
- const CTwMgr::CCDStdString *CDStdString = (const CTwMgr::CCDStdString *)m_ClientData;
- //if( &(*CDStdString->m_This)==CDStdString )
- // g_TwMgr->m_CDStdStrings.erase(CDStdString->m_This);
- for( list::iterator it=g_TwMgr->m_CDStdStrings.begin(); it!=g_TwMgr->m_CDStdStrings.end(); ++it )
- if( &(*it)==CDStdString )
- {
- g_TwMgr->m_CDStdStrings.erase(it);
- break;
- }
- }
- /*
- else if( m_Type==TW_TYPE_ENUM8 || m_Type==TW_TYPE_ENUM16 || m_Type==TW_TYPE_ENUM32 )
- {
- if( m_Val.m_Enum.m_Entries!=NULL )
- {
- delete m_Val.m_Enum.m_Entries;
- m_Val.m_Enum.m_Entries = NULL;
- }
- }
- */
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwVarAtom::ValueToString(string *_Str) const
-{
- assert(_Str!=NULL);
- static const char *ErrStr = "unreachable";
- char Tmp[1024];
- if( m_Type==TW_TYPE_UNDEF || m_Type==TW_TYPE_HELP_ATOM || m_Type==TW_TYPE_HELP_GRP || m_Type==TW_TYPE_BUTTON ) // has no value
- {
- *_Str = "";
- return;
- }
- else if( m_Type==TW_TYPE_HELP_HEADER )
- {
- *_Str = "SHORTCUTS";
- return;
- }
- else if( m_Type==TW_TYPE_SHORTCUT ) // special case for help bar: display shortcut
- {
- *_Str = "";
- if( m_ReadOnly && m_Val.m_Shortcut.m_Incr[0]==0 && m_Val.m_Shortcut.m_Decr[0]==0 )
- (*_Str) = "(read only)";
- else
- {
- if( m_Val.m_Shortcut.m_Incr[0]>0 )
- TwGetKeyString(_Str, m_Val.m_Shortcut.m_Incr[0], m_Val.m_Shortcut.m_Incr[1]);
- else
- (*_Str) += "(none)";
- if( m_Val.m_Shortcut.m_Decr[0]>0 )
- {
- (*_Str) += " ";
- TwGetKeyString(_Str, m_Val.m_Shortcut.m_Decr[0], m_Val.m_Shortcut.m_Decr[1]);
- }
- }
- return;
- }
- else if( m_Type==TW_TYPE_HELP_STRUCT )
- {
- int idx = m_Val.m_HelpStruct.m_StructType - TW_TYPE_STRUCT_BASE;
- if( idx>=0 && idx<(int)g_TwMgr->m_Structs.size() )
- {
- if( g_TwMgr->m_Structs[idx].m_Name.length()>0 )
- (*_Str) = '{' + g_TwMgr->m_Structs[idx].m_Name + '}';
- else
- (*_Str) = "{struct}";
- }
- return;
- }
-
- if( m_Ptr==NULL && m_GetCallback==NULL )
- {
- *_Str = ErrStr;
- return;
- }
- bool UseGet = (m_GetCallback!=NULL);
- switch( m_Type )
- {
- case TW_TYPE_BOOLCPP:
- {
- bool Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(bool *)m_Ptr;
- if( Val )
- *_Str = (m_Val.m_Bool.m_TrueString!=NULL) ? m_Val.m_Bool.m_TrueString : "1";
- else
- *_Str = (m_Val.m_Bool.m_FalseString!=NULL) ? m_Val.m_Bool.m_FalseString : "0";
- }
- break;
- case TW_TYPE_BOOL8:
- {
- char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(char *)m_Ptr;
- if( Val )
- *_Str = (m_Val.m_Bool.m_TrueString!=NULL) ? m_Val.m_Bool.m_TrueString : "1";
- else
- *_Str = (m_Val.m_Bool.m_FalseString!=NULL) ? m_Val.m_Bool.m_FalseString : "0";
- }
- break;
- case TW_TYPE_BOOL16:
- {
- short Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(short *)m_Ptr;
- if( Val )
- *_Str = (m_Val.m_Bool.m_TrueString!=NULL) ? m_Val.m_Bool.m_TrueString : "1";
- else
- *_Str = (m_Val.m_Bool.m_FalseString!=NULL) ? m_Val.m_Bool.m_FalseString : "0";
- }
- break;
- case TW_TYPE_BOOL32:
- {
- int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(int *)m_Ptr;
- if( Val )
- *_Str = (m_Val.m_Bool.m_TrueString!=NULL) ? m_Val.m_Bool.m_TrueString : "1";
- else
- *_Str = (m_Val.m_Bool.m_FalseString!=NULL) ? m_Val.m_Bool.m_FalseString : "0";
- }
- break;
- case TW_TYPE_CHAR:
- {
- unsigned char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned char *)m_Ptr;
- if( Val!=0 )
- {
- int d = Val;
- if( m_Val.m_Char.m_Hexa )
- sprintf(Tmp, "%c (0x%.2X)", Val, d);
- else
- sprintf(Tmp, "%c (%d)", Val, d);
- *_Str = Tmp;
- }
- else
- {
- *_Str = " (0)";
- const_cast(_Str->c_str())[0] = '\0';
- }
- }
- break;
- case TW_TYPE_INT8:
- {
- signed char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(signed char *)m_Ptr;
- int d = Val;
- if( m_Val.m_Int8.m_Hexa )
- sprintf(Tmp, "0x%.2X", d&0xff);
- else
- sprintf(Tmp, "%d", d);
- *_Str = Tmp;
- }
- break;
- case TW_TYPE_UINT8:
- {
- unsigned char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned char *)m_Ptr;
- unsigned int d = Val;
- if( m_Val.m_UInt8.m_Hexa )
- sprintf(Tmp, "0x%.2X", d);
- else
- sprintf(Tmp, "%u", d);
- *_Str = Tmp;
- }
- break;
- case TW_TYPE_INT16:
- {
- short Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(short *)m_Ptr;
- int d = Val;
- if( m_Val.m_Int16.m_Hexa )
- sprintf(Tmp, "0x%.4X", d&0xffff);
- else
- sprintf(Tmp, "%d", d);
- *_Str = Tmp;
- }
- break;
- case TW_TYPE_UINT16:
- {
- unsigned short Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned short *)m_Ptr;
- unsigned int d = Val;
- if( m_Val.m_UInt16.m_Hexa )
- sprintf(Tmp, "0x%.4X", d);
- else
- sprintf(Tmp, "%u", d);
- *_Str = Tmp;
- }
- break;
- case TW_TYPE_INT32:
- {
- int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(int *)m_Ptr;
- if( m_Val.m_Int32.m_Hexa )
- sprintf(Tmp, "0x%.8X", Val);
- else
- sprintf(Tmp, "%d", Val);
- *_Str = Tmp;
- }
- break;
- case TW_TYPE_UINT32:
- {
- unsigned int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned int *)m_Ptr;
- if( m_Val.m_UInt32.m_Hexa )
- sprintf(Tmp, "0x%.8X", Val);
- else
- sprintf(Tmp, "%u", Val);
- *_Str = Tmp;
- }
- break;
- case TW_TYPE_FLOAT:
- {
- float Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(float *)m_Ptr;
- if( m_Val.m_Float32.m_Precision<0 )
- sprintf(Tmp, "%g", Val);
- else
- {
- char Fmt[64];
- sprintf(Fmt, "%%.%df", (int)m_Val.m_Float32.m_Precision);
- sprintf(Tmp, Fmt, Val);
- }
- *_Str = Tmp;
- }
- break;
- case TW_TYPE_DOUBLE:
- {
- double Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(double *)m_Ptr;
- if( m_Val.m_Float64.m_Precision<0 )
- sprintf(Tmp, "%g", Val);
- else
- {
- char Fmt[128];
- sprintf(Fmt, "%%.%dlf", (int)m_Val.m_Float64.m_Precision);
- sprintf(Tmp, Fmt, Val);
- }
- *_Str = Tmp;
- }
- break;
- case TW_TYPE_STDSTRING:
- {
- if( UseGet )
- m_GetCallback(_Str, m_ClientData);
- else
- *_Str = *(std::string *)m_Ptr;
- }
- break;
- /*
- case TW_TYPE_ENUM8:
- case TW_TYPE_ENUM16:
- case TW_TYPE_ENUM32:
- {
- unsigned int d = 0;
- if( m_Type==TW_TYPE_ENUM8 )
- {
- unsigned char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned char *)m_Ptr;
- d = Val;
- }
- else if( m_Type==TW_TYPE_ENUM16 )
- {
- unsigned short Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned short *)m_Ptr;
- d = Val;
- }
- else
- {
- assert(m_Type==TW_TYPE_ENUM32);
- unsigned int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned int *)m_Ptr;
- d = Val;
- }
- bool Found = false;
- if( m_Val.m_Enum.m_Entries!=NULL )
- {
- UVal::CEnumVal::CEntries::iterator It = m_Val.m_Enum.m_Entries->find(d);
- if( It!=m_Val.m_Enum.m_Entries->end() )
- {
- *_Str = It->second;
- Found = true;
- }
- }
- if( !Found )
- {
- sprintf(Tmp, "%u", d);
- *_Str = Tmp;
- }
- }
- break;
- */
- default:
- if( IsEnumType(m_Type) )
- {
- unsigned int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned int *)m_Ptr;
-
- CTwMgr::CEnum& e = g_TwMgr->m_Enums[m_Type-TW_TYPE_ENUM_BASE];
- CTwMgr::CEnum::CEntries::iterator It = e.m_Entries.find(Val);
- if( It!=e.m_Entries.end() )
- *_Str = It->second;
- else
- {
- sprintf(Tmp, "%u", Val);
- *_Str = Tmp;
- }
- }
- else if( IsCSStringType(m_Type) )
- {
- char *Val = NULL;
- if( UseGet )
- {
- int n = TW_CSSTRING_SIZE(m_Type);
- if( n+32>(int)g_TwMgr->m_CSStringBuffer.size() )
- g_TwMgr->m_CSStringBuffer.resize(n+32);
- Val = &(g_TwMgr->m_CSStringBuffer[0]);
- m_GetCallback(Val , m_ClientData);
- Val[n] = '\0';
- }
- else
- Val = (char *)m_Ptr;
- if( Val!=NULL )
- *_Str = Val;
- else
- *_Str = "";
- }
- else if( m_Type==TW_TYPE_CDSTRING || m_Type==TW_TYPE_CDSTDSTRING )
- {
- char *Val = NULL;
- if( UseGet )
- m_GetCallback(&Val , m_ClientData);
- else
- Val = *(char **)m_Ptr;
- if( Val!=NULL )
- *_Str = Val;
- else
- *_Str = "";
- }
- else if( IsCustom() ) // m_Type>=TW_TYPE_CUSTOM_BASE && m_Typem_Customs.size() )
- {
- *_Str = "";
- }
- else
- {
- *_Str = "unknown type";
- const_cast(this)->m_ReadOnly = true;
- }
- }
-}
-
-// ---------------------------------------------------------------------------
-
-double CTwVarAtom::ValueToDouble() const
-{
- if( m_Ptr==NULL && m_GetCallback==NULL )
- return 0; // unreachable
- bool UseGet = (m_GetCallback!=NULL);
- switch( m_Type )
- {
- case TW_TYPE_BOOLCPP:
- {
- bool Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(bool *)m_Ptr;
- if( Val )
- return 1;
- else
- return 0;
- }
- break;
- case TW_TYPE_BOOL8:
- {
- char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(char *)m_Ptr;
- if( Val )
- return 1;
- else
- return 0;
- }
- break;
- case TW_TYPE_BOOL16:
- {
- short Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(short *)m_Ptr;
- if( Val )
- return 1;
- else
- return 0;
- }
- break;
- case TW_TYPE_BOOL32:
- {
- int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(int *)m_Ptr;
- if( Val )
- return 1;
- else
- return 0;
- }
- break;
- case TW_TYPE_CHAR:
- {
- unsigned char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned char *)m_Ptr;
- return Val;
- }
- break;
- case TW_TYPE_INT8:
- {
- signed char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(signed char *)m_Ptr;
- int d = Val;
- return d;
- }
- break;
- case TW_TYPE_UINT8:
- {
- unsigned char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned char *)m_Ptr;
- unsigned int d = Val;
- return d;
- }
- break;
- case TW_TYPE_INT16:
- {
- short Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(short *)m_Ptr;
- int d = Val;
- return d;
- }
- break;
- case TW_TYPE_UINT16:
- {
- unsigned short Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned short *)m_Ptr;
- unsigned int d = Val;
- return d;
- }
- break;
- case TW_TYPE_INT32:
- {
- int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(int *)m_Ptr;
- return Val;
- }
- break;
- case TW_TYPE_UINT32:
- {
- unsigned int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned int *)m_Ptr;
- return Val;
- }
- break;
- case TW_TYPE_FLOAT:
- {
- float Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(float *)m_Ptr;
- return Val;
- }
- break;
- case TW_TYPE_DOUBLE:
- {
- double Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(double *)m_Ptr;
- return Val;
- }
- break;
- /*
- case TW_TYPE_ENUM8:
- case TW_TYPE_ENUM16:
- case TW_TYPE_ENUM32:
- {
- unsigned int d = 0;
- if( m_Type==TW_TYPE_ENUM8 )
- {
- unsigned char Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned char *)m_Ptr;
- d = Val;
- }
- else if( m_Type==TW_TYPE_ENUM16 )
- {
- unsigned short Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned short *)m_Ptr;
- d = Val;
- }
- else
- {
- assert(m_Type==TW_TYPE_ENUM32);
- unsigned int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned int *)m_Ptr;
- d = Val;
- }
- return d;
- }
- break;
- */
- default:
- if( IsEnumType(m_Type) )
- {
- unsigned int Val = 0;
- if( UseGet )
- m_GetCallback(&Val, m_ClientData);
- else
- Val = *(unsigned int *)m_Ptr;
- return Val;
- }
- else
- return 0; // unknown type
- }
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwVarAtom::ValueFromDouble(double _Val)
-{
- if( m_Ptr==NULL && m_SetCallback==NULL )
- return; // unreachable
- bool UseSet = (m_SetCallback!=NULL);
- switch( m_Type )
- {
- case TW_TYPE_BOOLCPP:
- {
- bool Val = (_Val!=0);
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(bool*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_BOOL8:
- {
- char Val = (_Val!=0) ? 1 : 0;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(char*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_BOOL16:
- {
- short Val = (_Val!=0) ? 1 : 0;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(short*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_BOOL32:
- {
- int Val = (_Val!=0) ? 1 : 0;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(int*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_CHAR:
- {
- unsigned char Val = (unsigned char)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(unsigned char*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_INT8:
- {
- signed char Val = (signed char)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(signed char*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_UINT8:
- //case TW_TYPE_ENUM8:
- {
- unsigned char Val = (unsigned char)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(unsigned char*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_INT16:
- {
- short Val = (short)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(short*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_UINT16:
- //case TW_TYPE_ENUM16:
- {
- unsigned short Val = (unsigned short)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(unsigned short*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_INT32:
- {
- int Val = (int)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(int*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_UINT32:
- //case TW_TYPE_ENUM32:
- {
- unsigned int Val = (unsigned int)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(unsigned int*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_FLOAT:
- {
- float Val = (float)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(float*)m_Ptr = Val;
- }
- break;
- case TW_TYPE_DOUBLE:
- {
- double Val = (double)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(double*)m_Ptr = Val;
- }
- break;
- default:
- if( IsEnumType(m_Type) )
- {
- unsigned int Val = (unsigned int)_Val;
- if( UseSet )
- m_SetCallback(&Val, m_ClientData);
- else
- *(unsigned int*)m_Ptr = Val;
- }
- }
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwVarAtom::MinMaxStepToDouble(double *_Min, double *_Max, double *_Step) const
-{
- double max = DOUBLE_MAX;
- double min = -DOUBLE_MAX;
- double step = 1;
-
- switch( m_Type )
- {
- case TW_TYPE_BOOLCPP:
- case TW_TYPE_BOOL8:
- case TW_TYPE_BOOL16:
- case TW_TYPE_BOOL32:
- min = 0;
- max = 1;
- step = 1;
- break;
- case TW_TYPE_CHAR:
- min = (double)m_Val.m_Char.m_Min;
- max = (double)m_Val.m_Char.m_Max;
- step = (double)m_Val.m_Char.m_Step;
- break;
- case TW_TYPE_INT8:
- min = (double)m_Val.m_Int8.m_Min;
- max = (double)m_Val.m_Int8.m_Max;
- step = (double)m_Val.m_Int8.m_Step;
- break;
- case TW_TYPE_UINT8:
- min = (double)m_Val.m_UInt8.m_Min;
- max = (double)m_Val.m_UInt8.m_Max;
- step = (double)m_Val.m_UInt8.m_Step;
- break;
- case TW_TYPE_INT16:
- min = (double)m_Val.m_Int16.m_Min;
- max = (double)m_Val.m_Int16.m_Max;
- step = (double)m_Val.m_Int16.m_Step;
- break;
- case TW_TYPE_UINT16:
- min = (double)m_Val.m_UInt16.m_Min;
- max = (double)m_Val.m_UInt16.m_Max;
- step = (double)m_Val.m_UInt16.m_Step;
- break;
- case TW_TYPE_INT32:
- min = (double)m_Val.m_Int32.m_Min;
- max = (double)m_Val.m_Int32.m_Max;
- step = (double)m_Val.m_Int32.m_Step;
- break;
- case TW_TYPE_UINT32:
- min = (double)m_Val.m_UInt32.m_Min;
- max = (double)m_Val.m_UInt32.m_Max;
- step = (double)m_Val.m_UInt32.m_Step;
- break;
- case TW_TYPE_FLOAT:
- min = (double)m_Val.m_Float32.m_Min;
- max = (double)m_Val.m_Float32.m_Max;
- step = (double)m_Val.m_Float32.m_Step;
- break;
- case TW_TYPE_DOUBLE:
- min = m_Val.m_Float64.m_Min;
- max = m_Val.m_Float64.m_Max;
- step = m_Val.m_Float64.m_Step;
- break;
- default:
- {} // nothing
- }
-
- if( _Min!=NULL )
- *_Min = min;
- if( _Max!=NULL )
- *_Max = max;
- if( _Step!=NULL )
- *_Step = step;
-}
-
-// ---------------------------------------------------------------------------
-
-const CTwVar *CTwVarAtom::Find(const char *_Name, CTwVarGroup **_Parent, int *_Index) const
-{
- if( strcmp(_Name, m_Name.c_str())==0 )
- {
- if( _Parent!=NULL )
- *_Parent = NULL;
- if( _Index!=NULL )
- *_Index = -1;
- return this;
- }
- else
- return NULL;
-}
-
-// ---------------------------------------------------------------------------
-
-enum EVarAttribs
-{
- V_LABEL = 1,
- V_HELP,
- V_GROUP,
- V_SHOW,
- V_HIDE,
- V_READONLY,
- V_READWRITE,
- V_ORDER,
- V_VISIBLE,
- V_ENDTAG
-};
-
-int CTwVar::HasAttrib(const char *_Attrib, bool *_HasValue) const
-{
- *_HasValue = true;
- if( _stricmp(_Attrib, "label")==0 )
- return V_LABEL;
- else if( _stricmp(_Attrib, "help")==0 )
- return V_HELP;
- else if( _stricmp(_Attrib, "group")==0 )
- return V_GROUP;
- else if( _stricmp(_Attrib, "order")==0 )
- return V_ORDER;
- else if( _stricmp(_Attrib, "visible")==0 )
- return V_VISIBLE;
- else if( _stricmp(_Attrib, "readonly")==0 )
- return V_READONLY;
-
- // for backward compatibility
- *_HasValue = false;
- if( _stricmp(_Attrib, "show")==0 )
- return V_SHOW;
- else if( _stricmp(_Attrib, "hide")==0 )
- return V_HIDE;
- if( _stricmp(_Attrib, "readonly")==0 )
- return V_READONLY;
- else if( _stricmp(_Attrib, "readwrite")==0 )
- return V_READWRITE;
-
- return 0; // not found
-}
-
-int CTwVar::SetAttrib(int _AttribID, const char *_Value, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex)
-{
- switch( _AttribID )
- {
- case V_LABEL:
- case V_HELP:
- if( _Value && strlen(_Value)>0 )
- {
- /*
- if( IsGroup() && static_cast(this)->m_StructValuePtr!=NULL )
- {
- int Idx = static_cast(this)->m_StructType-TW_TYPE_STRUCT_BASE;
- if( Idx>=0 && Idx<(int)g_TwMgr->m_Structs.size() )
- if( _AttribID==V_LABEL )
- g_TwMgr->m_Structs[Idx].m_Label = _Value;
- else // V_HELP
- g_TwMgr->m_Structs[Idx].m_Help = _Value;
- }
- else
- */
- {
- CTwVarGroup *Parent = NULL;
- CTwVar *ThisVar = _Bar->Find(m_Name.c_str(), &Parent);
- if( this==ThisVar && Parent!=NULL && Parent->m_StructValuePtr!=NULL )
- {
- int Idx = Parent->m_StructType-TW_TYPE_STRUCT_BASE;
- if( Idx>=0 && Idx<(int)g_TwMgr->m_Structs.size() )
- {
- size_t nl = m_Name.length();
- for( size_t im=0; imm_Structs[Idx].m_Members.size(); ++im )
- {
- size_t ml = g_TwMgr->m_Structs[Idx].m_Members[im].m_Name.length();
- if( nl>=ml && strcmp(g_TwMgr->m_Structs[Idx].m_Members[im].m_Name.c_str(), m_Name.c_str()+(nl-ml))==0 )
- {
- // TODO: would have to be applied to other vars already created
- if( _AttribID==V_LABEL )
- {
- g_TwMgr->m_Structs[Idx].m_Members[im].m_Label = _Value;
-// m_Label = _Value;
- }
- else // V_HELP
- g_TwMgr->m_Structs[Idx].m_Members[im].m_Help = _Value;
- break;
- }
- }
- }
- }
- else
- {
- if( _AttribID==V_LABEL )
- m_Label = _Value;
- else // V_HELP
- m_Help = _Value;
- }
- }
- _Bar->NotUpToDate();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case V_GROUP:
- {
- CTwVarGroup *Grp = NULL;
- if( _Value==NULL || strlen(_Value)<=0 )
- Grp = &(_Bar->m_VarRoot);
- else
- {
- CTwVar *v = _Bar->Find(_Value, NULL, NULL);
- if( v && !v->IsGroup() )
- {
- g_TwMgr->SetLastError(g_ErrNotGroup);
- return 0;
- }
- Grp = static_cast(v);
- if( Grp==NULL )
- {
- Grp = new CTwVarGroup;
- Grp->m_Name = _Value;
- Grp->m_Open = true;
- Grp->m_SummaryCallback = NULL;
- Grp->m_SummaryClientData = NULL;
- Grp->m_StructValuePtr = NULL;
- Grp->m_ColorPtr = &(_Bar->m_ColGrpText);
- _Bar->m_VarRoot.m_Vars.push_back(Grp);
- }
- }
- Grp->m_Vars.push_back(this);
- if( _VarParent!=NULL && _VarIndex>=0 )
- {
- _VarParent->m_Vars.erase(_VarParent->m_Vars.begin()+_VarIndex);
- if( _VarParent!=&(_Bar->m_VarRoot) && _VarParent->m_Vars.size()<=0 )
- TwRemoveVar(_Bar, _VarParent->m_Name.c_str());
- }
- _Bar->NotUpToDate();
- return 1;
- }
- case V_SHOW: // for backward compatibility
- if( !m_Visible )
- {
- m_Visible = true;
- _Bar->NotUpToDate();
- }
- return 1;
- case V_HIDE: // for backward compatibility
- if( m_Visible )
- {
- m_Visible = false;
- _Bar->NotUpToDate();
- }
- return 1;
- /*
- case V_READONLY:
- SetReadOnly(true);
- _Bar->NotUpToDate();
- return 1;
- */
- case V_READWRITE: // for backward compatibility
- SetReadOnly(false);
- _Bar->NotUpToDate();
- return 1;
- case V_ORDER:
- // a special case for compatibility with deprecated command 'option=ogl/dx'
- if( IsGroup() && _Value!=NULL && static_cast(this)->m_SummaryCallback==CColorExt::SummaryCB && static_cast(this)->m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- if( _stricmp(_Value, "ogl")==0 )
- {
- static_cast(static_cast(this)->m_StructValuePtr)->m_OGL = true;
- return 1;
- }
- else if( _stricmp(_Value, "dx")==0 )
- {
- static_cast(static_cast(this)->m_StructValuePtr)->m_OGL = false;
- return 1;
- }
- }
- // todo: general 'order' command (no else)
- return 0;
- case V_VISIBLE:
- if( _Value!=NULL && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "true")==0 || _stricmp(_Value, "1")==0 )
- {
- if( !m_Visible )
- {
- m_Visible = true;
- _Bar->NotUpToDate();
- }
- return 1;
- }
- else if( _stricmp(_Value, "false")==0 || _stricmp(_Value, "0")==0 )
- {
- if( m_Visible )
- {
- m_Visible = false;
- _Bar->NotUpToDate();
- }
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case V_READONLY:
- if( _Value==NULL || strlen(_Value)==0 // no value is acceptable (for backward compatibility)
- || _stricmp(_Value, "true")==0 || _stricmp(_Value, "1")==0 )
- {
- if( !IsReadOnly() )
- {
- SetReadOnly(true);
- _Bar->NotUpToDate();
- }
- return 1;
- }
- else if( _stricmp(_Value, "false")==0 || _stricmp(_Value, "0")==0 )
- {
- if( IsReadOnly() )
- {
- SetReadOnly(false);
- _Bar->NotUpToDate();
- }
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- default:
- g_TwMgr->SetLastError(g_ErrUnknownAttrib);
- return 0;
- }
-}
-
-
-ERetType CTwVar::GetAttrib(int _AttribID, TwBar * /*_Bar*/, CTwVarGroup * _VarParent, int /*_VarIndex*/, std::vector& outDoubles, std::ostringstream& outString) const
-{
- outDoubles.clear();
- outString.clear();
-
- switch( _AttribID )
- {
- case V_LABEL:
- outString << m_Label;
- return RET_STRING;
- case V_HELP:
- outString << m_Help;
- return RET_STRING;
- case V_GROUP:
- if( _VarParent!=NULL )
- outString << _VarParent->m_Name;
- return RET_STRING;
- case V_VISIBLE:
- outDoubles.push_back(m_Visible ? 1 : 0);
- return RET_DOUBLE;
- case V_READONLY:
- outDoubles.push_back(IsReadOnly() ? 1 : 0);
- return RET_DOUBLE;
- default:
- g_TwMgr->SetLastError(g_ErrUnknownAttrib);
- return RET_ERROR;
- }
-}
-
-
-// ---------------------------------------------------------------------------
-
-enum EVarAtomAttribs
-{
- VA_KEY_INCR = V_ENDTAG+1,
- VA_KEY_DECR,
- VA_MIN,
- VA_MAX,
- VA_STEP,
- VA_PRECISION,
- VA_HEXA,
- VA_DECIMAL, // for backward compatibility
- VA_TRUE,
- VA_FALSE,
- VA_ENUM,
- VA_VALUE
-};
-
-int CTwVarAtom::HasAttrib(const char *_Attrib, bool *_HasValue) const
-{
- *_HasValue = true;
- if( _stricmp(_Attrib, "keyincr")==0 || _stricmp(_Attrib, "key")==0 )
- return VA_KEY_INCR;
- else if( _stricmp(_Attrib, "keydecr")==0 )
- return VA_KEY_DECR;
- else if( _stricmp(_Attrib, "min")==0 )
- return VA_MIN;
- else if( _stricmp(_Attrib, "max")==0 )
- return VA_MAX;
- else if( _stricmp(_Attrib, "step")==0 )
- return VA_STEP;
- else if( _stricmp(_Attrib, "precision")==0 )
- return VA_PRECISION;
- else if( _stricmp(_Attrib, "hexa")==0 )
- return VA_HEXA;
- else if( _stricmp(_Attrib, "decimal")==0 ) // for backward compatibility
- {
- *_HasValue = false;
- return VA_DECIMAL;
- }
- else if( _stricmp(_Attrib, "true")==0 )
- return VA_TRUE;
- else if( _stricmp(_Attrib, "false")==0 )
- return VA_FALSE;
- else if( _stricmp(_Attrib, "enum")==0
- || _stricmp(_Attrib, "val")==0 ) // for backward compatibility
- return VA_ENUM;
- else if( _stricmp(_Attrib, "value")==0 )
- return VA_VALUE;
-
- return CTwVar::HasAttrib(_Attrib, _HasValue);
-}
-
-int CTwVarAtom::SetAttrib(int _AttribID, const char *_Value, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex)
-{
- switch( _AttribID )
- {
- case VA_KEY_INCR:
- {
- int Key = 0;
- int Mod = 0;
- if( TwGetKeyCode(&Key, &Mod, _Value) )
- {
- m_KeyIncr[0] = Key;
- m_KeyIncr[1] = Mod;
- return 1;
- }
- else
- return 0;
- }
- case VA_KEY_DECR:
- {
- int Key = 0;
- int Mod = 0;
- if( TwGetKeyCode(&Key, &Mod, _Value) )
- {
- m_KeyDecr[0] = Key;
- m_KeyDecr[1] = Mod;
- return 1;
- }
- else
- return 0;
- }
- case VA_TRUE:
- if( (m_Type==TW_TYPE_BOOL8 || m_Type==TW_TYPE_BOOL16 || m_Type==TW_TYPE_BOOL32 || m_Type==TW_TYPE_BOOLCPP) && _Value!=NULL )
- {
- if( m_Val.m_Bool.m_FreeTrueString && m_Val.m_Bool.m_TrueString!=NULL )
- free(m_Val.m_Bool.m_TrueString);
- m_Val.m_Bool.m_TrueString = _strdup(_Value);
- m_Val.m_Bool.m_FreeTrueString = true;
- return 1;
- }
- else
- return 0;
- case VA_FALSE:
- if( (m_Type==TW_TYPE_BOOL8 || m_Type==TW_TYPE_BOOL16 || m_Type==TW_TYPE_BOOL32 || m_Type==TW_TYPE_BOOLCPP) && _Value!=NULL )
- {
- if( m_Val.m_Bool.m_FreeFalseString && m_Val.m_Bool.m_FalseString!=NULL )
- free(m_Val.m_Bool.m_FalseString);
- m_Val.m_Bool.m_FalseString = _strdup(_Value);
- m_Val.m_Bool.m_FreeFalseString = true;
- return 1;
- }
- else
- return 0;
- case VA_MIN:
- case VA_MAX:
- case VA_STEP:
- if( _Value && strlen(_Value)>0 )
- {
- void *Ptr = NULL;
- const char *Fmt = NULL;
- int d = 0;
- unsigned int u = 0;
- int Num = (_AttribID==VA_STEP) ? 2 : ((_AttribID==VA_MAX) ? 1 : 0);
- switch( m_Type )
- {
- case TW_TYPE_CHAR:
- //Ptr = (&m_Val.m_Char.m_Min) + Num;
- //Fmt = "%c";
- Ptr = &u;
- Fmt = "%u";
- break;
- case TW_TYPE_INT16:
- Ptr = (&m_Val.m_Int16.m_Min) + Num;
- Fmt = "%hd";
- break;
- case TW_TYPE_INT32:
- Ptr = (&m_Val.m_Int32.m_Min) + Num;
- Fmt = "%d";
- break;
- case TW_TYPE_UINT16:
- Ptr = (&m_Val.m_UInt16.m_Min) + Num;
- Fmt = "%hu";
- break;
- case TW_TYPE_UINT32:
- Ptr = (&m_Val.m_UInt32.m_Min) + Num;
- Fmt = "%u";
- break;
- case TW_TYPE_FLOAT:
- Ptr = (&m_Val.m_Float32.m_Min) + Num;
- Fmt = "%f";
- break;
- case TW_TYPE_DOUBLE:
- Ptr = (&m_Val.m_Float64.m_Min) + Num;
- Fmt = "%lf";
- break;
- case TW_TYPE_INT8:
- Ptr = &d;
- Fmt = "%d";
- break;
- case TW_TYPE_UINT8:
- Ptr = &u;
- Fmt = "%u";
- break;
- default:
- g_TwMgr->SetLastError(g_ErrUnknownType);
- return 0;
- }
-
- if( Fmt!=NULL && Ptr!=NULL && sscanf(_Value, Fmt, Ptr)==1 )
- {
- if( m_Type==TW_TYPE_CHAR )
- *((&m_Val.m_Char.m_Min)+Num) = (unsigned char)(u);
- else if( m_Type==TW_TYPE_INT8 )
- *((&m_Val.m_Int8.m_Min)+Num) = (signed char)(d);
- else if( m_Type==TW_TYPE_UINT8 )
- *((&m_Val.m_UInt8.m_Min)+Num) = (unsigned char)(u);
-
- // set precision
- if( _AttribID==VA_STEP && ((m_Type==TW_TYPE_FLOAT && m_Val.m_Float32.m_Precision<0) || (m_Type==TW_TYPE_DOUBLE && m_Val.m_Float64.m_Precision<0)) )
- {
- double Step = fabs( (m_Type==TW_TYPE_FLOAT) ? m_Val.m_Float32.m_Step : m_Val.m_Float64.m_Step );
- signed char *Precision = (m_Type==TW_TYPE_FLOAT) ? &m_Val.m_Float32.m_Precision : &m_Val.m_Float64.m_Precision;
- const double K_EPS = 1.0 - 1.0e-6;
- if( Step>=1 )
- *Precision = 0;
- else if( Step>=0.1*K_EPS )
- *Precision = 1;
- else if( Step>=0.01*K_EPS )
- *Precision = 2;
- else if( Step>=0.001*K_EPS )
- *Precision = 3;
- else if( Step>=0.0001*K_EPS )
- *Precision = 4;
- else if( Step>=0.00001*K_EPS )
- *Precision = 5;
- else if( Step>=0.000001*K_EPS )
- *Precision = 6;
- else if( Step>=0.0000001*K_EPS )
- *Precision = 7;
- else if( Step>=0.00000001*K_EPS )
- *Precision = 8;
- else if( Step>=0.000000001*K_EPS )
- *Precision = 9;
- else if( Step>=0.0000000001*K_EPS )
- *Precision = 10;
- else if( Step>=0.00000000001*K_EPS )
- *Precision = 11;
- else if( Step>=0.000000000001*K_EPS )
- *Precision = 12;
- else
- *Precision = -1;
- }
-
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case VA_PRECISION:
- if( _Value && strlen(_Value)>0 )
- {
- int Precision = 0;
- if( sscanf(_Value, "%d", &Precision)==1 && Precision>=-1 && Precision<=12 )
- {
- if( m_Type==TW_TYPE_FLOAT )
- m_Val.m_Float32.m_Precision = (signed char)Precision;
- else if ( m_Type==TW_TYPE_DOUBLE )
- m_Val.m_Float64.m_Precision = (signed char)Precision;
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case VA_HEXA:
- case VA_DECIMAL:
- {
- bool hexa = false;
- if (_AttribID==VA_HEXA)
- {
- if( _Value==NULL || strlen(_Value)==0 // no value is acceptable (for backward compatibility)
- || _stricmp(_Value, "true")==0 || _stricmp(_Value, "1")==0 )
- hexa = true;
- }
-
- switch( m_Type )
- {
- case TW_TYPE_CHAR:
- m_Val.m_Char.m_Hexa = hexa;
- return 1;
- case TW_TYPE_INT8:
- m_Val.m_Int8.m_Hexa = hexa;
- return 1;
- case TW_TYPE_INT16:
- m_Val.m_Int16.m_Hexa = hexa;
- return 1;
- case TW_TYPE_INT32:
- m_Val.m_Int32.m_Hexa = hexa;
- return 1;
- case TW_TYPE_UINT8:
- m_Val.m_UInt8.m_Hexa = hexa;
- return 1;
- case TW_TYPE_UINT16:
- m_Val.m_UInt16.m_Hexa = hexa;
- return 1;
- case TW_TYPE_UINT32:
- m_Val.m_UInt32.m_Hexa = hexa;
- return 1;
- default:
- return 0;
- }
- }
- case VA_ENUM:
- if( _Value && strlen(_Value)>0 && IsEnumType(m_Type) )
- {
- const char *s = _Value;
- int n = 0, i = 0;
- unsigned int u;
- bool Cont;
- g_TwMgr->m_Enums[m_Type-TW_TYPE_ENUM_BASE].m_Entries.clear(); // anyway reset entries
- do
- {
- Cont = false;
- i = 0;
- char Sep;
- n = sscanf(s, "%u %c%n", &u, &Sep, &i);
- if( n==2 && i>0 && ( Sep=='<' || Sep=='{' || Sep=='[' || Sep=='(' ) )
- {
- if( Sep=='<' ) // Change to closing separator
- Sep = '>';
- else if( Sep=='{' )
- Sep = '}';
- else if( Sep=='[' )
- Sep = ']';
- else if( Sep=='(' )
- Sep = ')';
- s += i;
- i = 0;
- while( s[i]!=Sep && s[i]!=0 )
- ++i;
- if( s[i]==Sep )
- {
- //if( m_Val.m_Enum.m_Entries==NULL )
- // m_Val.m_Enum.m_Entries = new UVal::CEnumVal::CEntries;
- //UVal::CEnumVal::CEntries::value_type v(u, "");
- CTwMgr::CEnum::CEntries::value_type v(u, "");
- if( i>0 )
- v.second.assign(s, i);
- //m_Val.m_Enum.m_Entries->insert(v);
- pair ret;
- ret = g_TwMgr->m_Enums[m_Type-TW_TYPE_ENUM_BASE].m_Entries.insert(v);
- if( !ret.second ) // force overwrite if element already exists
- {
- g_TwMgr->m_Enums[m_Type-TW_TYPE_ENUM_BASE].m_Entries.erase(ret.first);
- g_TwMgr->m_Enums[m_Type-TW_TYPE_ENUM_BASE].m_Entries.insert(v);
- }
-
- s += i+1;
- i = 0;
- n = sscanf(s, " ,%n", &i);
- if( n==0 && i>=1 )
- {
- s += i;
- Cont = true;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- } while( Cont );
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- break;
- case VA_VALUE:
- if( _Value!=NULL && strlen(_Value)>0 ) // do not check ReadOnly here.
- {
- if( !( m_Type==TW_TYPE_BUTTON || IsCustom() ) ) // || (m_Type>=TW_TYPE_CUSTOM_BASE && m_Typem_Customs.size()) ) )
- {
- if( m_Type==TW_TYPE_CDSTRING || m_Type==TW_TYPE_CDSTDSTRING )
- {
- if( m_SetCallback!=NULL )
- {
- m_SetCallback(&_Value, m_ClientData);
- if( g_TwMgr!=NULL ) // Mgr might have been destroyed by the client inside a callback call
- _Bar->NotUpToDate();
- return 1;
- }
- else if( m_Type!=TW_TYPE_CDSTDSTRING )
- {
- char **StringPtr = (char **)m_Ptr;
- if( StringPtr!=NULL && g_TwMgr->m_CopyCDStringToClient!=NULL )
- {
- g_TwMgr->m_CopyCDStringToClient(StringPtr, _Value);
- _Bar->NotUpToDate();
- return 1;
- }
- }
- }
- else if( IsCSStringType(m_Type) )
- {
- int n = TW_CSSTRING_SIZE(m_Type);
- if( n>0 )
- {
- string str = _Value;
- if( (int)str.length()>n-1 )
- str.resize(n-1);
- if( m_SetCallback!=NULL )
- {
- m_SetCallback(str.c_str(), m_ClientData);
- if( g_TwMgr!=NULL ) // Mgr might have been destroyed by the client inside a callback call
- _Bar->NotUpToDate();
- return 1;
- }
- else if( m_Ptr!=NULL )
- {
- if( n>1 )
- strncpy((char *)m_Ptr, str.c_str(), n-1);
- ((char *)m_Ptr)[n-1] = '\0';
- _Bar->NotUpToDate();
- return 1;
- }
- }
- }
- else
- {
- double dbl;
- if( sscanf(_Value, "%lf", &dbl)==1 )
- {
- ValueFromDouble(dbl);
- if( g_TwMgr!=NULL ) // Mgr might have been destroyed by the client inside a callback call
- _Bar->NotUpToDate();
- return 1;
- }
- }
- }
- }
- return 0;
- default:
- return CTwVar::SetAttrib(_AttribID, _Value, _Bar, _VarParent, _VarIndex);
- }
-}
-
-ERetType CTwVarAtom::GetAttrib(int _AttribID, TwBar *_Bar, CTwVarGroup *_VarParent, int _VarIndex, std::vector& outDoubles, std::ostringstream& outString) const
-{
- outDoubles.clear();
- outString.clear();
- std::string str;
- int num = 0;
-
- switch( _AttribID )
- {
- case VA_KEY_INCR:
- if( TwGetKeyString(&str, m_KeyIncr[0], m_KeyIncr[1]) )
- outString << str;
- return RET_STRING;
- case VA_KEY_DECR:
- if( TwGetKeyString(&str, m_KeyDecr[0], m_KeyDecr[1]) )
- outString << str;
- return RET_STRING;
- case VA_TRUE:
- if( m_Type==TW_TYPE_BOOL8 || m_Type==TW_TYPE_BOOL16 || m_Type==TW_TYPE_BOOL32 || m_Type==TW_TYPE_BOOLCPP )
- {
- outString << m_Val.m_Bool.m_TrueString;
- return RET_STRING;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- }
- case VA_FALSE:
- if( m_Type==TW_TYPE_BOOL8 || m_Type==TW_TYPE_BOOL16 || m_Type==TW_TYPE_BOOL32 || m_Type==TW_TYPE_BOOLCPP )
- {
- outString << m_Val.m_Bool.m_FalseString;
- return RET_STRING;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- }
- case VA_MIN:
- case VA_MAX:
- case VA_STEP:
- num = (_AttribID==VA_STEP) ? 2 : ((_AttribID==VA_MAX) ? 1 : 0);
- switch( m_Type )
- {
- case TW_TYPE_CHAR:
- outDoubles.push_back( *((&m_Val.m_Char.m_Min) + num) );
- return RET_DOUBLE;
- case TW_TYPE_INT8:
- outDoubles.push_back( *((&m_Val.m_Int8.m_Min) + num) );
- return RET_DOUBLE;
- case TW_TYPE_UINT8:
- outDoubles.push_back( *((&m_Val.m_UInt8.m_Min) + num) );
- return RET_DOUBLE;
- case TW_TYPE_INT16:
- outDoubles.push_back( *((&m_Val.m_Int16.m_Min) + num) );
- return RET_DOUBLE;
- case TW_TYPE_INT32:
- outDoubles.push_back( *((&m_Val.m_Int32.m_Min) + num) );
- return RET_DOUBLE;
- case TW_TYPE_UINT16:
- outDoubles.push_back( *((&m_Val.m_UInt16.m_Min) + num) );
- return RET_DOUBLE;
- case TW_TYPE_UINT32:
- outDoubles.push_back( *((&m_Val.m_UInt32.m_Min) + num) );
- return RET_DOUBLE;
- case TW_TYPE_FLOAT:
- outDoubles.push_back( *((&m_Val.m_Float32.m_Min) + num) );
- return RET_DOUBLE;
- case TW_TYPE_DOUBLE:
- outDoubles.push_back( *((&m_Val.m_Float64.m_Min) + num) );
- return RET_DOUBLE;
- default:
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- }
- case VA_PRECISION:
- if( m_Type==TW_TYPE_FLOAT )
- {
- outDoubles.push_back( m_Val.m_Float32.m_Precision );
- return RET_DOUBLE;
- }
- else if ( m_Type==TW_TYPE_DOUBLE )
- {
- outDoubles.push_back( m_Val.m_Float64.m_Precision );
- return RET_DOUBLE;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- }
- case VA_HEXA:
- switch( m_Type )
- {
- case TW_TYPE_CHAR:
- outDoubles.push_back( m_Val.m_Char.m_Hexa );
- return RET_DOUBLE;
- case TW_TYPE_INT8:
- outDoubles.push_back( m_Val.m_Int8.m_Hexa );
- return RET_DOUBLE;
- case TW_TYPE_INT16:
- outDoubles.push_back( m_Val.m_Int16.m_Hexa );
- return RET_DOUBLE;
- case TW_TYPE_INT32:
- outDoubles.push_back( m_Val.m_Int32.m_Hexa );
- return RET_DOUBLE;
- case TW_TYPE_UINT8:
- outDoubles.push_back( m_Val.m_UInt8.m_Hexa );
- return RET_DOUBLE;
- case TW_TYPE_UINT16:
- outDoubles.push_back( m_Val.m_UInt16.m_Hexa );
- return RET_DOUBLE;
- case TW_TYPE_UINT32:
- outDoubles.push_back( m_Val.m_UInt32.m_Hexa );
- return RET_DOUBLE;
- default:
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- }
- case VA_ENUM:
- if( IsEnumType(m_Type) )
- {
- CTwMgr::CEnum::CEntries::iterator it = g_TwMgr->m_Enums[m_Type-TW_TYPE_ENUM_BASE].m_Entries.begin();
- for( ; it != g_TwMgr->m_Enums[m_Type-TW_TYPE_ENUM_BASE].m_Entries.end(); ++it )
- {
- if( it != g_TwMgr->m_Enums[m_Type-TW_TYPE_ENUM_BASE].m_Entries.begin() )
- outString << ',';
- outString << it->first << ' ';
- if( it->second.find_first_of("{}")==std::string::npos )
- outString << '{' << it->second << '}';
- else if ( it->second.find_first_of("<>")==std::string::npos )
- outString << '<' << it->second << '>';
- else if ( it->second.find_first_of("()")==std::string::npos )
- outString << '(' << it->second << ')';
- else if ( it->second.find_first_of("[]")==std::string::npos )
- outString << '[' << it->second << ']';
- else
- outString << '{' << it->second << '}'; // should not occured (use braces)
- }
- return RET_STRING;
- }
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- case VA_VALUE:
- if( !( m_Type==TW_TYPE_BUTTON || IsCustom() ) ) // || (m_Type>=TW_TYPE_CUSTOM_BASE && m_Typem_Customs.size()) ) )
- {
- if( m_Type==TW_TYPE_CDSTRING || m_Type==TW_TYPE_CDSTDSTRING || IsCSStringType(m_Type) )
- {
- string str;
- ValueToString(&str);
- outString << str;
- return RET_STRING;
- }
- else
- {
- outDoubles.push_back( ValueToDouble() );
- return RET_DOUBLE;
- }
- }
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- default:
- return CTwVar::GetAttrib(_AttribID, _Bar, _VarParent, _VarIndex, outDoubles, outString);
- }
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwVarAtom::Increment(int _Step)
-{
- if( _Step==0 )
- return;
- switch( m_Type )
- {
- case TW_TYPE_BOOL8:
- {
- char v = false;
- if( m_Ptr!=NULL )
- v = *((char *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- if( v )
- v = false;
- else
- v = true;
- if( m_Ptr!=NULL )
- *((char *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_BOOL16:
- {
- short v = false;
- if( m_Ptr!=NULL )
- v = *((short *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- if( v )
- v = false;
- else
- v = true;
- if( m_Ptr!=NULL )
- *((short *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_BOOL32:
- {
- int v = false;
- if( m_Ptr!=NULL )
- v = *((int *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- if( v )
- v = false;
- else
- v = true;
- if( m_Ptr!=NULL )
- *((int *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_BOOLCPP:
- {
- bool v = false;
- if( m_Ptr!=NULL )
- v = *((bool *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- if( v )
- v = false;
- else
- v = true;
- if( m_Ptr!=NULL )
- *((bool *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_CHAR:
- {
- unsigned char v = 0;
- if( m_Ptr!=NULL )
- v = *((unsigned char *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- int iv = _Step*(int)m_Val.m_Char.m_Step + (int)v;
- if( ivm_Val.m_Char.m_Max )
- iv = m_Val.m_Char.m_Max;
- if( iv<0 )
- iv = 0;
- else if( iv>0xff )
- iv = 0xff;
- v = (unsigned char)iv;
- if( m_Ptr!=NULL )
- *((unsigned char *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_INT8:
- {
- signed char v = 0;
- if( m_Ptr!=NULL )
- v = *((signed char *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- int iv = _Step*(int)m_Val.m_Int8.m_Step + (int)v;
- if( ivm_Val.m_Int8.m_Max )
- iv = m_Val.m_Int8.m_Max;
- v = (signed char)iv;
- if( m_Ptr!=NULL )
- *((signed char *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_UINT8:
- {
- unsigned char v = 0;
- if( m_Ptr!=NULL )
- v = *((unsigned char *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- int iv = _Step*(int)m_Val.m_UInt8.m_Step + (int)v;
- if( ivm_Val.m_UInt8.m_Max )
- iv = m_Val.m_UInt8.m_Max;
- if( iv<0 )
- iv = 0;
- else if( iv>0xff )
- iv = 0xff;
- v = (unsigned char)iv;
- if( m_Ptr!=NULL )
- *((unsigned char *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_INT16:
- {
- short v = 0;
- if( m_Ptr!=NULL )
- v = *((short *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- int iv = _Step*(int)m_Val.m_Int16.m_Step + (int)v;
- if( ivm_Val.m_Int16.m_Max )
- iv = m_Val.m_Int16.m_Max;
- v = (short)iv;
- if( m_Ptr!=NULL )
- *((short *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_UINT16:
- {
- unsigned short v = 0;
- if( m_Ptr!=NULL )
- v = *((unsigned short *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- int iv = _Step*(int)m_Val.m_UInt16.m_Step + (int)v;
- if( ivm_Val.m_UInt16.m_Max )
- iv = m_Val.m_UInt16.m_Max;
- if( iv<0 )
- iv = 0;
- else if( iv>0xffff )
- iv = 0xffff;
- v = (unsigned short)iv;
- if( m_Ptr!=NULL )
- *((unsigned short *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_INT32:
- {
- int v = 0;
- if( m_Ptr!=NULL )
- v = *((int *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- double dv = (double)_Step*(double)m_Val.m_Int32.m_Step + (double)v;
- if( dv>(double)0x7fffffff )
- v = 0x7fffffff;
- else if( dv<(double)(-0x7fffffff-1) )
- v = -0x7fffffff-1;
- else
- v = _Step*m_Val.m_Int32.m_Step + v;
- if( vm_Val.m_Int32.m_Max )
- v = m_Val.m_Int32.m_Max;
- if( m_Ptr!=NULL )
- *((int *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_UINT32:
- {
- unsigned int v = 0;
- if( m_Ptr!=NULL )
- v = *((unsigned int *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- double dv = (double)_Step*(double)m_Val.m_UInt32.m_Step + (double)v;
- if( dv>(double)0xffffffff )
- v = 0xffffffff;
- else if( dv<0 )
- v = 0;
- else
- v = _Step*m_Val.m_UInt32.m_Step + v;
- if( vm_Val.m_UInt32.m_Max )
- v = m_Val.m_UInt32.m_Max;
- if( m_Ptr!=NULL )
- *((unsigned int *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_FLOAT:
- {
- float v = 0;
- if( m_Ptr!=NULL )
- v = *((float *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- v += _Step*m_Val.m_Float32.m_Step;
- if( vm_Val.m_Float32.m_Max )
- v = m_Val.m_Float32.m_Max;
- if( m_Ptr!=NULL )
- *((float *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- case TW_TYPE_DOUBLE:
- {
- double v = 0;
- if( m_Ptr!=NULL )
- v = *((double *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- v += _Step*m_Val.m_Float64.m_Step;
- if( vm_Val.m_Float64.m_Max )
- v = m_Val.m_Float64.m_Max;
- if( m_Ptr!=NULL )
- *((double *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- break;
- /*
- case TW_TYPE_ENUM8:
- {
- assert(_Step==1 || _Step==-1);
- unsigned char v = 0;
- if( m_Ptr!=NULL )
- v = *((unsigned char *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- if( m_Val.m_Enum.m_Entries!=NULL )
- {
- UVal::CEnumVal::CEntries::iterator It = m_Val.m_Enum.m_Entries->find(v);
- if( It==m_Val.m_Enum.m_Entries->end() )
- It = m_Val.m_Enum.m_Entries->begin();
- else if( _Step==1 )
- {
- ++It;
- if( It==m_Val.m_Enum.m_Entries->end() )
- It = m_Val.m_Enum.m_Entries->begin();
- }
- else if( _Step==-1 )
- {
- if( It==m_Val.m_Enum.m_Entries->begin() )
- It = m_Val.m_Enum.m_Entries->end();
- if( It!=m_Val.m_Enum.m_Entries->begin() )
- --It;
- }
- if( It != m_Val.m_Enum.m_Entries->end() )
- {
- v = (unsigned char)(It->first);
- if( m_Ptr!=NULL )
- *((unsigned char *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- }
- }
- break;
- case TW_TYPE_ENUM16:
- {
- assert(_Step==1 || _Step==-1);
- unsigned short v = 0;
- if( m_Ptr!=NULL )
- v = *((unsigned short *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- if( m_Val.m_Enum.m_Entries!=NULL )
- {
- UVal::CEnumVal::CEntries::iterator It = m_Val.m_Enum.m_Entries->find(v);
- if( It==m_Val.m_Enum.m_Entries->end() )
- It = m_Val.m_Enum.m_Entries->begin();
- else if( _Step==1 )
- {
- ++It;
- if( It==m_Val.m_Enum.m_Entries->end() )
- It = m_Val.m_Enum.m_Entries->begin();
- }
- else if( _Step==-1 )
- {
- if( It==m_Val.m_Enum.m_Entries->begin() )
- It = m_Val.m_Enum.m_Entries->end();
- if( It!=m_Val.m_Enum.m_Entries->begin() )
- --It;
- }
- if( It != m_Val.m_Enum.m_Entries->end() )
- {
- v = (unsigned short)(It->first);
- if( m_Ptr!=NULL )
- *((unsigned short *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- }
- }
- break;
- case TW_TYPE_ENUM32:
- {
- assert(_Step==1 || _Step==-1);
- unsigned int v = 0;
- if( m_Ptr!=NULL )
- v = *((unsigned int *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- if( m_Val.m_Enum.m_Entries!=NULL )
- {
- UVal::CEnumVal::CEntries::iterator It = m_Val.m_Enum.m_Entries->find(v);
- if( It==m_Val.m_Enum.m_Entries->end() )
- It = m_Val.m_Enum.m_Entries->begin();
- else if( _Step==1 )
- {
- ++It;
- if( It==m_Val.m_Enum.m_Entries->end() )
- It = m_Val.m_Enum.m_Entries->begin();
- }
- else if( _Step==-1 )
- {
- if( It==m_Val.m_Enum.m_Entries->begin() )
- It = m_Val.m_Enum.m_Entries->end();
- if( It!=m_Val.m_Enum.m_Entries->begin() )
- --It;
- }
- if( It!=m_Val.m_Enum.m_Entries->end() )
- {
- v = (unsigned int)(It->first);
- if( m_Ptr!=NULL )
- *((unsigned int *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- }
- }
- break;
- */
- default:
- if( m_Type==TW_TYPE_BUTTON )
- {
- if( m_Val.m_Button.m_Callback!=NULL )
- {
- m_Val.m_Button.m_Callback(m_ClientData);
- if( g_TwMgr==NULL ) // Mgr might have been destroyed by the client inside a callback call
- return;
- }
- }
- else if( IsEnumType(m_Type) )
- {
- assert(_Step==1 || _Step==-1);
- unsigned int v = 0;
- if( m_Ptr!=NULL )
- v = *((unsigned int *)m_Ptr);
- else if( m_GetCallback!=NULL )
- m_GetCallback(&v, m_ClientData);
- CTwMgr::CEnum& e = g_TwMgr->m_Enums[m_Type-TW_TYPE_ENUM_BASE];
- CTwMgr::CEnum::CEntries::iterator It = e.m_Entries.find(v);
- if( It==e.m_Entries.end() )
- It = e.m_Entries.begin();
- else if( _Step==1 )
- {
- ++It;
- if( It==e.m_Entries.end() )
- It = e.m_Entries.begin();
- }
- else if( _Step==-1 )
- {
- if( It==e.m_Entries.begin() )
- It = e.m_Entries.end();
- if( It!=e.m_Entries.begin() )
- --It;
- }
- if( It!=e.m_Entries.end() )
- {
- v = (unsigned int)(It->first);
- if( m_Ptr!=NULL )
- *((unsigned int *)m_Ptr) = v;
- else if( m_SetCallback!=NULL )
- m_SetCallback(&v, m_ClientData);
- }
- }
- else
- fprintf(stderr, "CTwVarAtom::Increment : unknown or unimplemented type\n");
- }
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwVarAtom::SetDefaults()
-{
- switch( m_Type )
- {
- case TW_TYPE_BOOL8:
- case TW_TYPE_BOOL16:
- case TW_TYPE_BOOL32:
- case TW_TYPE_BOOLCPP:
- m_NoSlider = true;
- break;
- case TW_TYPE_CHAR:
- m_Val.m_Char.m_Max = 0xff;
- m_Val.m_Char.m_Min = 0;
- m_Val.m_Char.m_Step = 1;
- m_Val.m_Char.m_Precision = -1;
- m_Val.m_Char.m_Hexa = false;
- break;
- case TW_TYPE_INT8:
- m_Val.m_Int8.m_Max = 0x7f;
- m_Val.m_Int8.m_Min = -m_Val.m_Int8.m_Max-1;
- m_Val.m_Int8.m_Step = 1;
- m_Val.m_Int8.m_Precision = -1;
- m_Val.m_Int8.m_Hexa = false;
- break;
- case TW_TYPE_UINT8:
- m_Val.m_UInt8.m_Max = 0xff;
- m_Val.m_UInt8.m_Min = 0;
- m_Val.m_UInt8.m_Step = 1;
- m_Val.m_UInt8.m_Precision = -1;
- m_Val.m_UInt8.m_Hexa = false;
- break;
- case TW_TYPE_INT16:
- m_Val.m_Int16.m_Max = 0x7fff;
- m_Val.m_Int16.m_Min = -m_Val.m_Int16.m_Max-1;
- m_Val.m_Int16.m_Step = 1;
- m_Val.m_Int16.m_Precision = -1;
- m_Val.m_Int16.m_Hexa = false;
- break;
- case TW_TYPE_UINT16:
- m_Val.m_UInt16.m_Max = 0xffff;
- m_Val.m_UInt16.m_Min = 0;
- m_Val.m_UInt16.m_Step = 1;
- m_Val.m_UInt16.m_Precision = -1;
- m_Val.m_UInt16.m_Hexa = false;
- break;
- case TW_TYPE_INT32:
- m_Val.m_Int32.m_Max = 0x7fffffff;
- m_Val.m_Int32.m_Min = -m_Val.m_Int32.m_Max-1;
- m_Val.m_Int32.m_Step = 1;
- m_Val.m_Int32.m_Precision = -1;
- m_Val.m_Int32.m_Hexa = false;
- break;
- case TW_TYPE_UINT32:
- m_Val.m_UInt32.m_Max = 0xffffffff;
- m_Val.m_UInt32.m_Min = 0;
- m_Val.m_UInt32.m_Step = 1;
- m_Val.m_UInt32.m_Precision = -1;
- m_Val.m_UInt32.m_Hexa = false;
- break;
- case TW_TYPE_FLOAT:
- m_Val.m_Float32.m_Max = FLOAT_MAX;
- m_Val.m_Float32.m_Min = -FLOAT_MAX;
- m_Val.m_Float32.m_Step = 1;
- m_Val.m_Float32.m_Precision = -1;
- m_Val.m_Float32.m_Hexa = false;
- break;
- case TW_TYPE_DOUBLE:
- m_Val.m_Float64.m_Max = DOUBLE_MAX;
- m_Val.m_Float64.m_Min = -DOUBLE_MAX;
- m_Val.m_Float64.m_Step = 1;
- m_Val.m_Float64.m_Precision = -1;
- m_Val.m_Float64.m_Hexa = false;
- break;
- case TW_TYPE_CDSTRING:
- case TW_TYPE_STDSTRING:
- m_NoSlider = true;
- break;
- /*
- case TW_TYPE_ENUM8:
- case TW_TYPE_ENUM16:
- case TW_TYPE_ENUM32:
- m_NoSlider = true;
- break;
- */
- default:
- {} // nothing
- }
-
- // special types
- if( m_Type==TW_TYPE_BUTTON
- || IsEnumType(m_Type) // (m_Type>=TW_TYPE_ENUM_BASE && m_Typem_Enums.size())
- || IsCSStringType(m_Type) // (m_Type>=TW_TYPE_CSSTRING_BASE && m_Type<=TW_TYPE_CSSTRING_MAX)
- || m_Type==TW_TYPE_CDSTDSTRING
- || IsCustom() ) // (m_Type>=TW_TYPE_CUSTOM_BASE && m_Typem_Customs.size()) )
- m_NoSlider = true;
-}
-
-// ---------------------------------------------------------------------------
-
-/*
-int CTwVarAtom::DefineEnum(const TwEnumVal *_EnumValues, unsigned int _NbValues)
-{
- assert(_EnumValues!=NULL);
- if( m_Type!=TW_TYPE_ENUM8 && m_Type!=TW_TYPE_ENUM16 && m_Type!=TW_TYPE_ENUM32 )
- {
- g_TwMgr->SetLastError(g_ErrNotEnum);
- return 0;
- }
- if( m_Val.m_Enum.m_Entries==NULL )
- m_Val.m_Enum.m_Entries = new UVal::CEnumVal::CEntries;
- for(unsigned int i=0; i<_NbValues; ++i)
- {
- UVal::CEnumVal::CEntries::value_type Entry(_EnumValues[i].Value, (_EnumValues[i].Label!=NULL)?_EnumValues[i].Label:"");
- pair Result = m_Val.m_Enum.m_Entries->insert(Entry);
- if( !Result.second )
- (Result.first)->second = Entry.second;
- }
- return 1;
-}
-*/
-
-// ---------------------------------------------------------------------------
-
-enum EVarGroupAttribs
-{
- VG_OPEN = V_ENDTAG+1, // for backward compatibility
- VG_CLOSE, // for backward compatibility
- VG_OPENED,
- VG_TYPEID, // used internally for structs
- VG_VALPTR, // used internally for structs
- VG_ALPHA, // for backward compatibility
- VG_NOALPHA, // for backward compatibility
- VG_COLORALPHA, // tw_type_color* only
- VG_HLS, // for backward compatibility
- VG_RGB, // for backward compatibility
- VG_COLORMODE, // tw_type_color* only
- VG_COLORORDER, // tw_type_color* only
- VG_ARROW, // tw_type_quat* only
- VG_ARROWCOLOR, // tw_type_quat* only
- VG_AXISX, // tw_type_quat* only
- VG_AXISY, // tw_type_quat* only
- VG_AXISZ, // tw_type_quat* only
- VG_SHOWVAL // tw_type_quat* only
-};
-
-int CTwVarGroup::HasAttrib(const char *_Attrib, bool *_HasValue) const
-{
- *_HasValue = false;
- if( _stricmp(_Attrib, "open")==0 ) // for backward compatibility
- return VG_OPEN;
- else if( _stricmp(_Attrib, "close")==0 ) // for backward compatibility
- return VG_CLOSE;
- else if( _stricmp(_Attrib, "opened")==0 )
- {
- *_HasValue = true;
- return VG_OPENED;
- }
- else if( _stricmp(_Attrib, "typeid")==0 )
- {
- *_HasValue = true;
- return VG_TYPEID;
- }
- else if( _stricmp(_Attrib, "valptr")==0 )
- {
- *_HasValue = true;
- return VG_VALPTR;
- }
- else if( _stricmp(_Attrib, "alpha")==0 ) // for backward compatibility
- return VG_ALPHA;
- else if( _stricmp(_Attrib, "noalpha")==0 ) // for backward compatibility
- return VG_NOALPHA;
- else if( _stricmp(_Attrib, "coloralpha")==0 )
- {
- *_HasValue = true;
- return VG_COLORALPHA;
- }
- else if( _stricmp(_Attrib, "hls")==0 ) // for backward compatibility
- return VG_HLS;
- else if( _stricmp(_Attrib, "rgb")==0 ) // for backward compatibility
- return VG_RGB;
- else if( _stricmp(_Attrib, "colormode")==0 )
- {
- *_HasValue = true;
- return VG_COLORMODE;
- }
- else if( _stricmp(_Attrib, "colororder")==0 )
- {
- *_HasValue = true;
- return VG_COLORORDER;
- }
- else if( _stricmp(_Attrib, "arrow")==0 )
- {
- *_HasValue = true;
- return VG_ARROW;
- }
- else if( _stricmp(_Attrib, "arrowcolor")==0 )
- {
- *_HasValue = true;
- return VG_ARROWCOLOR;
- }
- else if( _stricmp(_Attrib, "axisx")==0 )
- {
- *_HasValue = true;
- return VG_AXISX;
- }
- else if( _stricmp(_Attrib, "axisy")==0 )
- {
- *_HasValue = true;
- return VG_AXISY;
- }
- else if( _stricmp(_Attrib, "axisz")==0 )
- {
- *_HasValue = true;
- return VG_AXISZ;
- }
- else if( _stricmp(_Attrib, "showval")==0 )
- {
- *_HasValue = true;
- return VG_SHOWVAL;
- }
-
- return CTwVar::HasAttrib(_Attrib, _HasValue);
-}
-
-int CTwVarGroup::SetAttrib(int _AttribID, const char *_Value, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex)
-{
- switch( _AttribID )
- {
- case VG_OPEN: // for backward compatibility
- if( !m_Open )
- {
- m_Open = true;
- _Bar->NotUpToDate();
- }
- return 1;
- case VG_CLOSE: // for backward compatibility
- if( m_Open )
- {
- m_Open = false;
- _Bar->NotUpToDate();
- }
- return 1;
- case VG_OPENED:
- if( _Value!=NULL && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "true")==0 || _stricmp(_Value, "1")==0 )
- {
- if( !m_Open )
- {
- m_Open = true;
- _Bar->NotUpToDate();
- }
- return 1;
- }
- else if( _stricmp(_Value, "false")==0 || _stricmp(_Value, "0")==0 )
- {
- if( m_Open )
- {
- m_Open = false;
- _Bar->NotUpToDate();
- }
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case VG_TYPEID:
- {
- int type = TW_TYPE_UNDEF;
- if( _Value!=NULL && sscanf(_Value, "%d", &type)==1 )
- {
- int idx = type - TW_TYPE_STRUCT_BASE;
- if( idx>=0 && idx<(int)g_TwMgr->m_Structs.size() )
- {
- m_SummaryCallback = g_TwMgr->m_Structs[idx].m_SummaryCallback;
- m_SummaryClientData = g_TwMgr->m_Structs[idx].m_SummaryClientData;
- m_StructType = (TwType)type;
- return 1;
- }
- }
- return 0;
- }
- case VG_VALPTR:
- {
- void *structValuePtr = NULL;
- if( _Value!=NULL && sscanf(_Value, "%p", &structValuePtr)==1 )
- {
- m_StructValuePtr = structValuePtr;
- m_ColorPtr = &(_Bar->m_ColStructText);
- return 1;
- }
- return 0;
- }
- case VG_ALPHA: // for backward compatibility
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- if( static_cast(m_StructValuePtr)->m_CanHaveAlpha )
- {
- static_cast(m_StructValuePtr)->m_HasAlpha = true;
- _Bar->NotUpToDate();
- return 1;
- }
- return 0;
- case VG_NOALPHA: // for backward compatibility
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- static_cast(m_StructValuePtr)->m_HasAlpha = false;
- _Bar->NotUpToDate();
- return 1;
- }
- else
- return 0;
- case VG_COLORALPHA:
- if( _Value!=NULL && strlen(_Value)>0 )
- {
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- if( _stricmp(_Value, "true")==0 || _stricmp(_Value, "1")==0 )
- {
- if( static_cast(m_StructValuePtr)->m_CanHaveAlpha )
- {
- if( !static_cast(m_StructValuePtr)->m_HasAlpha )
- {
- static_cast(m_StructValuePtr)->m_HasAlpha = true;
- _Bar->NotUpToDate();
- }
- return 1;
- }
- }
- else if( _stricmp(_Value, "false")==0 || _stricmp(_Value, "0")==0 )
- {
- if( static_cast(m_StructValuePtr)->m_HasAlpha )
- {
- static_cast(m_StructValuePtr)->m_HasAlpha = false;
- _Bar->NotUpToDate();
- }
- return 1;
- }
- }
- }
- return 0;
- case VG_HLS: // for backward compatibility
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- static_cast(m_StructValuePtr)->m_HLS = true;
- _Bar->NotUpToDate();
- return 1;
- }
- else
- return 0;
- case VG_RGB: // for backward compatibility
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- static_cast(m_StructValuePtr)->m_HLS = false;
- _Bar->NotUpToDate();
- return 1;
- }
- else
- return 0;
- case VG_COLORMODE:
- if( _Value!=NULL && strlen(_Value)>0 )
- {
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- if( _stricmp(_Value, "hls")==0 )
- {
- if( !static_cast(m_StructValuePtr)->m_HLS )
- {
- static_cast(m_StructValuePtr)->m_HLS = true;
- _Bar->NotUpToDate();
- }
- return 1;
- }
- else if( _stricmp(_Value, "rgb")==0 )
- {
- if( static_cast(m_StructValuePtr)->m_HLS )
- {
- static_cast(m_StructValuePtr)->m_HLS = false;
- _Bar->NotUpToDate();
- }
- return 1;
- }
- }
- }
- return 0;
- case VG_COLORORDER:
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- if( _Value!=NULL )
- {
- if( _stricmp(_Value, "rgba")==0 )
- static_cast(m_StructValuePtr)->m_OGL = true;
- else if( _stricmp(_Value, "argb")==0 )
- static_cast(m_StructValuePtr)->m_OGL = false;
- else
- return 0;
- return 1;
- }
- return 0;
- }
- else
- return 0;
- case VG_ARROW:
- if( m_SummaryCallback==CQuaternionExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_quat?
- {
- if( _Value!=NULL )
- {
- double *dir = static_cast(m_StructValuePtr)->m_Dir;
- double x, y, z;
- if( sscanf(_Value, "%lf %lf %lf", &x, &y, &z)==3 )
- {
- dir[0] = x;
- dir[1] = y;
- dir[2] = z;
- }
- else if( _stricmp(_Value, "off")==0 || _stricmp(_Value, "0")==0 )
- dir[0] = dir[1] = dir[2] = 0;
- else
- return 0;
- return 1;
- }
- return 0;
- }
- else
- return 0;
- case VG_ARROWCOLOR:
- if( m_SummaryCallback==CQuaternionExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_quat?
- {
- if( _Value!=NULL )
- {
- int r, g, b;
- if( sscanf(_Value, "%d %d %d", &r, &g, &b)==3 )
- static_cast(m_StructValuePtr)->m_DirColor = Color32FromARGBi(255, r, g, b);
- else
- return 0;
- return 1;
- }
- return 0;
- }
- else
- return 0;
- case VG_AXISX:
- case VG_AXISY:
- case VG_AXISZ:
- if( m_SummaryCallback==CQuaternionExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_quat?
- {
- if( _Value!=NULL )
- {
- float x = 0, y = 0, z = 0;
- if( _stricmp(_Value, "x")==0 || _stricmp(_Value, "+x")==0 )
- x = 1;
- else if( _stricmp(_Value, "-x")==0 )
- x = -1;
- else if( _stricmp(_Value, "y")==0 || _stricmp(_Value, "+y")==0 )
- y = 1;
- else if( _stricmp(_Value, "-y")==0 )
- y = -1;
- else if( _stricmp(_Value, "z")==0 || _stricmp(_Value, "+z")==0 )
- z = 1;
- else if( _stricmp(_Value, "-z")==0 )
- z = -1;
- else
- return 0;
- int i = (_AttribID==VG_AXISX) ? 0 : ((_AttribID==VG_AXISY) ? 1 : 2);
- static_cast(m_StructValuePtr)->m_Permute[i][0] = x;
- static_cast(m_StructValuePtr)->m_Permute[i][1] = y;
- static_cast(m_StructValuePtr)->m_Permute[i][2] = z;
- return 1;
- }
- return 0;
- }
- else
- return 0;
- case VG_SHOWVAL:
- if( m_SummaryCallback==CQuaternionExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_quat?
- {
- if( _Value!=NULL )
- {
- if( _stricmp(_Value, "true")==0 || _stricmp(_Value, "on")==0 || _stricmp(_Value, "1")==0 )
- {
- static_cast(m_StructValuePtr)->m_ShowVal = true;
- _Bar->NotUpToDate();
- return 1;
- }
- else if( _stricmp(_Value, "false")==0 || _stricmp(_Value, "off")==0 || _stricmp(_Value, "0")==0 )
- {
- static_cast(m_StructValuePtr)->m_ShowVal = false;
- _Bar->NotUpToDate();
- return 1;
- }
- }
- return 0;
- }
- else
- return 0;
- default:
- return CTwVar::SetAttrib(_AttribID, _Value, _Bar, _VarParent, _VarIndex);
- }
-}
-
-ERetType CTwVarGroup::GetAttrib(int _AttribID, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex, std::vector& outDoubles, std::ostringstream& outString) const
-{
- outDoubles.clear();
- outString.clear();
-
- switch( _AttribID )
- {
- case VG_OPENED:
- outDoubles.push_back( m_Open );
- return RET_DOUBLE;
- case VG_COLORALPHA:
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- outDoubles.push_back( static_cast(m_StructValuePtr)->m_HasAlpha );
- return RET_DOUBLE;
- }
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- case VG_COLORMODE:
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- if( static_cast(m_StructValuePtr)->m_HLS )
- outString << "hls";
- else
- outString << "rgb";
- return RET_STRING;
- }
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- case VG_COLORORDER:
- if( m_SummaryCallback==CColorExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_color?
- {
- if( static_cast(m_StructValuePtr)->m_OGL )
- outString << "rgba";
- else
- outString << "argb";
- return RET_STRING;
- }
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- case VG_ARROW:
- if( m_SummaryCallback==CQuaternionExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_quat?
- {
- double *dir = static_cast(m_StructValuePtr)->m_Dir;
- outDoubles.push_back(dir[0]);
- outDoubles.push_back(dir[1]);
- outDoubles.push_back(dir[2]);
- return RET_DOUBLE;
- }
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- case VG_ARROWCOLOR:
- if( m_SummaryCallback==CQuaternionExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_quat?
- {
- int a, r, g, b;
- a = r = g = b = 0;
- Color32ToARGBi(static_cast(m_StructValuePtr)->m_DirColor, &a, &r, &g, &b);
- outDoubles.push_back(r);
- outDoubles.push_back(g);
- outDoubles.push_back(b);
- return RET_DOUBLE;
- }
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- case VG_AXISX:
- case VG_AXISY:
- case VG_AXISZ:
- if( m_SummaryCallback==CQuaternionExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_quat?
- {
- int i = (_AttribID==VG_AXISX) ? 0 : ((_AttribID==VG_AXISY) ? 1 : 2);
- float x = static_cast(m_StructValuePtr)->m_Permute[i][0];
- float y = static_cast(m_StructValuePtr)->m_Permute[i][1];
- float z = static_cast(m_StructValuePtr)->m_Permute[i][2];
- if( x>0 )
- outString << "+x";
- else if( x<0 )
- outString << "-x";
- else if( y>0 )
- outString << "+y";
- else if( y<0 )
- outString << "-y";
- else if( z>0 )
- outString << "+z";
- else if( z<0 )
- outString << "-z";
- else
- outString << "0"; // should not happened
- return RET_DOUBLE;
- }
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- case VG_SHOWVAL:
- if( m_SummaryCallback==CQuaternionExt::SummaryCB && m_StructValuePtr!=NULL ) // is tw_type_quat?
- {
- outDoubles.push_back( static_cast(m_StructValuePtr)->m_ShowVal );
- return RET_DOUBLE;
- }
- g_TwMgr->SetLastError(g_ErrInvalidAttrib);
- return RET_ERROR;
- default:
- return CTwVar::GetAttrib(_AttribID, _Bar, _VarParent, _VarIndex, outDoubles, outString);
- }
-}
-
-// ---------------------------------------------------------------------------
-
-const CTwVar *CTwVarGroup::Find(const char *_Name, CTwVarGroup **_Parent, int *_Index) const
-{
- if( strcmp(_Name, m_Name.c_str())==0 )
- {
- if( _Parent!=NULL )
- *_Parent = NULL;
- if( _Index!=NULL )
- *_Index = -1;
- return this;
- }
- else
- {
- const CTwVar *v;
- for( size_t i=0; iFind(_Name, _Parent, _Index);
- if( v!=NULL )
- {
- if( _Parent!=NULL && *_Parent==NULL )
- {
- *_Parent = const_cast(this);
- if( _Index!=NULL )
- *_Index = (int)i;
- }
- return v;
- }
- }
- return NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-size_t CTwVar::GetDataSize(TwType _Type)
-{
- switch( _Type )
- {
- case TW_TYPE_BOOLCPP:
- return sizeof(bool);
- case TW_TYPE_BOOL8:
- case TW_TYPE_CHAR:
- case TW_TYPE_INT8:
- case TW_TYPE_UINT8:
- //case TW_TYPE_ENUM8:
- return 1;
- case TW_TYPE_BOOL16:
- case TW_TYPE_INT16:
- case TW_TYPE_UINT16:
- //case TW_TYPE_ENUM16:
- return 2;
- case TW_TYPE_BOOL32:
- case TW_TYPE_INT32:
- case TW_TYPE_UINT32:
- case TW_TYPE_FLOAT:
- //case TW_TYPE_ENUM32:
- return 4;
- case TW_TYPE_DOUBLE:
- return 8;
- case TW_TYPE_CDSTRING:
- return sizeof(char *);
- case TW_TYPE_STDSTRING:
- return (g_TwMgr!=0) ? g_TwMgr->m_ClientStdStringStructSize : sizeof(std::string);
- default:
- if( g_TwMgr && _Type>=TW_TYPE_STRUCT_BASE && _Typem_Structs.size() )
- {
- const CTwMgr::CStruct& s = g_TwMgr->m_Structs[_Type-TW_TYPE_STRUCT_BASE];
- return s.m_Size;
- /*
- size_t size = 0;
- for( size_t i=0; im_ClientStdStringStructSize : sizeof(std::string);
- else // includes TW_TYPE_BUTTON
- return 0;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-CTwBar::CTwBar(const char *_Name)
-{
- assert(g_TwMgr!=NULL && g_TwMgr->m_Graph!=NULL);
-
- m_Name = _Name;
- m_Visible = true;
- m_VarRoot.m_IsRoot = true;
- m_VarRoot.m_Open = true;
- m_VarRoot.m_SummaryCallback = NULL;
- m_VarRoot.m_SummaryClientData = NULL;
- m_VarRoot.m_StructValuePtr = NULL;
-
- m_UpToDate = false;
- int n = (int)g_TwMgr->m_Bars.size();
- m_PosX = 24*n-8;
- m_PosY = 24*n-8;
- m_Width = 200;
- m_Height = 320;
- int cr, cg, cb;
- if( g_TwMgr->m_UseOldColorScheme )
- {
- ColorHLSToRGBi(g_TwMgr->m_BarInitColorHue%256, 180, 200, &cr, &cg, &cb);
- m_Color = Color32FromARGBi(0xf0, cr, cg, cb);
- m_DarkText = true;
- }
- else
- {
- ColorHLSToRGBi(g_TwMgr->m_BarInitColorHue%256, 80, 200, &cr, &cg, &cb);
- m_Color = Color32FromARGBi(64, cr, cg, cb);
- m_DarkText = false;
- }
- g_TwMgr->m_BarInitColorHue -= 16;
- if( g_TwMgr->m_BarInitColorHue<0 )
- g_TwMgr->m_BarInitColorHue += 256;
- m_Font = g_TwMgr->m_CurrentFont;
- //m_Font = g_DefaultNormalFont;
- //m_Font = g_DefaultSmallFont;
- //m_Font = g_DefaultLargeFont;
- m_TitleWidth = 0;
- m_Sep = 1;
-//#pragma warning "lineSep WIP"
- m_LineSep = 1;
- m_ValuesWidth = 10*(m_Font->m_CharHeight/2); // about 10 characters
- m_NbHierLines = 0;
- m_NbDisplayedLines = 0;
- m_FirstLine = 0;
- m_LastUpdateTime = 0;
- m_UpdatePeriod = 2;
- m_ScrollYW = 0;
- m_ScrollYH = 0;
- m_ScrollY0 = 0;
- m_ScrollY1 = 0;
-
- m_DrawHandles = false;
- m_DrawIncrDecrBtn = false;
- m_DrawRotoBtn = false;
- m_DrawClickBtn = false;
- m_DrawListBtn = false;
- m_DrawBoolBtn = false;
- m_MouseDrag = false;
- m_MouseDragVar = false;
- m_MouseDragTitle = false;
- m_MouseDragScroll = false;
- m_MouseDragResizeUR = false;
- m_MouseDragResizeUL = false;
- m_MouseDragResizeLR = false;
- m_MouseDragResizeLL = false;
- m_MouseDragValWidth = false;
- m_MouseOriginX = 0;
- m_MouseOriginY = 0;
- m_ValuesWidthRatio = 0;
- m_VarHasBeenIncr = true;
- m_FirstLine0 = 0;
- m_HighlightedLine = -1;
- m_HighlightedLinePrev = -1;
- m_HighlightedLineLastValid = -1;
- m_HighlightIncrBtn = false;
- m_HighlightDecrBtn = false;
- m_HighlightRotoBtn = false;
- m_HighlightClickBtn = false;
- m_HighlightClickBtnAuto = 0;
- m_HighlightListBtn = false;
- m_HighlightBoolBtn = false;
- m_HighlightTitle = false;
- m_HighlightScroll = false;
- m_HighlightUpScroll = false;
- m_HighlightDnScroll = false;
- m_HighlightMinimize = false;
- m_HighlightFont = false;
- m_HighlightValWidth = false;
- m_HighlightLabelsHeader = false;
- m_HighlightValuesHeader = false;
- m_ButtonAlign = g_TwMgr->m_ButtonAlign;
-
- m_IsMinimized = false;
- m_MinNumber = 0;
- m_MinPosX = 0;
- m_MinPosY = 0;
- m_HighlightMaximize = false;
- m_IsHelpBar = false;
- m_IsPopupList = false;
- m_VarEnumLinkedToPopupList = NULL;
- m_BarLinkedToPopupList = NULL;
-
- m_Resizable = true;
- m_Movable = true;
- m_Iconifiable = true;
- m_Contained = g_TwMgr->m_Contained;
-
- m_TitleTextObj = g_TwMgr->m_Graph->NewTextObj();
- m_LabelsTextObj = g_TwMgr->m_Graph->NewTextObj();
- m_ValuesTextObj = g_TwMgr->m_Graph->NewTextObj();
- m_ShortcutTextObj = g_TwMgr->m_Graph->NewTextObj();
- m_HeadersTextObj = g_TwMgr->m_Graph->NewTextObj();
- m_ShortcutLine = -1;
-
- m_RotoMinRadius = 24;
- m_RotoNbSubdiv = 256; // number of steps for one turn
-
- m_CustomActiveStructProxy = NULL;
-
- UpdateColors();
- NotUpToDate();
-}
-
-// ---------------------------------------------------------------------------
-
-CTwBar::~CTwBar()
-{
- if( m_IsMinimized )
- g_TwMgr->Maximize(this);
- if( m_TitleTextObj )
- g_TwMgr->m_Graph->DeleteTextObj(m_TitleTextObj);
- if( m_LabelsTextObj )
- g_TwMgr->m_Graph->DeleteTextObj(m_LabelsTextObj);
- if( m_ValuesTextObj )
- g_TwMgr->m_Graph->DeleteTextObj(m_ValuesTextObj);
- if( m_ShortcutTextObj )
- g_TwMgr->m_Graph->DeleteTextObj(m_ShortcutTextObj);
- if( m_HeadersTextObj )
- g_TwMgr->m_Graph->DeleteTextObj(m_HeadersTextObj);
-}
-
-// ---------------------------------------------------------------------------
-
-const CTwVar *CTwBar::Find(const char *_Name, CTwVarGroup **_Parent, int *_Index) const
-{
- return m_VarRoot.Find(_Name, _Parent, _Index);
-}
-
-CTwVar *CTwBar::Find(const char *_Name, CTwVarGroup **_Parent, int *_Index)
-{
- return const_cast(const_cast(this)->Find(_Name, _Parent, _Index));
-}
-
-// ---------------------------------------------------------------------------
-
-enum EBarAttribs
-{
- BAR_LABEL = 1,
- BAR_HELP,
- BAR_COLOR,
- BAR_ALPHA,
- BAR_TEXT,
- BAR_SHOW, // deprecated, used BAR_VISIBLE instead
- BAR_HIDE, // deprecated, used BAR_VISIBLE instead
- BAR_ICONIFY, // deprecated, used BAR_ICONIFIED instead
- BAR_VISIBLE,
- BAR_ICONIFIED,
- BAR_SIZE,
- BAR_POSITION,
- BAR_REFRESH,
- BAR_FONT_SIZE,
- BAR_FONT_STYLE,
- BAR_VALUES_WIDTH,
- BAR_ICON_POS,
- BAR_ICON_ALIGN,
- BAR_ICON_MARGIN,
- BAR_RESIZABLE,
- BAR_MOVABLE,
- BAR_ICONIFIABLE,
- BAR_FONT_RESIZABLE,
- BAR_ALWAYS_TOP,
- BAR_ALWAYS_BOTTOM,
- BAR_COLOR_SCHEME,
- BAR_CONTAINED,
- BAR_BUTTON_ALIGN
-};
-
-int CTwBar::HasAttrib(const char *_Attrib, bool *_HasValue) const
-{
- *_HasValue = true;
- if( _stricmp(_Attrib, "label")==0 )
- return BAR_LABEL;
- else if( _stricmp(_Attrib, "help")==0 )
- return BAR_HELP;
- else if( _stricmp(_Attrib, "color")==0 )
- return BAR_COLOR;
- else if( _stricmp(_Attrib, "alpha")==0 )
- return BAR_ALPHA;
- else if( _stricmp(_Attrib, "text")==0 )
- return BAR_TEXT;
- else if( _stricmp(_Attrib, "size")==0 )
- return BAR_SIZE;
- else if( _stricmp(_Attrib, "position")==0 )
- return BAR_POSITION;
- else if( _stricmp(_Attrib, "refresh")==0 )
- return BAR_REFRESH;
- else if( _stricmp(_Attrib, "fontsize")==0 )
- return BAR_FONT_SIZE;
- else if( _stricmp(_Attrib, "fontstyle")==0 )
- return BAR_FONT_STYLE;
- else if( _stricmp(_Attrib, "valueswidth")==0 )
- return BAR_VALUES_WIDTH;
- else if( _stricmp(_Attrib, "iconpos")==0 )
- return BAR_ICON_POS;
- else if( _stricmp(_Attrib, "iconalign")==0 )
- return BAR_ICON_ALIGN;
- else if( _stricmp(_Attrib, "iconmargin")==0 )
- return BAR_ICON_MARGIN;
- else if( _stricmp(_Attrib, "resizable")==0 )
- return BAR_RESIZABLE;
- else if( _stricmp(_Attrib, "movable")==0 )
- return BAR_MOVABLE;
- else if( _stricmp(_Attrib, "iconifiable")==0 )
- return BAR_ICONIFIABLE;
- else if( _stricmp(_Attrib, "fontresizable")==0 )
- return BAR_FONT_RESIZABLE;
- else if( _stricmp(_Attrib, "alwaystop")==0 )
- return BAR_ALWAYS_TOP;
- else if( _stricmp(_Attrib, "alwaysbottom")==0 )
- return BAR_ALWAYS_BOTTOM;
- else if( _stricmp(_Attrib, "visible")==0 )
- return BAR_VISIBLE;
- else if( _stricmp(_Attrib, "iconified")==0 )
- return BAR_ICONIFIED;
- else if( _stricmp(_Attrib, "colorscheme")==0 )
- return BAR_COLOR_SCHEME;
- else if( _stricmp(_Attrib, "contained")==0 )
- return BAR_CONTAINED;
- else if( _stricmp(_Attrib, "buttonalign")==0 )
- return BAR_BUTTON_ALIGN;
-
- *_HasValue = false;
- if( _stricmp(_Attrib, "show")==0 ) // for backward compatibility
- return BAR_SHOW;
- else if( _stricmp(_Attrib, "hide")==0 ) // for backward compatibility
- return BAR_HIDE;
- else if( _stricmp(_Attrib, "iconify")==0 ) // for backward compatibility
- return BAR_ICONIFY;
-
- return 0; // not found
-}
-
-int CTwBar::SetAttrib(int _AttribID, const char *_Value)
-{
- switch( _AttribID )
- {
- case BAR_LABEL:
- if( _Value && strlen(_Value)>0 )
- {
- m_Label = _Value;
- NotUpToDate();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_HELP:
- if( _Value && strlen(_Value)>0 )
- {
- m_Help = _Value;
- NotUpToDate();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_COLOR:
- if( _Value && strlen(_Value)>0 )
- {
- int v0, v1, v2, v3;
- int n = sscanf(_Value, "%d%d%d%d", &v0, &v1, &v2, &v3);
- color32 c;
- int alpha = (m_Color>>24) & 0xff;
- if( n==3 && v0>=0 && v0<=255 && v1>=0 && v1<=255 && v2>=0 && v2<=255 )
- c = Color32FromARGBi(alpha, v0, v1, v2);
- else if( n==4 && v0>=0 && v0<=255 && v1>=0 && v1<=255 && v2>=0 && v2<=255 && v3>=0 && v3<=255 )
- c = Color32FromARGBi(v0, v1, v2, v3);
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- m_Color = c;
- NotUpToDate();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_ALPHA:
- if( _Value && strlen(_Value)>0 )
- {
- int alpha = 255;
- int n = sscanf(_Value, "%d", &alpha);
- if( n==1 && alpha>=0 && alpha<=255 )
- m_Color = (alpha<<24) | (m_Color & 0xffffff);
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- NotUpToDate();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_TEXT:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "dark")==0 )
- m_DarkText = true;
- else if( _stricmp(_Value, "light")==0 )
- m_DarkText = false;
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- NotUpToDate();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_SIZE:
- if( _Value && strlen(_Value)>0 )
- {
- int sx, sy;
- int n = sscanf(_Value, "%d%d", &sx, &sy);
- if( n==2 && sx>0 && sy>0 )
- {
- m_Width = sx;
- m_Height = sy;
- NotUpToDate();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_POSITION:
- if( _Value && strlen(_Value)>0 )
- {
- int x, y;
- int n = sscanf(_Value, "%d%d", &x, &y);
- if( n==2 && x>=0 && y>=0 )
- {
- m_PosX = x;
- m_PosY = y;
- NotUpToDate();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_REFRESH:
- if( _Value && strlen(_Value)>0 )
- {
- float r;
- int n = sscanf(_Value, "%f", &r);
- if( n==1 && r>=0 )
- {
- m_UpdatePeriod = r;
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_VALUES_WIDTH:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "fit")==0 )
- {
- m_ValuesWidth = VALUES_WIDTH_FIT;
- NotUpToDate();
- return 1;
- }
- else
- {
- int w;
- int n = sscanf(_Value, "%d", &w);
- if( n==1 && w>0 )
- {
- m_ValuesWidth = w;
- NotUpToDate();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_FONT_SIZE:
- return g_TwMgr->SetAttrib(MGR_FONT_SIZE, _Value);
- case BAR_FONT_STYLE:
- return g_TwMgr->SetAttrib(MGR_FONT_STYLE, _Value);
- case BAR_ICON_POS:
- return g_TwMgr->SetAttrib(MGR_ICON_POS, _Value);
- case BAR_ICON_ALIGN:
- return g_TwMgr->SetAttrib(MGR_ICON_ALIGN, _Value);
- case BAR_ICON_MARGIN:
- return g_TwMgr->SetAttrib(MGR_ICON_MARGIN, _Value);
- case BAR_SHOW: // deprecated
- TwSetBarState(this, TW_STATE_SHOWN);
- return 1;
- case BAR_HIDE: // deprecated
- TwSetBarState(this, TW_STATE_HIDDEN);
- return 1;
- case BAR_ICONIFY: // deprecated
- TwSetBarState(this, TW_STATE_ICONIFIED);
- return 1;
- case BAR_RESIZABLE:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "1")==0 || _stricmp(_Value, "true")==0 )
- {
- m_Resizable = true;
- return 1;
- }
- else if( _stricmp(_Value, "0")==0 || _stricmp(_Value, "false")==0 )
- {
- m_Resizable = false;
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_MOVABLE:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "1")==0 || _stricmp(_Value, "true")==0 )
- {
- m_Movable = true;
- return 1;
- }
- else if( _stricmp(_Value, "0")==0 || _stricmp(_Value, "false")==0 )
- {
- m_Movable = false;
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_ICONIFIABLE:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "1")==0 || _stricmp(_Value, "true")==0 )
- {
- m_Iconifiable = true;
- return 1;
- }
- else if( _stricmp(_Value, "0")==0 || _stricmp(_Value, "false")==0 )
- {
- m_Iconifiable = false;
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_FONT_RESIZABLE:
- return g_TwMgr->SetAttrib(MGR_FONT_RESIZABLE, _Value);
- case BAR_ALWAYS_TOP:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "1")==0 || _stricmp(_Value, "true")==0 )
- {
- g_TwMgr->m_BarAlwaysOnTop = m_Name;
- if( g_TwMgr->m_BarAlwaysOnBottom.length()>0 && strcmp(g_TwMgr->m_BarAlwaysOnBottom.c_str(), m_Name.c_str())==0 )
- g_TwMgr->m_BarAlwaysOnBottom.clear();
- TwSetTopBar(this);
- return 1;
- }
- else if( _stricmp(_Value, "0")==0 || _stricmp(_Value, "false")==0 )
- {
- if( g_TwMgr->m_BarAlwaysOnTop.length()>0 && strcmp(g_TwMgr->m_BarAlwaysOnTop.c_str(), m_Name.c_str())==0 )
- g_TwMgr->m_BarAlwaysOnTop.clear();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_ALWAYS_BOTTOM:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "1")==0 || _stricmp(_Value, "true")==0 )
- {
- g_TwMgr->m_BarAlwaysOnBottom = m_Name;
- if( g_TwMgr->m_BarAlwaysOnTop.length()>0 && strcmp(g_TwMgr->m_BarAlwaysOnTop.c_str(), m_Name.c_str())==0 )
- g_TwMgr->m_BarAlwaysOnTop.clear();
- TwSetBottomBar(this);
- return 1;
- }
- else if( _stricmp(_Value, "0")==0 || _stricmp(_Value, "false")==0 )
- {
- if( g_TwMgr->m_BarAlwaysOnBottom.length()>0 && strcmp(g_TwMgr->m_BarAlwaysOnBottom.c_str(), m_Name.c_str())==0 )
- g_TwMgr->m_BarAlwaysOnBottom.clear();
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_VISIBLE:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "1")==0 || _stricmp(_Value, "true")==0 )
- {
- TwSetBarState(this, TW_STATE_SHOWN);
- return 1;
- }
- else if( _stricmp(_Value, "0")==0 || _stricmp(_Value, "false")==0 )
- {
- TwSetBarState(this, TW_STATE_HIDDEN);
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_ICONIFIED:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "1")==0 || _stricmp(_Value, "true")==0 )
- {
- TwSetBarState(this, TW_STATE_ICONIFIED);
- return 1;
- }
- else if( _stricmp(_Value, "0")==0 || _stricmp(_Value, "false")==0 )
- {
- TwSetBarState(this, TW_STATE_UNICONIFIED);
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_COLOR_SCHEME:
- return g_TwMgr->SetAttrib(MGR_COLOR_SCHEME, _Value);
- case BAR_CONTAINED:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "1")==0 || _stricmp(_Value, "true")==0 )
- {
- m_Contained = true;
- return 1;
- }
- else if( _stricmp(_Value, "0")==0 || _stricmp(_Value, "false")==0 )
- {
- m_Contained = false;
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- case BAR_BUTTON_ALIGN:
- if( _Value && strlen(_Value)>0 )
- {
- if( _stricmp(_Value, "left")==0 )
- {
- m_ButtonAlign = BUTTON_ALIGN_LEFT;
- return 1;
- }
- else if( _stricmp(_Value, "center")==0 )
- {
- m_ButtonAlign = BUTTON_ALIGN_CENTER;
- return 1;
- }
- if( _stricmp(_Value, "right")==0 )
- {
- m_ButtonAlign = BUTTON_ALIGN_RIGHT;
- return 1;
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrBadValue);
- return 0;
- }
- }
- else
- {
- g_TwMgr->SetLastError(g_ErrNoValue);
- return 0;
- }
- default:
- g_TwMgr->SetLastError(g_ErrUnknownAttrib);
- return 0;
- }
-}
-
-ERetType CTwBar::GetAttrib(int _AttribID, std::vector& outDoubles, std::ostringstream& outString) const
-{
- outDoubles.clear();
- outString.clear();
-
- switch( _AttribID )
- {
- case BAR_LABEL:
- outString << m_Label;
- return RET_STRING;
- case BAR_HELP:
- outString << m_Help;
- return RET_STRING;
- case BAR_COLOR:
- {
- int a, r, g, b;
- a = r = g = b = 0;
- Color32ToARGBi(m_Color, &a, &r, &g, &b);
- outDoubles.push_back(r);
- outDoubles.push_back(g);
- outDoubles.push_back(b);
- return RET_DOUBLE;
- }
- case BAR_ALPHA:
- {
- int a, r, g, b;
- a = r = g = b = 0;
- Color32ToARGBi(m_Color, &a, &r, &g, &b);
- outDoubles.push_back(a);
- return RET_DOUBLE;
- }
- case BAR_TEXT:
- if( m_DarkText )
- outString << "dark";
- else
- outString << "light";
- return RET_STRING;
- case BAR_SIZE:
- outDoubles.push_back(m_Width);
- outDoubles.push_back(m_Height);
- return RET_DOUBLE;
- case BAR_POSITION:
- outDoubles.push_back(m_PosX);
- outDoubles.push_back(m_PosY);
- return RET_DOUBLE;
- case BAR_REFRESH:
- outDoubles.push_back(m_UpdatePeriod);
- return RET_DOUBLE;
- case BAR_VALUES_WIDTH:
- outDoubles.push_back(m_ValuesWidth);
- return RET_DOUBLE;
- case BAR_FONT_SIZE:
- return g_TwMgr->GetAttrib(MGR_FONT_SIZE, outDoubles, outString);
- case BAR_FONT_STYLE:
- return g_TwMgr->GetAttrib(MGR_FONT_STYLE, outDoubles, outString);
- case BAR_ICON_POS:
- return g_TwMgr->GetAttrib(MGR_ICON_POS, outDoubles, outString);
- case BAR_ICON_ALIGN:
- return g_TwMgr->GetAttrib(MGR_ICON_ALIGN, outDoubles, outString);
- case BAR_ICON_MARGIN:
- return g_TwMgr->GetAttrib(MGR_ICON_MARGIN, outDoubles, outString);
- case BAR_RESIZABLE:
- outDoubles.push_back(m_Resizable);
- return RET_DOUBLE;
- case BAR_MOVABLE:
- outDoubles.push_back(m_Movable);
- return RET_DOUBLE;
- case BAR_ICONIFIABLE:
- outDoubles.push_back(m_Iconifiable);
- return RET_DOUBLE;
- case BAR_FONT_RESIZABLE:
- return g_TwMgr->GetAttrib(MGR_FONT_RESIZABLE, outDoubles, outString);
- case BAR_ALWAYS_TOP:
- outDoubles.push_back( g_TwMgr->m_BarAlwaysOnTop == m_Name );
- return RET_DOUBLE;
- case BAR_ALWAYS_BOTTOM:
- outDoubles.push_back( g_TwMgr->m_BarAlwaysOnBottom == m_Name );
- return RET_DOUBLE;
- case BAR_VISIBLE:
- outDoubles.push_back(m_Visible);
- return RET_DOUBLE;
- case BAR_ICONIFIED:
- outDoubles.push_back(m_IsMinimized);
- return RET_DOUBLE;
- case BAR_COLOR_SCHEME:
- return g_TwMgr->GetAttrib(MGR_COLOR_SCHEME, outDoubles, outString);
- case BAR_CONTAINED:
- outDoubles.push_back(m_Contained);
- return RET_DOUBLE;
- case BAR_BUTTON_ALIGN:
- if( m_ButtonAlign==BUTTON_ALIGN_LEFT )
- outString << "left";
- else if( m_ButtonAlign==BUTTON_ALIGN_CENTER )
- outString << "center";
- else
- outString << "right";
- return RET_STRING;
- default:
- g_TwMgr->SetLastError(g_ErrUnknownAttrib);
- return RET_ERROR;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwBar::NotUpToDate()
-{
- m_UpToDate = false;
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwBar::UpdateColors()
-{
- float a, r, g, b, h, l, s;
- Color32ToARGBf(m_Color, &a, &r, &g, &b);
- ColorRGBToHLSf(r, g, b, &h, &l, &s);
- bool lightText = !m_DarkText;
-
- // Colors independant of m_Color
-
- // Highlighted line background ramp
- m_ColHighBg0 = lightText ? Color32FromARGBf(0.4f, 0.9f, 0.9f, 0.9f) : Color32FromARGBf(0.4f, 1.0f, 1.0f, 1.0f);
- m_ColHighBg1 = lightText ? Color32FromARGBf(0.4f, 0.2f, 0.2f, 0.2f) : Color32FromARGBf(0.1f, 0.7f, 0.7f, 0.7f);
-
- // Text colors & background
- m_ColLabelText = lightText ? COLOR32_WHITE : COLOR32_BLACK;
- m_ColStructText = lightText ? 0xffefef00 : 0xff303000;
-
- m_ColValText = lightText ? 0xffc7d7ff : 0xff000080;
- m_ColValTextRO = lightText ? 0xffb7b7b7 : 0xff505050;
- m_ColValMin = lightText ? 0xff9797ff : 0xff0000f0;
- m_ColValMax = m_ColValMin;
- m_ColValTextNE = lightText ? 0xff97f797 : 0xff004000;
-
- m_ColValBg = lightText ? Color32FromARGBf(0.2f+0.3f*a, 0.1f, 0.1f, 0.1f) : Color32FromARGBf(0.2f+0.3f*a, 1, 1, 1);
- m_ColStructBg = lightText ? Color32FromARGBf(0.4f*a, 0, 0, 0) : Color32FromARGBf(0.4f*a, 1, 1, 1);
-
- m_ColLine = lightText ? Color32FromARGBf(0.6f, 1, 1, 1) : Color32FromARGBf(0.6f, 0.3f, 0.3f, 0.3f);
- m_ColLineShadow = lightText ? Color32FromARGBf(0.6f, 0, 0, 0) : Color32FromARGBf(0.6f, 0, 0, 0);
- m_ColUnderline = lightText ? 0xffd0d0d0 : 0xff202000;
-
- m_ColGrpBg = lightText ? Color32FromARGBf(0.1f+0.25f*a, 1, 1, 1) : Color32FromARGBf(0.1f+0.05f*a, 0, 0, 0);
- m_ColGrpText = lightText ? 0xffffff80 : 0xff000000;
-
- m_ColShortcutText = lightText ? 0xffffb060 : 0xff802000;
- m_ColShortcutBg = lightText ? Color32FromARGBf(0.4f*a, 0.2f, 0.2f, 0.2f) : Color32FromARGBf(0.4f*a, 0.8f, 0.8f, 0.8f);
- m_ColInfoText = Color32FromARGBf(1.0f, 0.5f, 0.5f, 0.5f);
-
- m_ColRoto = lightText ? Color32FromARGBf(0.8f, 0.85f, 0.85f, 0.85f) : Color32FromARGBf(0.8f, 0.1f, 0.1f, 0.1f);
- m_ColRotoVal = Color32FromARGBf(1, 1.0f, 0.2f, 0.2f);
- m_ColRotoBound = lightText ? Color32FromARGBf(0.8f, 0.6f, 0.6f, 0.6f) : Color32FromARGBf(0.8f, 0.3f, 0.3f, 0.3f);
-
- m_ColEditText = lightText ? COLOR32_WHITE : COLOR32_BLACK;
- m_ColEditBg = lightText ? 0xff575757 : 0xffc7c7c7; // must be opaque
- m_ColEditSelText = lightText ? COLOR32_BLACK : COLOR32_WHITE;
- m_ColEditSelBg = lightText ? 0xffc7c7c7 : 0xff575757;
-
- // Colors dependant of m_Colors
-
- // Bar background
- ColorHLSToRGBf(h, l, s, &r, &g, &b);
- m_ColBg = Color32FromARGBf(a, r, g, b);
- ColorHLSToRGBf(h, l-0.05f, s, &r, &g, &b);
- m_ColBg1 = Color32FromARGBf(a, r, g, b);
- ColorHLSToRGBf(h, l-0.1f, s, &r, &g, &b);
- m_ColBg2 = Color32FromARGBf(a, r, g, b);
-
- ColorHLSToRGBf(h, l-0.15f, s, &r, &g, &b);
- m_ColTitleBg = Color32FromARGBf(a+0.9f, r, g, b);
- m_ColTitleText = lightText ? COLOR32_WHITE : COLOR32_BLACK;
- m_ColTitleShadow = lightText ? 0x40000000 : 0x00000000;
- ColorHLSToRGBf(h, l-0.25f, s, &r, &g, &b);
- m_ColTitleHighBg = Color32FromARGBf(a+0.8f, r, g, b);
- ColorHLSToRGBf(h, l-0.3f, s, &r, &g, &b);
- m_ColTitleUnactiveBg = Color32FromARGBf(a+0.2f, r, g, b);
-
- ColorHLSToRGBf(h, l-0.2f, s, &r, &g, &b);
- m_ColHierBg = Color32FromARGBf(a, r, g, b);
-
- ColorHLSToRGBf(h, l+0.1f, s, &r, &g, &b);
- m_ColBtn = Color32FromARGBf(0.2f+0.4f*a, r, g, b);
- ColorHLSToRGBf(h, l-0.35f, s, &r, &g, &b);
- m_ColHighBtn = Color32FromARGBf(0.4f+0.4f*a, r, g, b);
- ColorHLSToRGBf(h, l-0.25f, s, &r, &g, &b);
- m_ColFold = Color32FromARGBf(0.1f+0.4f*a, r, g, b);
- ColorHLSToRGBf(h, l-0.35f, s, &r, &g, &b);
- m_ColHighFold = Color32FromARGBf(0.3f+0.4f*a, r, g, b);
-
- ColorHLSToRGBf(h, 0.75f, s, &r, &g, &b);
- m_ColHelpBg = Color32FromARGBf(0.2f, 1, 1, 1);
- m_ColHelpText = lightText ? Color32FromARGBf(1, 0.2f, 1.0f, 0.2f) : Color32FromARGBf(1, 0, 0.4f, 0);
- m_ColSeparator = m_ColValTextRO;
- m_ColStaticText = m_ColHelpText;
-}
-
-/*
-void CTwBar::UpdateColors()
-{
- float a, r, g, b, h, l, s;
- Color32ToARGBf(m_Color, &a, &r, &g, &b);
- ColorRGBToHLSf(r, g, b, &h, &l, &s);
- bool lightText = !m_DarkText; // (l<=0.45f);
- l = 0.2f + 0.6f*l;
-
- ColorHLSToRGBf(h, l, s, &r, &g, &b);
- m_ColBg = Color32FromARGBf(a, r, g, b);
- ColorHLSToRGBf(h, l-0.1f, s, &r, &g, &b);
- m_ColBg1 = Color32FromARGBf(a, r, g, b);
- ColorHLSToRGBf(h, l-0.2f, s, &r, &g, &b);
- m_ColBg2 = Color32FromARGBf(a, r, g, b);
-
- ColorHLSToRGBf(h, l+0.1f, s, &r, &g, &b);
- m_ColHighBg = Color32FromARGBf(0.4f, r, g, b);
- //m_ColHighBg = Color32FromARGBf(a, 0.95f, 0.95f, 0.2f);
-
- m_ColLabelText = lightText ? COLOR32_WHITE : COLOR32_BLACK;
- m_ColStructText = lightText ? 0xffefef00 : 0xff505000;
-
- m_ColValText = lightText ? 0xffb7b7ff : 0xff000080;
- m_ColValTextRO = lightText ? 0xffb7b7b7 : 0xff505050;
- m_ColValMin = lightText ? 0xff9797ff : 0xff0000f0;
- m_ColValMax = m_ColValMin;
- m_ColValTextNE = lightText ? 0xff97f797 : 0xff006000;
-
- ColorHLSToRGBf(h, lightText ? (min(l+0.2f, 0.3f)) : (max(l-0.2f, 0.6f)), s, &r, &g, &b);
- m_ColValBg = Color32FromARGBf(0.4f*a, 0, 0, 0);
- m_ColStructBg = Color32FromARGBf(0.4f*a, 0, 0, 0);
-
- ColorHLSToRGBf(h, 0.4f, s, &r, &g, &b);
- m_ColTitleBg = Color32FromARGBf(a+0.4f, r, g, b);
- m_ColTitleText = lightText ? COLOR32_WHITE : COLOR32_BLACK;
- m_ColTitleShadow = lightText ? 0x80000000 : 0x80ffffff;
- ColorHLSToRGBf(h, 0.3f, s, &r, &g, &b);
- m_ColTitleHighBg = Color32FromARGBf(a+0.4f, r, g, b);
- ColorHLSToRGBf(h, 0.4f, s, &r, &g, &b);
- m_ColTitleUnactiveBg = Color32FromARGBf(a+0.2f, r, g, b);
-
- ColorHLSToRGBf(h, 0.8f, s, &r, &g, &b);
- m_ColLine = Color32FromARGBf(0.6f, r, g, b); // 0xfff0f0f0;
- m_ColLineShadow = Color32FromARGBf(0.6f, 0, 0, 0); //COLOR32_BLACK;
- m_ColUnderline = lightText ? 0xffd0d0d0 : 0xff202000;
- ColorHLSToRGBf(h, 0.7f, s, &r, &g, &b);
- m_ColBtn = Color32FromARGBf(0.6f, r, g, b);
- ColorHLSToRGBf(h, 0.4f, s, &r, &g, &b);
- m_ColHighBtn = Color32FromARGBf(0.6f, r, g, b);
- ColorHLSToRGBf(h, 0.6f, s, &r, &g, &b);
- m_ColFold = Color32FromARGBf(0.3f*a, r, g, b);
- ColorHLSToRGBf(h, 0.4f, s, &r, &g, &b);
- m_ColHighFold = Color32FromARGBf(0.3f, r, g, b);
-
- ColorHLSToRGBf(h, lightText ? l+0.2f : l-0.2f, s, &r, &g, &b);
- m_ColGrpBg = Color32FromARGBf(0.5f*a, r, g, b);
- m_ColGrpText = lightText ? 0xffffff80 : 0xff404000;
-
- ColorHLSToRGBf(h, 0.75f, s, &r, &g, &b);
- m_ColHelpBg = Color32FromARGBf(a, r, g, b);
- m_ColHelpText = Color32FromARGBf(1, 0, 0.4f, 0);
-
- ColorHLSToRGBf(h, 0.45f, s, &r, &g, &b);
- m_ColHierBg = Color32FromARGBf(0.75f*a, r, g, b);
-
- m_ColShortcutText = lightText ? 0xffff8040 : 0xff802000; //0xfff0f0f0;
- m_ColShortcutBg = Color32FromARGBf(0.4f*a, 0.2f, 0.2f, 0.2f);
- m_ColInfoText = Color32FromARGBf(1.0f, 0.7f, 0.7f, 0.7f);
-
- m_ColRoto = Color32FromARGBf(1, 0.75f, 0.75f, 0.75f);
- m_ColRotoVal = Color32FromARGBf(1, 1.0f, 0.2f, 0.2f);
- m_ColRotoBound = Color32FromARGBf(1, 0.4f, 0.4f, 0.4f);
-
- m_ColEditText = lightText ? COLOR32_WHITE : COLOR32_BLACK;
- m_ColEditBg = lightText ? 0xb7575757 : 0xb7c7c7c7;
- m_ColEditSelText = lightText ? COLOR32_BLACK : COLOR32_WHITE;
- m_ColEditSelBg = lightText ? 0xffc7c7c7 : 0xff575757;
-
- m_ColSeparator = m_ColValTextRO;
- m_ColStaticText = m_ColHelpText;
-}
-*/
-
-// ---------------------------------------------------------------------------
-
-CTwVarGroup::~CTwVarGroup()
-{
- for( vector::iterator it= m_Vars.begin(); it!=m_Vars.end(); ++it )
- if( *it != NULL )
- {
- CTwVar *Var = *it;
- delete Var;
- *it = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-static inline int IncrBtnWidth(int _CharHeight)
-{
- return ((2*_CharHeight)/3+2)&0xfffe; // force even value
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwBar::BrowseHierarchy(int *_CurrLine, int _CurrLevel, const CTwVar *_Var, int _First, int _Last)
-{
- assert(_Var!=NULL);
- if( !_Var->m_IsRoot )
- {
- if( (*_CurrLine)>=_First && (*_CurrLine)<=_Last )
- {
- CHierTag Tag;
- Tag.m_Level = _CurrLevel;
- Tag.m_Var = const_cast(_Var);
- Tag.m_Closing = false;
- m_HierTags.push_back(Tag);
- }
- *_CurrLine += 1;
- }
- else
- {
- *_CurrLine = 0;
- _CurrLevel = -1;
- m_HierTags.resize(0);
- }
-
- if( _Var->IsGroup() )
- {
- const CTwVarGroup *Grp = static_cast(_Var);
- if( Grp->m_Open )
- for( vector::const_iterator it=Grp->m_Vars.begin(); it!=Grp->m_Vars.end(); ++it )
- if( (*it)->m_Visible )
- BrowseHierarchy(_CurrLine, _CurrLevel+1, *it, _First, _Last);
- if( m_HierTags.size()>0 )
- m_HierTags[m_HierTags.size()-1].m_Closing = true;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwBar::ListLabels(vector& _Labels, vector& _Colors, vector& _BgColors, bool *_HasBgColors, const CTexFont *_Font, int _AtomWidthMax, int _GroupWidthMax)
-{
- const int NbEtc = 2;
- string ValStr;
- int Len, i, x, Etc, s;
- const unsigned char *Text;
- unsigned char ch;
- int WidthMax;
-
- int Space = _Font->m_CharWidth[(int)' '];
- int LevelSpace = max(_Font->m_CharHeight-6, 4); // space used by DrawHierHandles
-
- int nh = (int)m_HierTags.size();
- for( int h=0; hm_Label.length();
- if( Len>0 )
- Text = (const unsigned char *)(m_HierTags[h].m_Var->m_Label.c_str());
- else
- {
- Text = (const unsigned char *)(m_HierTags[h].m_Var->m_Name.c_str());
- Len = (int)m_HierTags[h].m_Var->m_Name.length();
- }
- x = 0;
- Etc = 0;
- _Labels.push_back(""); // add a new text line
- if( !m_HierTags[h].m_Var->IsGroup() && static_cast(m_HierTags[h].m_Var)->m_Type==TW_TYPE_BUTTON && static_cast(m_HierTags[h].m_Var)->m_ReadOnly && static_cast(m_HierTags[h].m_Var)->m_Val.m_Button.m_Callback!=NULL )
- _Colors.push_back(m_ColValTextRO); // special case for read-only buttons
- else
- _Colors.push_back(m_HierTags[h].m_Var->m_ColorPtr!=NULL ? *(m_HierTags[h].m_Var->m_ColorPtr) : COLOR32_WHITE);
- color32 bg = m_HierTags[h].m_Var->m_BgColorPtr!=NULL ? *(m_HierTags[h].m_Var->m_BgColorPtr) : 0;
- _BgColors.push_back(bg);
- if( _HasBgColors!=NULL && bg!=0 )
- *_HasBgColors = true;
- bool IsCustom = m_HierTags[h].m_Var->IsCustom(); // !m_HierTags[h].m_Var->IsGroup() && (static_cast(m_HierTags[h].m_Var)->m_Type>=TW_TYPE_CUSTOM_BASE && static_cast(m_HierTags[h].m_Var)->m_Typem_Customs.size());
- if( !IsCustom )
- {
- string& CurrentLabel = _Labels[_Labels.size()-1];
- if( m_HierTags[h].m_Var->IsGroup() && static_cast(m_HierTags[h].m_Var)->m_SummaryCallback==NULL )
- WidthMax = _GroupWidthMax;
- else if( !m_HierTags[h].m_Var->IsGroup() && static_cast(m_HierTags[h].m_Var)->m_Type==TW_TYPE_BUTTON )
- {
- if( static_cast(m_HierTags[h].m_Var)->m_Val.m_Button.m_Callback==NULL )
- WidthMax = _GroupWidthMax;
- else if( m_ButtonAlign == BUTTON_ALIGN_RIGHT )
- WidthMax = _GroupWidthMax - 2*IncrBtnWidth(m_Font->m_CharHeight);
- else
- WidthMax = _AtomWidthMax;
- }
- //else if( m_HighlightedLine==h && m_DrawRotoBtn )
- // WidthMax = _AtomWidthMax - IncrBtnWidth(m_Font->m_CharHeight);
- else
- WidthMax = _AtomWidthMax;
- if( Space>0 )
- for( s=0; sm_CharWidth[(int)'.']m_DontClip)
- for( i=0; im_CharWidth[(int)ch];
- if( Etc>0 )
- {
- ++Etc;
- if( Etc>NbEtc )
- break;
- }
- else if( im_CharWidth[(int)'.']>=WidthMax && !(m_HierTags[h].m_Var->m_DontClip))
- Etc = 1;
- }
- }
- }
-}
-
-// ---------------------------------------------------------------------------
-
-void CTwBar::ListValues(vector& _Values, vector& _Colors, vector& _BgColors, const CTexFont *_Font, int _WidthMax)
-{
- CTwFPU fpu; // force fpu precision
-
- const int NbEtc = 2;
- const CTwVarAtom *Atom = NULL;
- string ValStr;
- int Len, i, x, Etc;
- const unsigned char *Text;
- unsigned char ch;
- bool ReadOnly;
- bool IsMax;
- bool IsMin;
- bool IsROText;
- bool HasBgColor;
- bool AcceptEdit;
- size_t SummaryMaxLength = max(_WidthMax/_Font->m_CharWidth[(int)'I'], 4);
- static vector Summary;
- Summary.resize(SummaryMaxLength+32);
-
- int nh = (int)m_HierTags.size();
- for( int h=0; hIsGroup() || m_IsHelpBar
- || (m_HierTags[h].m_Var->IsGroup() && static_cast(m_HierTags[h].m_Var)->m_SummaryCallback!=NULL) )
- {
- ReadOnly = true;
- IsMax = false;
- IsMin = false;
- IsROText = false;
- HasBgColor = true;
- AcceptEdit = false;
- if( !m_HierTags[h].m_Var->IsGroup() )
- {
- Atom = static_cast(m_HierTags[h].m_Var);
- Atom->ValueToString(&ValStr);
- if( !m_IsHelpBar || (Atom->m_Type==TW_TYPE_SHORTCUT && (Atom->m_Val.m_Shortcut.m_Incr[0]>0 || Atom->m_Val.m_Shortcut.m_Decr[0]>0)) )
- ReadOnly = Atom->m_ReadOnly;
- if( !Atom->m_NoSlider )
- {
- double v, vmin, vmax;
- v = Atom->ValueToDouble();
- Atom->MinMaxStepToDouble(&vmin, &vmax, NULL);
- IsMax = (v>=vmax);
- IsMin = (v<=vmin);
- }
- if( Atom->m_Type==TW_TYPE_BOOLCPP || Atom->m_Type==TW_TYPE_BOOL8 || Atom->m_Type==TW_TYPE_BOOL16 || Atom->m_Type==TW_TYPE_BOOL32 )
- {
- if (ValStr=="1")
- ValStr = "\x7f"; // check sign
- else if (ValStr=="0")
- ValStr = " -"; //"\x97"; // uncheck sign
- }
- if( (Atom->m_Type==TW_TYPE_CDSTRING && Atom->m_SetCallback==NULL && g_TwMgr->m_CopyCDStringToClient==NULL)
- || (Atom->m_Type==TW_TYPE_CDSTDSTRING && Atom->m_SetCallback==NULL)
- || (Atom->m_Type==TW_TYPE_STDSTRING && Atom->m_SetCallback==NULL && g_TwMgr->m_CopyStdStringToClient==NULL) )
- IsROText = true;
- if( Atom->m_Type==TW_TYPE_HELP_ATOM || Atom->m_Type==TW_TYPE_HELP_GRP || Atom->m_Type==TW_TYPE_BUTTON || Atom->IsCustom() ) // (Atom->m_Type>=TW_TYPE_CUSTOM_BASE && Atom->m_Typem_Customs.size()) )
- HasBgColor = false;
- AcceptEdit = EditInPlaceAcceptVar(Atom) || (Atom->m_Type==TW_TYPE_SHORTCUT);
- }
- else if(m_HierTags[h].m_Var->IsGroup() && static_cast(m_HierTags[h].m_Var)->m_SummaryCallback!=NULL)
- {
- const CTwVarGroup *Grp = static_cast(m_HierTags[h].m_Var);
- // force internal value update
- for( size_t v=0; vm_Vars.size(); v++ )
- if( Grp->m_Vars[v]!=NULL && !Grp->m_Vars[v]->IsGroup() && Grp->m_Vars[v]->m_Visible )
- static_cast(Grp->m_Vars[v])->ValueToDouble();
-
- Summary[0] = '\0';
- if( Grp->m_SummaryCallback==CTwMgr::CStruct::DefaultSummary )
- Grp->m_SummaryCallback(&Summary[0], SummaryMaxLength, Grp, Grp->m_SummaryClientData);
- else
- Grp->m_SummaryCallback(&Summary[0], SummaryMaxLength, Grp->m_StructValuePtr, Grp->m_SummaryClientData);
- ValStr = (const char *)(&Summary[0]);
- }
- else
- {
- ValStr = ""; // is a group in the help bar
- HasBgColor = false;
- }
- Len = (int)ValStr.length();
- Text = (const unsigned char *)(ValStr.c_str());
- x = 0;
- Etc = 0;
- _Values.push_back(""); // add a new text line
- if( ReadOnly || (IsMin && IsMax) || IsROText )
- _Colors.push_back(m_ColValTextRO);
- else if( IsMin )
- _Colors.push_back(m_ColValMin);
- else if( IsMax )
- _Colors.push_back(m_ColValMax);
- else if( !AcceptEdit )
- _Colors.push_back(m_ColValTextNE);
- else
- _Colors.push_back(m_ColValText);
- if( !HasBgColor )
- _BgColors.push_back(0x00000000);
- else if( m_HierTags[h].m_Var->IsGroup() )
- {
- const CTwVarGroup *Grp = static_cast(m_HierTags[h].m_Var);
- // if typecolor set bgcolor
- if( Grp->m_SummaryCallback==CColorExt::SummaryCB )
- _BgColors.push_back(0xff000000);
- else
- _BgColors.push_back(m_ColStructBg);
- }
- else
- _BgColors.push_back(m_ColValBg);
-
- string& CurrentValue = _Values[_Values.size()-1];
- int wmax = _WidthMax;
- if( m_HighlightedLine==h && m_DrawRotoBtn )
- wmax -= 3*IncrBtnWidth(m_Font->m_CharHeight);
- else if( m_HighlightedLine==h && m_DrawIncrDecrBtn )
- wmax -= 2*IncrBtnWidth(m_Font->m_CharHeight);
- else if( m_HighlightedLine==h && m_DrawListBtn )
- wmax -= 1*IncrBtnWidth(m_Font->m_CharHeight);
- else if( m_HighlightedLine==h && m_DrawBoolBtn )
- wmax -= 1*IncrBtnWidth(m_Font->m_CharHeight);
- for( i=0; i