Commit 8c1f2041 authored by Philip Trettner's avatar Philip Trettner

Made ATB windows compatible

parent ce9ab11f
......@@ -3,36 +3,61 @@ project(AntTweakBar)
set(ANTTWEAKBAR_LINK_TYPE SHARED CACHE String "link type for ATB")
if(MSVC)
set(ANTTWEAKBAR_LINK_TYPE STATIC CACHE String "" FORCE)
endif()
set(ATB_SOURCES
include/AntTweakBar.h
src/TwColors.cpp
src/TwColors.h
src/TwFonts.cpp
src/TwFonts.h
src/TwOpenGL.cpp
src/TwOpenGL.h
src/TwOpenGLCore.cpp
src/TwOpenGLCore.h
src/TwBar.cpp
src/TwBar.h
src/TwMgr.cpp
src/TwMgr.h
src/TwPrecomp.cpp
src/TwPrecomp.h
src/LoadOGL.cpp
src/LoadOGL.h
src/LoadOGLCore.cpp
src/LoadOGLCore.h
src/TwEventGLFW.c
src/TwEventGLUT.c
src/TwEventSDL.c
src/TwEventSDL12.c
src/TwEventSDL13.c
src/TwEventSFML.cpp
)
if(UNIX)
set(ATB_SOURCES ${ATB_SOURCES} src/TwEventX11.c)
else()
set(ATB_SOURCES ${ATB_SOURCES}
src/TwEventWin.c
# NO DX SUPPORT
#src/TwDirect3D9.cpp
#src/TwDirect3D9.h
#src/TwDirect3D10.cpp
#src/TwDirect3D10.h
#src/TwDirect3D11.cpp
#src/TwDirect3D11.h
)
endif()
add_library(AntTweakBar ${ANTTWEAKBAR_LINK_TYPE}
include/AntTweakBar.h
src/TwColors.cpp
src/TwColors.h
src/TwFonts.cpp
src/TwFonts.h
src/TwOpenGL.cpp
src/TwOpenGL.h
src/TwOpenGLCore.cpp
src/TwOpenGLCore.h
src/TwBar.cpp
src/TwBar.h
src/TwMgr.cpp
src/TwMgr.h
src/TwPrecomp.cpp
src/TwPrecomp.h
src/LoadOGL.cpp
src/LoadOGL.h
src/LoadOGLCore.cpp
src/LoadOGLCore.h
src/TwEventGLFW.c
src/TwEventGLUT.c
src/TwEventSDL.c
src/TwEventSDL12.c
src/TwEventSDL13.c
src/TwEventSFML.cpp
src/TwEventX11.c
)
add_library(AntTweakBar ${ANTTWEAKBAR_LINK_TYPE} ${ATB_SOURCES})
if (MSVC)
target_compile_options(AntTweakBar PUBLIC
/MP
)
target_compile_definitions(AntTweakBar PUBLIC TW_STATIC)
else()
target_compile_options(AntTweakBar PRIVATE
-Wall
-Werror
......@@ -41,6 +66,7 @@ target_compile_options(AntTweakBar PUBLIC
# C++11 for C++ files
$<$<COMPILE_LANGUAGE:CXX>:-std=c++11>
)
endif()
target_include_directories(AntTweakBar PUBLIC include)
......
......@@ -60,18 +60,18 @@
# define TW_API
# if defined(_MSC_VER) && !defined(TW_NO_LIB_PRAGMA)
# ifdef _WIN64
# pragma comment(lib, "AntTweakBarStatic64")
//# pragma comment(lib, "AntTweakBarStatic64")
# else
# pragma comment(lib, "AntTweakBarStatic")
//# pragma comment(lib, "AntTweakBarStatic")
# endif
# endif
#else
# define TW_API TW_IMPORT_API
# if defined(_MSC_VER) && !defined(TW_NO_LIB_PRAGMA)
# ifdef _WIN64
# pragma comment(lib, "AntTweakBar64")
//# pragma comment(lib, "AntTweakBar64")
# else
# pragma comment(lib, "AntTweakBar")
//# pragma comment(lib, "AntTweakBar")
# endif
# endif
#endif
......
......@@ -16,9 +16,9 @@
#include "TwOpenGL.h"
#include "TwOpenGLCore.h"
#ifdef ANT_WINDOWS
# include "TwDirect3D9.h"
# include "TwDirect3D10.h"
# include "TwDirect3D11.h"
//# include "TwDirect3D9.h"
//# include "TwDirect3D10.h"
//# include "TwDirect3D11.h"
# include "resource.h"
# ifdef _DEBUG
# include <crtdbg.h>
......@@ -1752,7 +1752,7 @@ static int TwCreateGraph(ETwGraphAPI _GraphAPI)
g_TwMgr->m_Graph = new CTwGraphOpenGLCore;
break;
case TW_DIRECT3D9:
#ifdef ANT_WINDOWS
/*#ifdef ANT_WINDOWS
if( g_TwMgr->m_Device!=NULL )
g_TwMgr->m_Graph = new CTwGraphDirect3D9;
else
......@@ -1760,10 +1760,10 @@ static int TwCreateGraph(ETwGraphAPI _GraphAPI)
g_TwMgr->SetLastError(g_ErrBadDevice);
return 0;
}
#endif // ANT_WINDOWS
#endif // ANT_WINDOWS*/
break;
case TW_DIRECT3D10:
#ifdef ANT_WINDOWS
/*#ifdef ANT_WINDOWS
if( g_TwMgr->m_Device!=NULL )
g_TwMgr->m_Graph = new CTwGraphDirect3D10;
else
......@@ -1771,10 +1771,10 @@ static int TwCreateGraph(ETwGraphAPI _GraphAPI)
g_TwMgr->SetLastError(g_ErrBadDevice);
return 0;
}
#endif // ANT_WINDOWS
#endif // ANT_WINDOWS*/
break;
case TW_DIRECT3D11:
#ifdef ANT_WINDOWS
/*#ifdef ANT_WINDOWS
if( g_TwMgr->m_Device!=NULL )
g_TwMgr->m_Graph = new CTwGraphDirect3D11;
else
......@@ -1782,7 +1782,7 @@ static int TwCreateGraph(ETwGraphAPI _GraphAPI)
g_TwMgr->SetLastError(g_ErrBadDevice);
return 0;
}
#endif // ANT_WINDOWS
#endif // ANT_WINDOWS*/
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment