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