commit 8e902224cf5eb69c2349b0d36dda45b1281e12c4 Author: rachelchu Date: Wed Oct 11 15:01:05 2017 +0200 template project, first version diff --git a/AntTweakBar/.gitignore b/AntTweakBar/.gitignore new file mode 100644 index 0000000..fbb1c81 --- /dev/null +++ b/AntTweakBar/.gitignore @@ -0,0 +1,28 @@ +*.[oa] +*~ +*.ncb +*.sdf +*.suo +*.user +*.asp +*.pch +/src/debug32 +/src/debug64 +/src/release32 +/src/release64 +/src/ipch +/examples/debug32 +/examples/debug64 +/examples/tmp +/examples/bin32/*.exe +/examples/bin32/*.out +/examples/bin32/AntTweakBar.dll +/examples/bin64/*.exe +/examples/bin64/*.out +/examples/bin64/AntTweakBar64.dll +lib/debug +lib/*.lib +lib/*.dll +lib/*.exp +lib/*.so +lib/*.so.* diff --git a/AntTweakBar/AntTweakBar_Doc.url b/AntTweakBar/AntTweakBar_Doc.url new file mode 100644 index 0000000..3c8bd45 --- /dev/null +++ b/AntTweakBar/AntTweakBar_Doc.url @@ -0,0 +1,7 @@ +[InternetShortcut] +URL=http://anttweakbar.sourceforge.net/doc +Modified=C043A0DCA0FFC801E7 +HotKey=0 +IDList= +[{000214A0-0000-0000-C000-000000000046}] +Prop3=19,2 diff --git a/AntTweakBar/ChangeLog.txt b/AntTweakBar/ChangeLog.txt new file mode 100644 index 0000000..e34167a --- /dev/null +++ b/AntTweakBar/ChangeLog.txt @@ -0,0 +1,226 @@ +--- 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/AntTweakBar/Clean.bat b/AntTweakBar/Clean.bat new file mode 100644 index 0000000..3e0196e --- /dev/null +++ b/AntTweakBar/Clean.bat @@ -0,0 +1,23 @@ +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/AntTweakBar/License.txt b/AntTweakBar/License.txt new file mode 100644 index 0000000..4f6d9ca --- /dev/null +++ b/AntTweakBar/License.txt @@ -0,0 +1,22 @@ +--- 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/AntTweakBar/Readme.txt b/AntTweakBar/Readme.txt new file mode 100644 index 0000000..7d555e8 --- /dev/null +++ b/AntTweakBar/Readme.txt @@ -0,0 +1,15 @@ +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/AntTweakBar/examples/Examples_VS2008.sln b/AntTweakBar/examples/Examples_VS2008.sln new file mode 100644 index 0000000..6f92d97 --- /dev/null +++ b/AntTweakBar/examples/Examples_VS2008.sln @@ -0,0 +1,123 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwCopyDLL", "TwCopyDLL.vcproj", "{AB180E0E-0EFA-4AD4-8F08-4492D144D963}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleGLFW", "TwSimpleGLFW.vcproj", "{29C096AF-172E-4A36-A1FE-E15B259D6834}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleGLUT", "TwSimpleGLUT.vcproj", "{CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleSDL", "TwSimpleSDL.vcproj", "{3B516919-D0DA-43CE-820E-8306368F605B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleDX9", "TwSimpleDX9.vcproj", "{6B414E54-701C-4ED3-9034-F5CD7BFC3451}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwAdvanced1", "TwAdvanced1.vcproj", "{008D1CEC-1586-4C89-B524-DF15D9605163}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwString", "TwString.vcproj", "{29C097AF-176E-4C36-A12E-E15B250D6835}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleDX10", "TwSimpleDX10.vcproj", "{6B412E54-70AC-40D3-903F-F5CD73FC3D51}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleDX11", "TwSimpleDX11.vcproj", "{6D417E54-50AC-40D3-913A-35CD73F93D51}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwDualGLUT", "TwDualGLUT.vcproj", "{DC6C7BF1-5AF3-295F-9385-C51E003A2856}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwGLCoreSDL", "TwGLCoreSDL.vcproj", "{3B5FCA22-D015-499E-8211-830ABC8F605B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleSFML", "TwSimpleSFML.vcproj", "{AA613E00-5339-4B87-9285-A53EFF3C9AB9}" +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 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug|Win32.ActiveCfg = Debug|Win32 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug|Win32.Build.0 = Debug|Win32 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug|x64.ActiveCfg = Debug|x64 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug|x64.Build.0 = Debug|x64 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release|Win32.ActiveCfg = Release|Win32 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release|Win32.Build.0 = Release|Win32 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release|x64.ActiveCfg = Release|x64 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release|x64.Build.0 = Release|x64 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug|Win32.ActiveCfg = Debug|Win32 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug|Win32.Build.0 = Debug|Win32 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug|x64.ActiveCfg = Debug|x64 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Release|Win32.ActiveCfg = Release|Win32 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Release|Win32.Build.0 = Release|Win32 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Release|x64.ActiveCfg = Release|x64 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug|Win32.ActiveCfg = Debug|Win32 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug|Win32.Build.0 = Debug|Win32 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug|x64.ActiveCfg = Debug|x64 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug|x64.Build.0 = Debug|x64 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release|Win32.ActiveCfg = Release|Win32 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release|Win32.Build.0 = Release|Win32 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release|x64.ActiveCfg = Release|x64 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release|x64.Build.0 = Release|x64 + {3B516919-D0DA-43CE-820E-8306368F605B}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B516919-D0DA-43CE-820E-8306368F605B}.Debug|Win32.Build.0 = Debug|Win32 + {3B516919-D0DA-43CE-820E-8306368F605B}.Debug|x64.ActiveCfg = Debug|x64 + {3B516919-D0DA-43CE-820E-8306368F605B}.Release|Win32.ActiveCfg = Release|Win32 + {3B516919-D0DA-43CE-820E-8306368F605B}.Release|Win32.Build.0 = Release|Win32 + {3B516919-D0DA-43CE-820E-8306368F605B}.Release|x64.ActiveCfg = Release|x64 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug|Win32.ActiveCfg = Debug|Win32 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug|Win32.Build.0 = Debug|Win32 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug|x64.ActiveCfg = Debug|x64 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug|x64.Build.0 = Debug|x64 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release|Win32.ActiveCfg = Release|Win32 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release|Win32.Build.0 = Release|Win32 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release|x64.ActiveCfg = Release|x64 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release|x64.Build.0 = Release|x64 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Debug|Win32.ActiveCfg = Debug|Win32 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Debug|Win32.Build.0 = Debug|Win32 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Debug|x64.ActiveCfg = Debug|x64 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Release|Win32.ActiveCfg = Release|Win32 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Release|Win32.Build.0 = Release|Win32 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Release|x64.ActiveCfg = Release|x64 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Debug|Win32.ActiveCfg = Debug|Win32 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Debug|Win32.Build.0 = Debug|Win32 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Debug|x64.ActiveCfg = Debug|x64 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Release|Win32.ActiveCfg = Release|Win32 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Release|Win32.Build.0 = Release|Win32 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Release|x64.ActiveCfg = Release|x64 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Debug|Win32.ActiveCfg = Debug|Win32 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Debug|Win32.Build.0 = Debug|Win32 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Debug|x64.ActiveCfg = Debug|x64 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Debug|x64.Build.0 = Debug|x64 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Release|Win32.ActiveCfg = Release|Win32 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Release|Win32.Build.0 = Release|Win32 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Release|x64.ActiveCfg = Release|x64 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Release|x64.Build.0 = Release|x64 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Debug|Win32.ActiveCfg = Debug|Win32 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Debug|Win32.Build.0 = Debug|Win32 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Debug|x64.ActiveCfg = Debug|x64 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Debug|x64.Build.0 = Debug|x64 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Release|Win32.ActiveCfg = Release|Win32 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Release|Win32.Build.0 = Release|Win32 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Release|x64.ActiveCfg = Release|x64 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Release|x64.Build.0 = Release|x64 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Debug|Win32.ActiveCfg = Debug|Win32 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Debug|Win32.Build.0 = Debug|Win32 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Debug|x64.ActiveCfg = Debug|x64 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Debug|x64.Build.0 = Debug|x64 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Release|Win32.ActiveCfg = Release|Win32 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Release|Win32.Build.0 = Release|Win32 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Release|x64.ActiveCfg = Release|x64 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Release|x64.Build.0 = Release|x64 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Debug|Win32.Build.0 = Debug|Win32 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Debug|x64.ActiveCfg = Debug|x64 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Release|Win32.ActiveCfg = Release|Win32 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Release|Win32.Build.0 = Release|Win32 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Release|x64.ActiveCfg = Release|x64 + {AA613E00-5339-4B87-9285-A53EFF3C9AB9}.Debug|Win32.ActiveCfg = Debug|Win32 + {AA613E00-5339-4B87-9285-A53EFF3C9AB9}.Debug|Win32.Build.0 = Debug|Win32 + {AA613E00-5339-4B87-9285-A53EFF3C9AB9}.Debug|x64.ActiveCfg = Debug|x64 + {AA613E00-5339-4B87-9285-A53EFF3C9AB9}.Release|Win32.ActiveCfg = Release|Win32 + {AA613E00-5339-4B87-9285-A53EFF3C9AB9}.Release|Win32.Build.0 = Release|Win32 + {AA613E00-5339-4B87-9285-A53EFF3C9AB9}.Release|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/AntTweakBar/examples/Examples_VS2012.sln b/AntTweakBar/examples/Examples_VS2012.sln new file mode 100644 index 0000000..61ed394 --- /dev/null +++ b/AntTweakBar/examples/Examples_VS2012.sln @@ -0,0 +1,115 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 2012 for Windows Desktop +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwCopyDLL", "TwCopyDLL.vcxproj", "{AB180E0E-0EFA-4AD4-8F08-4492D144D963}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleGLFW", "TwSimpleGLFW.vcxproj", "{29C096AF-172E-4A36-A1FE-E15B259D6834}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleGLUT", "TwSimpleGLUT.vcxproj", "{CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleSDL", "TwSimpleSDL.vcxproj", "{3B516919-D0DA-43CE-820E-8306368F605B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleDX9", "TwSimpleDX9.vcxproj", "{6B414E54-701C-4ED3-9034-F5CD7BFC3451}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwAdvanced1", "TwAdvanced1.vcxproj", "{008D1CEC-1586-4C89-B524-DF15D9605163}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwString", "TwString.vcxproj", "{29C097AF-176E-4C36-A12E-E15B250D6835}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleDX10", "TwSimpleDX10.vcxproj", "{6B412E54-70AC-40D3-903F-F5CD73FC3D51}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleDX11", "TwSimpleDX11.vcxproj", "{6D417E54-50AC-40D3-913A-35CD73F93D51}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwDualGLUT", "TwDualGLUT.vcxproj", "{DC6C7BF1-5AF3-295F-9385-C51E003A2856}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwGLCoreSDL", "TwGLCoreSDL.vcxproj", "{3B5FCA22-D015-499E-8211-830ABC8F605B}" +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 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug|Win32.ActiveCfg = Debug|Win32 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug|Win32.Build.0 = Debug|Win32 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug|x64.ActiveCfg = Debug|x64 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug|x64.Build.0 = Debug|x64 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release|Win32.ActiveCfg = Release|Win32 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release|Win32.Build.0 = Release|Win32 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release|x64.ActiveCfg = Release|x64 + {AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release|x64.Build.0 = Release|x64 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug|Win32.ActiveCfg = Debug|Win32 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug|Win32.Build.0 = Debug|Win32 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug|x64.ActiveCfg = Debug|x64 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Release|Win32.ActiveCfg = Release|Win32 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Release|Win32.Build.0 = Release|Win32 + {29C096AF-172E-4A36-A1FE-E15B259D6834}.Release|x64.ActiveCfg = Release|x64 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug|Win32.ActiveCfg = Debug|Win32 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug|Win32.Build.0 = Debug|Win32 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug|x64.ActiveCfg = Debug|x64 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug|x64.Build.0 = Debug|x64 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release|Win32.ActiveCfg = Release|Win32 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release|Win32.Build.0 = Release|Win32 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release|x64.ActiveCfg = Release|x64 + {CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release|x64.Build.0 = Release|x64 + {3B516919-D0DA-43CE-820E-8306368F605B}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B516919-D0DA-43CE-820E-8306368F605B}.Debug|Win32.Build.0 = Debug|Win32 + {3B516919-D0DA-43CE-820E-8306368F605B}.Debug|x64.ActiveCfg = Debug|x64 + {3B516919-D0DA-43CE-820E-8306368F605B}.Release|Win32.ActiveCfg = Release|Win32 + {3B516919-D0DA-43CE-820E-8306368F605B}.Release|Win32.Build.0 = Release|Win32 + {3B516919-D0DA-43CE-820E-8306368F605B}.Release|x64.ActiveCfg = Release|x64 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug|Win32.ActiveCfg = Debug|Win32 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug|Win32.Build.0 = Debug|Win32 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug|x64.ActiveCfg = Debug|x64 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug|x64.Build.0 = Debug|x64 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release|Win32.ActiveCfg = Release|Win32 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release|Win32.Build.0 = Release|Win32 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release|x64.ActiveCfg = Release|x64 + {6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release|x64.Build.0 = Release|x64 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Debug|Win32.ActiveCfg = Debug|Win32 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Debug|Win32.Build.0 = Debug|Win32 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Debug|x64.ActiveCfg = Debug|x64 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Release|Win32.ActiveCfg = Release|Win32 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Release|Win32.Build.0 = Release|Win32 + {008D1CEC-1586-4C89-B524-DF15D9605163}.Release|x64.ActiveCfg = Release|x64 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Debug|Win32.ActiveCfg = Debug|Win32 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Debug|Win32.Build.0 = Debug|Win32 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Debug|x64.ActiveCfg = Debug|x64 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Release|Win32.ActiveCfg = Release|Win32 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Release|Win32.Build.0 = Release|Win32 + {29C097AF-176E-4C36-A12E-E15B250D6835}.Release|x64.ActiveCfg = Release|x64 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Debug|Win32.ActiveCfg = Debug|Win32 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Debug|Win32.Build.0 = Debug|Win32 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Debug|x64.ActiveCfg = Debug|x64 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Debug|x64.Build.0 = Debug|x64 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Release|Win32.ActiveCfg = Release|Win32 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Release|Win32.Build.0 = Release|Win32 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Release|x64.ActiveCfg = Release|x64 + {6B412E54-70AC-40D3-903F-F5CD73FC3D51}.Release|x64.Build.0 = Release|x64 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Debug|Win32.ActiveCfg = Debug|Win32 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Debug|Win32.Build.0 = Debug|Win32 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Debug|x64.ActiveCfg = Debug|x64 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Debug|x64.Build.0 = Debug|x64 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Release|Win32.ActiveCfg = Release|Win32 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Release|Win32.Build.0 = Release|Win32 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Release|x64.ActiveCfg = Release|x64 + {6D417E54-50AC-40D3-913A-35CD73F93D51}.Release|x64.Build.0 = Release|x64 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Debug|Win32.ActiveCfg = Debug|Win32 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Debug|Win32.Build.0 = Debug|Win32 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Debug|x64.ActiveCfg = Debug|x64 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Debug|x64.Build.0 = Debug|x64 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Release|Win32.ActiveCfg = Release|Win32 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Release|Win32.Build.0 = Release|Win32 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Release|x64.ActiveCfg = Release|x64 + {DC6C7BF1-5AF3-295F-9385-C51E003A2856}.Release|x64.Build.0 = Release|x64 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Debug|Win32.Build.0 = Debug|Win32 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Debug|x64.ActiveCfg = Debug|x64 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Release|Win32.ActiveCfg = Release|Win32 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Release|Win32.Build.0 = Release|Win32 + {3B5FCA22-D015-499E-8211-830ABC8F605B}.Release|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/AntTweakBar/examples/Makefile b/AntTweakBar/examples/Makefile new file mode 100644 index 0000000..f60d414 --- /dev/null +++ b/AntTweakBar/examples/Makefile @@ -0,0 +1,104 @@ +####### 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 + + +CXX = g++ +CXXFLAGS = $(CXXCFG) -Wall -fno-strict-aliasing +INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include +LIBS = -L/usr/X11R6/lib -lAntTweakBar -lGL -lGLU -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' + +####### 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) TwSimpleGLUT.c $(LFLAGS) -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) TwSimpleSDL.c $(LFLAGS) -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) TwSimpleGLFW.c $(LFLAGS) -lglfw $(LIBS) -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) 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) 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) 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/AntTweakBar/examples/Makefile.osx b/AntTweakBar/examples/Makefile.osx new file mode 100644 index 0000000..260ca6d --- /dev/null +++ b/AntTweakBar/examples/Makefile.osx @@ -0,0 +1,100 @@ +####### 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/AntTweakBar/examples/Readme.txt b/AntTweakBar/examples/Readme.txt new file mode 100644 index 0000000..64362ef --- /dev/null +++ b/AntTweakBar/examples/Readme.txt @@ -0,0 +1,26 @@ +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/AntTweakBar/examples/SDL-1.3.lib b/AntTweakBar/examples/SDL-1.3.lib new file mode 100644 index 0000000..004e075 Binary files /dev/null and b/AntTweakBar/examples/SDL-1.3.lib differ diff --git a/AntTweakBar/examples/SDL.lib b/AntTweakBar/examples/SDL.lib new file mode 100644 index 0000000..131fb1c Binary files /dev/null and b/AntTweakBar/examples/SDL.lib differ diff --git a/AntTweakBar/examples/TwAdvanced1.cpp b/AntTweakBar/examples/TwAdvanced1.cpp new file mode 100644 index 0000000..6d12cfb --- /dev/null +++ b/AntTweakBar/examples/TwAdvanced1.cpp @@ -0,0 +1,737 @@ +// --------------------------------------------------------------------------- +// +// @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