diff --git a/Demos/OpenGL/CommandLineArguments.h b/Demos/OpenGL/CommandLineArguments.h new file mode 100644 index 000000000..4c11c4b01 --- /dev/null +++ b/Demos/OpenGL/CommandLineArguments.h @@ -0,0 +1,112 @@ +/****************************************************************************** + * Copyright 2010 Duane Merrill + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * For more information, see our Google Code project site: + * http://code.google.com/p/back40computing/ + * + * Thanks! + ******************************************************************************/ + +#ifndef COMMAND_LINE_ARGS_H +#define COMMAND_LINE_ARGS_H + +/****************************************************************************** + * Command-line parsing + ******************************************************************************/ +#include +#include +#include +#include +class CommandLineArguments +{ +protected: + + std::map pairs; + +public: + + // Constructor + CommandLineArguments(int argc, char **argv) + { + using namespace std; + + for (int i = 1; i < argc; i++) + { + string arg = argv[i]; + + if ((arg[0] != '-') || (arg[1] != '-')) { + continue; + } + + string::size_type pos; + string key, val; + if ((pos = arg.find( '=')) == string::npos) { + key = string(arg, 2, arg.length() - 2); + val = ""; + } else { + key = string(arg, 2, pos - 2); + val = string(arg, pos + 1, arg.length() - 1); + } + pairs[key] = val; + } + } + + bool CheckCmdLineFlag(const char* arg_name) + { + using namespace std; + map::iterator itr; + if ((itr = pairs.find(arg_name)) != pairs.end()) { + return true; + } + return false; + } + + template + void GetCmdLineArgument(const char *arg_name, T &val); + + int ParsedArgc() + { + return pairs.size(); + } +}; + +template +void CommandLineArguments::GetCmdLineArgument(const char *arg_name, T &val) +{ + using namespace std; + map::iterator itr; + if ((itr = pairs.find(arg_name)) != pairs.end()) { + istringstream strstream(itr->second); + strstream >> val; + } +} + +template <> +void CommandLineArguments::GetCmdLineArgument(const char* arg_name, char* &val) +{ + using namespace std; + map::iterator itr; + if ((itr = pairs.find(arg_name)) != pairs.end()) { + + string s = itr->second; + val = (char*) malloc(sizeof(char) * (s.length() + 1)); + strcpy(val, s.c_str()); + + } else { + val = NULL; + } +} + +#endif //COMMAND_LINE_ARGS_H diff --git a/Demos/SerializeDemo/SerializeDemo.cpp b/Demos/SerializeDemo/SerializeDemo.cpp index 403c335c8..3862dd20e 100644 --- a/Demos/SerializeDemo/SerializeDemo.cpp +++ b/Demos/SerializeDemo/SerializeDemo.cpp @@ -732,7 +732,13 @@ public: }; #endif //DESERIALIZE_SOFT_BODIES +SerializeDemo::SerializeDemo() +:m_verboseMode(0), +m_fileName("testFile.bullet") +{ + m_idle=true; +} SerializeDemo::~SerializeDemo() { m_fileLoader->deleteAllData(); @@ -743,7 +749,7 @@ SerializeDemo::~SerializeDemo() void SerializeDemo::initPhysics() { setTexturing(true); - setShadows(true); + setShadows(false);//true); setCameraDistance(btScalar(SCALING*30.)); @@ -755,7 +761,7 @@ void SerializeDemo::initPhysics() m_fileLoader = new btBulletWorldImporter(m_dynamicsWorld); #endif //DESERIALIZE_SOFT_BODIES - //m_fileLoader->setVerboseMode(bParse::FD_VERBOSE_EXPORT_XML); + m_fileLoader->setVerboseMode(m_verboseMode); diff --git a/Demos/SerializeDemo/SerializeDemo.h b/Demos/SerializeDemo/SerializeDemo.h index 42cc4e9eb..560ef8085 100644 --- a/Demos/SerializeDemo/SerializeDemo.h +++ b/Demos/SerializeDemo/SerializeDemo.h @@ -50,12 +50,12 @@ class SerializeDemo : public PlatformDemoApplication btDefaultCollisionConfiguration* m_collisionConfiguration; class btBulletWorldImporter* m_fileLoader; + const char* m_fileName; + int m_verboseMode; public: - SerializeDemo() - { - } + SerializeDemo(); virtual ~SerializeDemo(); void initPhysics(); @@ -70,6 +70,24 @@ class SerializeDemo : public PlatformDemoApplication virtual void displayCallback(); + void setFileName(const char* name) + { + m_fileName = name; + } + const char* getFileName() const + { + return m_fileName; + } + + void setVerboseMode(int mode) + { + m_verboseMode = mode; + } + int getVerboseMode() const + { + return m_verboseMode; + } + static DemoApplication* Create() { SerializeDemo* demo = new SerializeDemo; diff --git a/Demos/SerializeDemo/main.cpp b/Demos/SerializeDemo/main.cpp index cd5914718..87b88f8f0 100644 --- a/Demos/SerializeDemo/main.cpp +++ b/Demos/SerializeDemo/main.cpp @@ -18,7 +18,8 @@ subject to the following restrictions: #include "GLDebugDrawer.h" #include "btBulletDynamicsCommon.h" #include "LinearMath/btHashMap.h" - +#include "btBulletFile.h" +#include "CommandLineArguments.h" #ifdef USE_AMD_OPENCL @@ -84,6 +85,22 @@ bool initCL( void* glCtx, void* glDC ) int main(int argc,char** argv) { + CommandLineArguments arg(argc,argv); + char* filename=0; + arg.GetCmdLineArgument("filename", filename); + bool dumpXml = arg.CheckCmdLineFlag("dump_xml"); + if (!dumpXml && !filename) + { + printf("There are some optional commandline arguments for this demo:\n"); + printf("Load another .bullet file instead of testFile.bullet:\n"); + printf("--filename=testfile.bullet\n"); + printf("Dump the imported .bullet file to XML\n"); + printf("--dump_xml\n"); + + } + + + GLDebugDrawer gDebugDrawer; #ifdef USE_AMD_OPENCL @@ -93,6 +110,14 @@ int main(int argc,char** argv) SerializeDemo serializeDemo; + + int mode = 0; + if (dumpXml) + mode |=bParse::FD_VERBOSE_EXPORT_XML; + if (filename) + serializeDemo.setFileName(filename); + serializeDemo.setVerboseMode(mode); + serializeDemo.initPhysics(); serializeDemo.getDynamicsWorld()->setDebugDrawer(&gDebugDrawer); diff --git a/Extras/CDTestFramework/AntTweakBar/ChangeLog.txt b/Extras/CDTestFramework/AntTweakBar/ChangeLog.txt index 3277df751..a4ca26182 100644 --- a/Extras/CDTestFramework/AntTweakBar/ChangeLog.txt +++ b/Extras/CDTestFramework/AntTweakBar/ChangeLog.txt @@ -1,23 +1,208 @@ ---- AntTweakBar library changes --- +--- AntTweakBar library release notes --- -- Version 1.04 - OpenGL: Vertex buffer object state and Vertex/fragment program and object states are now reset and restored by TwDraw (thanks to Dylan and Siva for pointing this out). +* Version 1.15 (2012/07/22) -- Version 1.03 (2006/10/28) - Medium font is now antialiased. - Now also compiles on 64 bits x86 platform; use Makefile.x86_64 (thanks to Herling). - Slight changes to avoid visual 8 secure crt warnings. - Correct behaviour if min/max values are not defined. - Modif to avoid looping to max value when reaching zero with unsigned types. - Min/max/step commands for type TW_TYPE_CHAR now read ascii codes (not characters). - Add FPU precision control (because DirectX changes it). - Fix problem that occurs when the lib is initialized/unitialized more than once (thanks Lukasz for reporting it). - Distribution follows Savannah's recommendations. + - 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.02 (2006/09/27) - Library sources released. +* Version 1.14 (2011/03/26) -- Version 1.01 (2006/09/14) - First official release. + - 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 rewritting 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://www.antisphere.com/Wiki/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/Extras/CDTestFramework/AntTweakBar/Clean.bat b/Extras/CDTestFramework/AntTweakBar/Clean.bat index 34d2a4f51..06d91863e 100644 --- a/Extras/CDTestFramework/AntTweakBar/Clean.bat +++ b/Extras/CDTestFramework/AntTweakBar/Clean.bat @@ -1,13 +1,18 @@ -RMDIR /S /Q src\debug -RMDIR /S /Q src\release +RMDIR /S /Q src\debug32 +RMDIR /S /Q src\debug64 +RMDIR /S /Q src\release32 +RMDIR /S /Q src\release64 CD src -DEL *.ncb *.aps *.o *.bak +DEL *.ncb *.aps *.o *.bak *.user DEL /A:h *.suo CD .. RMDIR /S /Q lib\debug -RMDIR /S /Q examples\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 +DEL *.ncb *.aps *.o *.bak *.user DEL /A:h *.suo DEL /S BuildLog.htm DEL bin\*.obj diff --git a/Extras/CDTestFramework/AntTweakBar/License.txt b/Extras/CDTestFramework/AntTweakBar/License.txt index 0e3f29370..f9ce6ffef 100644 --- a/Extras/CDTestFramework/AntTweakBar/License.txt +++ b/Extras/CDTestFramework/AntTweakBar/License.txt @@ -1,18 +1,19 @@ ---- AntTweakBar license --- +--- AntTweakBar license --- -Copyright 2005, 2006 Philippe Decaudin +Copyright (C) 2005-2012 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. +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: +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. +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. diff --git a/Extras/CDTestFramework/AntTweakBar/Readme.txt b/Extras/CDTestFramework/AntTweakBar/Readme.txt index 87c46cb9b..19ab5ba38 100644 --- a/Extras/CDTestFramework/AntTweakBar/Readme.txt +++ b/Extras/CDTestFramework/AntTweakBar/Readme.txt @@ -3,13 +3,13 @@ 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 them. +graphic programs to interactively tweak parameters. This package includes the development version of the AntTweakBar library -for GNU/Linux and Windows, + some program examples (sources + binaries). +for Windows, GNU/Linux and OSX, and some program examples (sources + binaries). For installation and documentation please refer to: http://www.antisphere.com/Wiki/tools:anttweakbar -Philippe Decaudin - http://www.antisphere.com - 2006/05/20 +Philippe Decaudin - http://www.antisphere.com diff --git a/Extras/CDTestFramework/AntTweakBar/examples/Examples.ncb b/Extras/CDTestFramework/AntTweakBar/examples/Examples.ncb deleted file mode 100644 index 57e218451..000000000 Binary files a/Extras/CDTestFramework/AntTweakBar/examples/Examples.ncb and /dev/null differ diff --git a/Extras/CDTestFramework/AntTweakBar/examples/Examples.sln b/Extras/CDTestFramework/AntTweakBar/examples/Examples.sln deleted file mode 100644 index 728596ecc..000000000 --- a/Extras/CDTestFramework/AntTweakBar/examples/Examples.sln +++ /dev/null @@ -1,65 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwCopyDLL", "TwCopyDLL.vcproj", "{AB180E0E-0EFA-4AD4-8F08-4492D144D963}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleGLFW", "TwSimpleGLFW.vcproj", "{29C096AF-172E-4A36-A1FE-E15B259D6834}" - ProjectSection(ProjectDependencies) = postProject - {AB180E0E-0EFA-4AD4-8F08-4492D144D963} = {AB180E0E-0EFA-4AD4-8F08-4492D144D963} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleGLUT", "TwSimpleGLUT.vcproj", "{CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}" - ProjectSection(ProjectDependencies) = postProject - {AB180E0E-0EFA-4AD4-8F08-4492D144D963} = {AB180E0E-0EFA-4AD4-8F08-4492D144D963} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleSDL", "TwSimpleSDL.vcproj", "{3B516919-D0DA-43CE-820E-8306368F605B}" - ProjectSection(ProjectDependencies) = postProject - {AB180E0E-0EFA-4AD4-8F08-4492D144D963} = {AB180E0E-0EFA-4AD4-8F08-4492D144D963} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleDX9", "TwSimpleDX9.vcproj", "{6B414E54-701C-4ED3-9034-F5CD7BFC3451}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwAdvanced1", "TwAdvanced1.vcproj", "{008D1CEC-1586-4C89-B524-DF15D9605163}" - ProjectSection(ProjectDependencies) = postProject - {AB180E0E-0EFA-4AD4-8F08-4492D144D963} = {AB180E0E-0EFA-4AD4-8F08-4492D144D963} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug.ActiveCfg = Debug|Win32 - {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug.Build.0 = Debug|Win32 - {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release.ActiveCfg = Release|Win32 - {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release.Build.0 = Release|Win32 - {29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug.ActiveCfg = Debug|Win32 - {29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug.Build.0 = Debug|Win32 - {29C096AF-172E-4A36-A1FE-E15B259D6834}.Release.ActiveCfg = Release|Win32 - {29C096AF-172E-4A36-A1FE-E15B259D6834}.Release.Build.0 = Release|Win32 - {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug.ActiveCfg = Debug|Win32 - {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug.Build.0 = Debug|Win32 - {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release.ActiveCfg = Release|Win32 - {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release.Build.0 = Release|Win32 - {3B516919-D0DA-43CE-820E-8306368F605B}.Debug.ActiveCfg = Debug|Win32 - {3B516919-D0DA-43CE-820E-8306368F605B}.Debug.Build.0 = Debug|Win32 - {3B516919-D0DA-43CE-820E-8306368F605B}.Release.ActiveCfg = Release|Win32 - {3B516919-D0DA-43CE-820E-8306368F605B}.Release.Build.0 = Release|Win32 - {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug.ActiveCfg = Debug|Win32 - {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug.Build.0 = Debug|Win32 - {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release.ActiveCfg = Release|Win32 - {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release.Build.0 = Release|Win32 - {008D1CEC-1586-4C89-B524-DF15D9605163}.Debug.ActiveCfg = Debug|Win32 - {008D1CEC-1586-4C89-B524-DF15D9605163}.Debug.Build.0 = Debug|Win32 - {008D1CEC-1586-4C89-B524-DF15D9605163}.Release.ActiveCfg = Release|Win32 - {008D1CEC-1586-4C89-B524-DF15D9605163}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/Extras/CDTestFramework/AntTweakBar/examples/Examples.suo b/Extras/CDTestFramework/AntTweakBar/examples/Examples.suo deleted file mode 100644 index 0a6131804..000000000 Binary files a/Extras/CDTestFramework/AntTweakBar/examples/Examples.suo and /dev/null differ diff --git a/Extras/CDTestFramework/AntTweakBar/examples/Makefile b/Extras/CDTestFramework/AntTweakBar/examples/Makefile deleted file mode 100644 index 46cda3eac..000000000 --- a/Extras/CDTestFramework/AntTweakBar/examples/Makefile +++ /dev/null @@ -1,80 +0,0 @@ -####### Compiler, tools and options - -#---- MinGW -#MINGWFLAGS = -mno-cygwin - - -#---- Release -CXXCFG = -O3 -LFLAGS = -L../lib -OUT_DIR = bin -#---- Debug -#CXXCFG = -g -D_DEBUG -#LFLAGS = -Wl -L../lib/debug -#OUT_DIR = debug - - -CXX = gcc -#CXXFLAGS = $(CXXCFG) $(MINGWFLAGS) -pipe -Wall -ffast-math -fPIC -fno-strength-reduce -mcpu=pentiumpro -march=i586 -CXXFLAGS = $(CXXCFG) -Wall -mcpu=i386 -march=i386 -INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include -LIBS = -L/usr/X11R6/lib -lAntTweakBar -lGL -lGLU -lX11 -lXxf86vm -lXext -lXmu -lpthread -lm - -DEL_FILE = rm -f -DEL_DIR = rmdir -NO_STDERR = 2> /dev/null -EXP_PATH = "export LD_LIBRARY_PATH=\"../../lib:$(LD_LIBRARY_PATH)\"" - - -####### Files - - -SRC_FILES = TwSimpleGLFW.c TwSimpleGLUT.c TwSimpleSDL.c TwAdvanced1.cpp - - -####### Build rules - - -#first: depend all -first: all - -all: Makefile $(SRC_FILES) - - @echo "===== Build TwSimpleGLFW ====" - $(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleGLFW.c $(LFLAGS) -lglfw $(LIBS) -o $(OUT_DIR)/TwSimpleGLFW.out - @echo "$(EXP_PATH) ; ./TwSimpleGLFW.out" > $(OUT_DIR)/TwSimpleGLFW - - @echo "===== Build TwSimpleGLUT ====" - $(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleGLUT.c $(LFLAGS) -lglut $(LIBS) -o $(OUT_DIR)/TwSimpleGLUT.out - @echo "$(EXP_PATH) ; ./TwSimpleGLUT.out" > $(OUT_DIR)/TwSimpleGLUT - - @echo "===== Build TwSimpleSDL ====" - $(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleSDL.c $(LFLAGS) -lSDL $(LIBS) -o $(OUT_DIR)/TwSimpleSDL.out - @echo "$(EXP_PATH) ; ./TwSimpleSDL.out" > $(OUT_DIR)/TwSimpleSDL - - @echo "===== Build TwAdvanced1 ====" - $(CXX) $(CXXFLAGS) $(INCPATH) TwAdvanced1.cpp $(LFLAGS) -lglfw $(LIBS) -o $(OUT_DIR)/TwAdvanced1.out - @echo "$(EXP_PATH) ; ./TwAdvanced1.out" > $(OUT_DIR)/TwAdvanced1 - -# 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) debug/* - -$(DEL_DIR) debug - - -####### DEPENDENCIES - -TwSimpleGLFW.o: ../include/AntTweakBar.h -TwSimpleGLUT.o: ../include/AntTweakBar.h -TwSimpleSDL.o: ../include/AntTweakBar.h -TwAdvanced1.o: ../include/AntTweakBar.h diff --git a/Extras/CDTestFramework/AntTweakBar/examples/Makefile.x86_64 b/Extras/CDTestFramework/AntTweakBar/examples/Makefile.x86_64 deleted file mode 100644 index 067e1bbe2..000000000 --- a/Extras/CDTestFramework/AntTweakBar/examples/Makefile.x86_64 +++ /dev/null @@ -1,82 +0,0 @@ -####### Compiler, tools and options - -#---- MinGW -#MINGWFLAGS = -mno-cygwin - - -#---- Release -CXXCFG = -O3 -LFLAGS = -L../lib -OUT_DIR = bin -#---- Debug -#CXXCFG = -g -D_DEBUG -#LFLAGS = -Wl -L./debug -#OUT_DIR = debug - - -CXX = gcc -#CXXFLAGS = $(CXXCFG) $(MINGWFLAGS) -pipe -Wall -ffast-math -fpic -fno-strength-reduce -mcpu=pentiumpro -march=i586 -#CXXFLAGS = $(CXXCFG) -Wall -mcpu=i386 -march=i386 -CXXFLAGS = $(CXXCFG) -Wall -INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include -#LIBS = -L/usr/X11R6/lib -lAntTweakBar -lGL -lGLU -lX11 -lXxf86vm -lXext -lXmu -lpthread -lm -LIBS = -L/usr/lib64 -lAntTweakBar -lglfw -lGL -lGLU -lX11 -lXxf86vm -lXext -lXmu -lpthread -lm - -DEL_FILE = rm -f -DEL_DIR = rmdir -NO_STDERR = 2> /dev/null -EXP_PATH = "export LD_LIBRARY_PATH=\"../../lib:$(LD_LIBRARY_PATH)\"" - - -####### Files - - -SRC_FILES = TwSimpleGLFW.c TwSimpleGLUT.c TwSimpleSDL.c TwAdvanced1.cpp - - -####### Build rules - - -#first: depend all -first: all - -all: Makefile $(SRC_FILES) - - @echo "===== Build TwSimpleGLFW ====" - $(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleGLFW.c $(LFLAGS) -lglfw $(LIBS) -o $(OUT_DIR)/TwSimpleGLFW.out - @echo "$(EXP_PATH) ; ./TwSimpleGLFW.out" > $(OUT_DIR)/TwSimpleGLFW - - @echo "===== Build TwSimpleGLUT ====" - $(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleGLUT.c $(LFLAGS) -lglut $(LIBS) -o $(OUT_DIR)/TwSimpleGLUT.out - @echo "$(EXP_PATH) ; ./TwSimpleGLUT.out" > $(OUT_DIR)/TwSimpleGLUT - - @echo "===== Build TwSimpleSDL ====" - $(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleSDL.c $(LFLAGS) -lSDL $(LIBS) -o $(OUT_DIR)/TwSimpleSDL.out - @echo "$(EXP_PATH) ; ./TwSimpleSDL.out" > $(OUT_DIR)/TwSimpleSDL - - @echo "===== Build TwAdvanced1 ====" - $(CXX) $(CXXFLAGS) $(INCPATH) TwAdvanced1.cpp $(LFLAGS) -lglfw $(LIBS) -o $(OUT_DIR)/TwAdvanced1.out - @echo "$(EXP_PATH) ; ./TwAdvanced1.out" > $(OUT_DIR)/TwAdvanced1 - -# 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) debug/* - -$(DEL_DIR) debug - - -####### DEPENDENCIES - -TwSimpleGLFW.o: ../include/AntTweakBar.h -TwSimpleGLUT.o: ../include/AntTweakBar.h -TwSimpleSDL.o: ../include/AntTweakBar.h -TwAdvanced1.o: ../include/AntTweakBar.h diff --git a/Extras/CDTestFramework/AntTweakBar/examples/TwAdvanced1.cpp b/Extras/CDTestFramework/AntTweakBar/examples/TwAdvanced1.cpp deleted file mode 100644 index 70e6ac58e..000000000 --- a/Extras/CDTestFramework/AntTweakBar/examples/TwAdvanced1.cpp +++ /dev/null @@ -1,693 +0,0 @@ -// --------------------------------------------------------------------------- -// -// @file TwAdvanced1.cpp -// @brief An example showing many features of AntTweakBar. -// It also uses OpenGL and GLFW windowing system -// but could be easily adapted to other frameworks. -// -// AntTweakBar: http://www.antisphere.com/Wiki/tools:anttweakbar -// OpenGL: http://www.opengl.org -// GLFW: http://glfw.sourceforge.net -// -// -// 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 - http://www.antisphere.com -// @date 2006/05/20 -// -// note: TAB=4 -// -// Compilation: -// http://www.antisphere.com/Wiki/tools:anttweakbar:examples#twadvanced1 -// -// --------------------------------------------------------------------------- - -#include - -#define GLFW_DLL // use GLFW as a dynamically linked library -#include "glfw.h" - -#include -#include -#ifndef _WIN32 -# define _snprintf snprintf -#endif -const float FLOAT_2PI = 6.283185307f; // 2*PI - - -// Light structure: embed 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 tesselate 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) - float 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)intialize the scene - void Draw(); // draw scene - void Update(float 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); - void DrawSubdivCylinderY(float xCenter, float yBottom, float zCenter, float height, float radiusBottom, float radiusTop, int sideSubdiv, int ySubdiv); - void DrawSubdivHaloZ(float x, float y, float z, float radius, int subdiv); - void DrawHalos(bool reflected); - - 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.6f; - BgColor1[1] = 0.6f; - BgColor1[2] = 0.6f; - Ambient = 0.3f; - 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 = maxLights/2; // default number of lights - if( NumLights==0 ) - NumLights = 1; - 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 - lightsBar = TwNewBar("Lights"); - TwDefine(" Lights label='Lights TweakBar' "); - - // 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 "); - // Set the NumLights min value (=0) and max value (depends on the user graphic card) - char def[256]; - _snprintf(def, 255, "Lights/NumLights min=0 max=%d", maxLights); - TwDefine(def); // min and max are defined using a defintion 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=RETURN "); - - // 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 embeded in this structure - TwStructMember lightMembers[] = // array used to describe tweakable variables of the Light structure - { - { "Active", TW_TYPE_BOOLCPP, offsetof(Light, Active), "" }, // Light::Active is a C++ boolean value - { "Color", TW_TYPE_COLOR4F, offsetof(Light, Color), "noalpha" }, // 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" }, - { "Animation", modeType, offsetof(Light, Animation), "" }, // use the enum 'modeType' created before to tweak the Light::Animation variable - { "Speed", TW_TYPE_FLOAT, offsetof(Light, Speed0), "readonly" } // 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