Commit 824b8404 authored by Sylvain Thery's avatar Sylvain Thery

Modification ThirdParty compilation

parent 3526329c
[InternetShortcut]
URL=http://www.antisphere.com/Wiki/tools:anttweakbar
Modified=C043A0DCA0FFC801E7
cmake_minimum_required(VERSION 2.6)
project(AntTweakBar)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
# specific mac
IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -fno-strict-aliasing -D_MACOSX -ObjC++ -D__PLACEMENT_NEW_INLINE")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall -fno-strict-aliasing -D_MACOSX")
set(PATHSDK "/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks")
include_directories(include/
${PATHSDK}/OpenGL.framework/Headers/
${PATHSDK}/GLUT.framework/Headers/
${PATHSDK}/AppKit.framework/Headers/ )
ELSE(APPLE)
IF(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -fno-strict-aliasing -D_UNIX -D__PLACEMENT_NEW_INLINE ")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall -fno-strict-aliasing -D_UNIX")
include_directories(include/)
ENDIF(UNIX)
ENDIF(APPLE)
file(
GLOB_RECURSE
source_files
TwColors.cpp TwFonts.cpp TwOpenGL.cpp TwBar.cpp TwMgr.cpp TwPrecomp.cpp LoadOGL.cpp
TwEventGLFW.c TwEventGLUT.c TwEventSDL.c)
add_library(
AntTweakBar
${source_files}
)
--- AntTweakBar license ---
Copyright © 2005-2009 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.
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.
http://www.antisphere.com
--- 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 them.
This package includes the development version of the AntTweakBar library
for GNU/Linux and Windows, + 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
// ----------------------------------------------------------------------------
//
// @file AntTweakBar.h
//
// @brief AntTweakBar is a light and intuitive graphical user interface
// that can be readily integrated into OpenGL and DirectX
// applications in order to interactively tweak them.
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2005/09/20
//
// @doc http://www.antisphere.com/Wiki/tools:anttweakbar
//
// @license This file is part of the AntTweakBar library.
// AntTweakBar is a free software released under the zlib license.
// For conditions of distribution and use, see License.txt
//
// ----------------------------------------------------------------------------
#if !defined TW_INCLUDED
#define TW_INCLUDED
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TW_VERSION 113 // Version Mmm : M=Major mm=minor (e.g., 102 is version 1.02)
#ifdef __cplusplus
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4995 4530)
# include <string>
# pragma warning(pop)
# else
# include <string>
# endif
extern "C" {
#endif // __cplusplus
// ----------------------------------------------------------------------------
// OS specific definitions
// ----------------------------------------------------------------------------
#if defined(_WIN32) || defined(_WIN64)
# define TW_CALL __stdcall
# define TW_EXPORT_API __declspec(dllexport)
# define TW_IMPORT_API __declspec(dllimport)
#else
# define TW_CALL
# define TW_EXPORT_API
# define TW_IMPORT_API
#endif
#if defined TW_EXPORTS
# define TW_API TW_EXPORT_API
#elif defined TW_STATIC
# define TW_API
# if defined(_MSC_VER) && !defined(TW_NO_LIB_PRAGMA)
# pragma comment(lib, "AntTweakBarStatic")
# endif
#else
# define TW_API TW_IMPORT_API
# if defined(_MSC_VER) && !defined(TW_NO_LIB_PRAGMA)
# pragma comment(lib, "AntTweakBar")
# endif
#endif
// ----------------------------------------------------------------------------
// Bar functions and definitions
// ----------------------------------------------------------------------------
typedef struct CTwBar TwBar; // structure CTwBar is not exposed.
TW_API TwBar * TW_CALL TwNewBar(const char *barName);
TW_API int TW_CALL TwDeleteBar(TwBar *bar);
TW_API int TW_CALL TwDeleteAllBars();
TW_API int TW_CALL TwSetTopBar(const TwBar *bar);
TW_API TwBar * TW_CALL TwGetTopBar();
TW_API int TW_CALL TwSetBottomBar(const TwBar *bar);
TW_API TwBar * TW_CALL TwGetBottomBar();
TW_API const char * TW_CALL TwGetBarName(TwBar *bar);
TW_API int TW_CALL TwGetBarCount();
TW_API TwBar * TW_CALL TwGetBarByIndex(int barIndex);
TW_API TwBar * TW_CALL TwGetBarByName(const char *barName);
TW_API int TW_CALL TwRefreshBar(TwBar *bar);
// ----------------------------------------------------------------------------
// Var functions and definitions
// ----------------------------------------------------------------------------
typedef enum ETwType
{
TW_TYPE_UNDEF = 0,
#ifdef __cplusplus
TW_TYPE_BOOLCPP = 1,
#endif // __cplusplus
TW_TYPE_BOOL8 = 2,
TW_TYPE_BOOL16,
TW_TYPE_BOOL32,
TW_TYPE_CHAR,
TW_TYPE_INT8,
TW_TYPE_UINT8,
TW_TYPE_INT16,
TW_TYPE_UINT16,
TW_TYPE_INT32,
TW_TYPE_UINT32,
TW_TYPE_FLOAT,
TW_TYPE_DOUBLE,
TW_TYPE_COLOR32, // 32 bits color. Order is RGBA if API is OpenGL or Direct3D10, and inversed if API is Direct3D9 (can be modified by defining 'colorOrder=...', see doc)
TW_TYPE_COLOR3F, // 3 floats color. Order is RGB.
TW_TYPE_COLOR4F, // 4 floats color. Order is RGBA.
TW_TYPE_CDSTRING, // Null-terminated C Dynamic String (pointer to an array of char dynamically allocated with malloc/realloc/strdup)
#ifdef __cplusplus
TW_TYPE_STDSTRING = (0x2fff0000+sizeof(std::string)), // C++ STL string (std::string)
#endif // __cplusplus
TW_TYPE_QUAT4F = TW_TYPE_CDSTRING+2, // 4 floats encoding a quaternion {qx,qy,qz,qs}
TW_TYPE_QUAT4D, // 4 doubles encoding a quaternion {qx,qy,qz,qs}
TW_TYPE_DIR3F, // direction vector represented by 3 floats
TW_TYPE_DIR3D // direction vector represented by 3 doubles
} TwType;
#define TW_TYPE_CSSTRING(n) ((TwType)(0x30000000+((n)&0xfffffff))) // Null-terminated C Static String of size n (defined as char[n], with n<2^28)
typedef void (TW_CALL * TwSetVarCallback)(const void *value, void *clientData);
typedef void (TW_CALL * TwGetVarCallback)(void *value, void *clientData);
typedef void (TW_CALL * TwButtonCallback)(void *clientData);
TW_API int TW_CALL TwAddVarRW(TwBar *bar, const char *name, TwType type, void *var, const char *def);
TW_API int TW_CALL TwAddVarRO(TwBar *bar, const char *name, TwType type, const void *var, const char *def);
TW_API int TW_CALL TwAddVarCB(TwBar *bar, const char *name, TwType type, TwSetVarCallback setCallback, TwGetVarCallback getCallback, void *clientData, const char *def);
TW_API int TW_CALL TwAddButton(TwBar *bar, const char *name, TwButtonCallback callback, void *clientData, const char *def);
TW_API int TW_CALL TwAddSeparator(TwBar *bar, const char *name, const char *def);
TW_API int TW_CALL TwRemoveVar(TwBar *bar, const char *name);
TW_API int TW_CALL TwRemoveAllVars(TwBar *bar);
typedef struct CTwEnumVal
{
int Value;
const char * Label;
} TwEnumVal;
typedef struct CTwStructMember
{
const char * Name;
TwType Type;
size_t Offset;
const char * DefString;
} TwStructMember;
typedef void (TW_CALL * TwSummaryCallback)(char *summaryString, size_t summaryMaxLength, const void *value, void *clientData);
TW_API int TW_CALL TwDefine(const char *def);
TW_API TwType TW_CALL TwDefineEnum(const char *name, const TwEnumVal *enumValues, unsigned int nbValues);
TW_API TwType TW_CALL TwDefineStruct(const char *name, const TwStructMember *structMembers, unsigned int nbMembers, size_t structSize, TwSummaryCallback summaryCallback, void *summaryClientData);
typedef void (TW_CALL * TwCopyCDStringToClient)(char **destinationClientStringPtr, const char *sourceString);
TW_API void TW_CALL TwCopyCDStringToClientFunc(TwCopyCDStringToClient copyCDStringFunc);
TW_API void TW_CALL TwCopyCDStringToLibrary(char **destinationLibraryStringPtr, const char *sourceClientString);
#ifdef __cplusplus
typedef void (TW_CALL * TwCopyStdStringToClient)(std::string& destinationClientString, const std::string& sourceString);
TW_API void TW_CALL TwCopyStdStringToClientFunc(TwCopyStdStringToClient copyStdStringToClientFunc);
TW_API void TW_CALL TwCopyStdStringToLibrary(std::string& destinationLibraryString, const std::string& sourceClientString);
#endif // __cplusplus
typedef enum ETwParamValueType
{
TW_PARAM_INT32,
TW_PARAM_FLOAT,
TW_PARAM_DOUBLE,
TW_PARAM_CSTRING // Null-terminated array of char (ie, c-string)
} TwParamValueType;
TW_API int TW_CALL TwGetParam(TwBar *bar, const char *varName, const char *paramName, TwParamValueType paramValueType, unsigned int outValueMaxCount, void *outValues);
TW_API int TW_CALL TwSetParam(TwBar *bar, const char *varName, const char *paramName, TwParamValueType paramValueType, unsigned int inValueCount, const void *inValues);
// ----------------------------------------------------------------------------
// Managment functions and definitions
// ----------------------------------------------------------------------------
typedef enum ETwGraphAPI
{
TW_OPENGL = 1,
TW_DIRECT3D9 = 2,
TW_DIRECT3D10 = 3
} TwGraphAPI;
TW_API int TW_CALL TwInit(TwGraphAPI graphAPI, void *device);
TW_API int TW_CALL TwTerminate();
TW_API int TW_CALL TwDraw();
TW_API int TW_CALL TwWindowSize(int width, int height);
typedef enum ETwKeyModifier
{
TW_KMOD_NONE = 0x0000, // same codes as SDL keysym.mod
TW_KMOD_SHIFT = 0x0003,
TW_KMOD_CTRL = 0x00c0,
TW_KMOD_ALT = 0x0100,
TW_KMOD_META = 0x0c00
} TwKeyModifier;
typedef enum EKeySpecial
{
TW_KEY_BACKSPACE = '\b',
TW_KEY_TAB = '\t',
TW_KEY_CLEAR = 0x0c,
TW_KEY_RETURN = '\r',
TW_KEY_PAUSE = 0x13,
TW_KEY_ESCAPE = 0x1b,
TW_KEY_SPACE = ' ',
TW_KEY_DELETE = 0x7f,
TW_KEY_UP = 273, // same codes and order as SDL keysym.sym
TW_KEY_DOWN,
TW_KEY_RIGHT,
TW_KEY_LEFT,
TW_KEY_INSERT,
TW_KEY_HOME,
TW_KEY_END,
TW_KEY_PAGE_UP,
TW_KEY_PAGE_DOWN,
TW_KEY_F1,
TW_KEY_F2,
TW_KEY_F3,
TW_KEY_F4,
TW_KEY_F5,
TW_KEY_F6,
TW_KEY_F7,
TW_KEY_F8,
TW_KEY_F9,
TW_KEY_F10,
TW_KEY_F11,
TW_KEY_F12,
TW_KEY_F13,
TW_KEY_F14,
TW_KEY_F15,
TW_KEY_LAST
} TwKeySpecial;
TW_API int TW_CALL TwKeyPressed(int key, int modifiers);
typedef enum ETwMouseAction
{
TW_MOUSE_RELEASED,
TW_MOUSE_PRESSED
} TwMouseAction;
typedef enum ETwMouseButtonID
{
TW_MOUSE_LEFT = 1, // same code as SDL_BUTTON_LEFT
TW_MOUSE_MIDDLE = 2, // same code as SDL_BUTTON_MIDDLE
TW_MOUSE_RIGHT = 3 // same code as SDL_BUTTON_RIGHT
} TwMouseButtonID;
TW_API int TW_CALL TwMouseButton(TwMouseAction action, TwMouseButtonID button);
TW_API int TW_CALL TwMouseMotion(int mouseX, int mouseY);
TW_API int TW_CALL TwMouseWheel(int pos);
TW_API const char * TW_CALL TwGetLastError();
typedef void (TW_CALL * TwErrorHandler)(const char *errorMessage);
TW_API void TW_CALL TwHandleErrors(TwErrorHandler errorHandler);
// ----------------------------------------------------------------------------
// Helper functions to translate events from some common window management
// frameworks to AntTweakBar.
// They call TwKeyPressed, TwMouse* and TwWindowSize for you (implemented in
// files TwEventWin.c TwEventSDL.c TwEventGLFW.c TwEventGLUT.c)
// ----------------------------------------------------------------------------
// For Windows message proc
#ifndef _W64 // Microsoft specific (detection of 64 bits portability problems)
# define _W64
#endif // _W64
TW_API int TW_CALL TwEventWin(void *wnd, unsigned int msg, unsigned int _W64 wParam, int _W64 lParam);
#define TwEventWin32 TwEventWin // For compatibility with AntTweakBar versions prior to 1.11
// For libSDL event loop
TW_API int TW_CALL TwEventSDL(const void *sdlEvent);
// For GLFW event callbacks
TW_API int TW_CALL TwEventMouseButtonGLFW(int glfwButton, int glfwAction);
TW_API int TW_CALL TwEventKeyGLFW(int glfwKey, int glfwAction);
TW_API int TW_CALL TwEventCharGLFW(int glfwChar, int glfwAction);
#define TwEventMousePosGLFW TwMouseMotion
#define TwEventMouseWheelGLFW TwMouseWheel
// For GLUT event callbacks (Windows calling convention for GLUT callbacks is cdecl)
#if defined(_WIN32) || defined(_WIN64)
# define TW_GLUT_CALL __cdecl
#else
# define TW_GLUT_CALL
#endif
TW_API int TW_GLUT_CALL TwEventMouseButtonGLUT(int glutButton, int glutState, int mouseX, int mouseY);
TW_API int TW_GLUT_CALL TwEventMouseMotionGLUT(int mouseX, int mouseY);
TW_API int TW_GLUT_CALL TwEventKeyboardGLUT(unsigned char glutKey, int mouseX, int mouseY);
TW_API int TW_GLUT_CALL TwEventSpecialGLUT(int glutKey, int mouseX, int mouseY);
TW_API int TW_CALL TwGLUTModifiersFunc(int (TW_CALL *glutGetModifiersFunc)(void));
typedef void (TW_GLUT_CALL *GLUTmousebuttonfun)(int glutButton, int glutState, int mouseX, int mouseY);
typedef void (TW_GLUT_CALL *GLUTmousemotionfun)(int mouseX, int mouseY);
typedef void (TW_GLUT_CALL *GLUTkeyboardfun)(unsigned char glutKey, int mouseX, int mouseY);
typedef void (TW_GLUT_CALL *GLUTspecialfun)(int glutKey, int mouseX, int mouseY);
// ----------------------------------------------------------------------------
// Make sure the types have the right sizes
// ----------------------------------------------------------------------------
#define TW_COMPILE_TIME_ASSERT(name, x) typedef int TW_DUMMY_ ## name[(x) * 2 - 1]
TW_COMPILE_TIME_ASSERT(CHAR, sizeof(char) == 1);
TW_COMPILE_TIME_ASSERT(SHORT, sizeof(short) == 2);
TW_COMPILE_TIME_ASSERT(INT, sizeof(int) == 4);
TW_COMPILE_TIME_ASSERT(FLOAT, sizeof(float) == 4);
TW_COMPILE_TIME_ASSERT(DOUBLE, sizeof(double) == 8);
// ---------------------------------------------------------------------------
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // !defined TW_INCLUDED
// ---------------------------------------------------------------------------
//
// @file AntPerfTimer.h
// @brief A performance (precision) timer for benchs
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// For conditions of distribution and use, see License.txt
//
// notes: TAB=4
// No cpp file is needed, everything is defined in this header
//
// ---------------------------------------------------------------------------
#if !defined ANT_PERF_TIMER_INCLUDED
#define ANT_PERF_TIMER_INCLUDED
#ifndef __cplusplus
# error This is a C++ header
#endif // __cplusplus
#if defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#include <tchar.h>
struct PerfTimer
{
inline PerfTimer() { if( !QueryPerformanceFrequency(&Freq) ) MessageBox(NULL, _T("Precision timer not supported"), _T("Problem"), MB_ICONEXCLAMATION); Reset(); }
inline void Reset() { QueryPerformanceCounter(&Start); }
inline double GetTime() { if( QueryPerformanceCounter(&End) ) return ((double)End.QuadPart - (double)Start.QuadPart)/((double)Freq.QuadPart); else return 0; }
protected:
LARGE_INTEGER Start, End, Freq;
};
#else // !_WIN (-> LINUX)
#include <sys/time.h>
#include <unistd.h>
struct PerfTimer
{
inline PerfTimer() { Reset(); }
inline void Reset() { gettimeofday(&Start, &TZ); }
inline double GetTime() { gettimeofday(&End,&TZ);
double t1 = (double)Start.tv_sec + (double)Start.tv_usec/(1000*1000);
double t2 = (double)End.tv_sec + (double)End.tv_usec/(1000*1000);
return t2-t1; }
protected:
struct timeval Start, End;
struct timezone TZ;
};
#endif // _WIN
#endif // ANT_PERF_TIMER_INCLUDED
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
//#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Franais (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
//LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
IDC_CURSOR1 CURSOR "res\\cur00013.cur"
IDC_CURSOR2 CURSOR "res\\cur00000.cur"
IDC_CURSOR3 CURSOR "res\\cur00001.cur"
IDC_CURSOR4 CURSOR "res\\cur00002.cur"
IDC_CURSOR5 CURSOR "res\\cur00003.cur"
IDC_CURSOR6 CURSOR "res\\cur00004.cur"
IDC_CURSOR7 CURSOR "res\\cur00005.cur"
IDC_CURSOR8 CURSOR "res\\cur00006.cur"
IDC_CURSOR9 CURSOR "res\\cur00007.cur"
IDC_CURSOR10 CURSOR "res\\cur00008.cur"
IDC_CURSOR11 CURSOR "res\\cur00009.cur"
IDC_CURSOR12 CURSOR "res\\cur00010.cur"
IDC_CURSOR13 CURSOR "res\\cur00011.cur"
IDC_CURSOR14 CURSOR "res\\cur00012.cur"
#endif // Franais (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AntTweakBar", "AntTweakBar.vcproj", "{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwAdvanced1", "..\examples\TwAdvanced1.vcproj", "{008D1CEC-1586-4C89-B524-DF15D9605163}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
{008D1CEC-1586-4C89-B524-DF15D9605163}.0 = {B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug.ActiveCfg = Debug|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug.Build.0 = Debug|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release.ActiveCfg = Release|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.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
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="AntTweakBar"
ProjectGUID="{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>