Commit 23fc0820 authored by sylvain thery's avatar sylvain thery

compilation windows

parent f29adf8f
......@@ -100,6 +100,7 @@ Dart d_maison;
Dart Carre()
{
return Dart::nil();
}
......@@ -107,7 +108,7 @@ Dart Carre()
Dart Triangle()
{
return Dart::nil();
}
......@@ -141,7 +142,7 @@ void ColleMilieu(Dart d, Dart e)
Dart Maison()
{
return Dart::nil();
}
......
......@@ -41,7 +41,6 @@
#include "Algo/Parallel/parallel_foreach.h"
#include <GL/glx.h>
using namespace CGoGN ;
......
cmake_minimum_required( VERSION 2.6 )
PROJECT( Assimp )
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
INCLUDE_DIRECTORIES( ../include )
SET( LIBRARY_VERSION "1.0.0" )
SET( LIBRARY_SOVERSION "1" )
IF(WIN32)
SET( ENABLE_BOOST_WORKAROUND "1" )
ENDIF(WIN32)
IF ( ENABLE_BOOST_WORKAROUND )
INCLUDE_DIRECTORIES( BoostWorkaround )
ADD_DEFINITIONS( -DASSIMP_BUILD_BOOST_WORKAROUND )
MESSAGE( STATUS "Building a non-boost version of Assimp." )
ELSE ( ENABLE_BOOST_WORKAROUND )
FIND_PACKAGE( Boost 1.35 )
FIND_PACKAGE( Boost )
IF ( NOT Boost_FOUND )
MESSAGE( FATAL_ERROR
......
......@@ -11,11 +11,18 @@ find_package(GLUT)
#On Windows we use AntTweakBar/OpenCTM of dependencies, not compiled
IF(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)#release added by visual
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
add_subdirectory(Zinri/Build)
add_subdirectory(gzstream/Build)
add_subdirectory(Numerical)
add_subdirectory(Assimp)
add_subdirectory(Assimp/code)
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE)
endif()
ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
add_custom_target( FakeTargetOpenCTM ALL "make"
WORKING_DIRECTORY ${CGoGN_ROOT_DIR}/ThirdParty/OpenCTM
COMMENT "Custom compile of OpenCTM" )
......
......@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project(Numerical)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
SUBDIRS(C_BLAS_LAPACK)
......
......@@ -135,7 +135,7 @@ if(BLAS_COMPLEX16)
${ALLBLAS} ${ZBLAS2} ${ZBLAS3})
endif()
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
add_library(blas ${ALLOBJ})
if(UNIX)
target_link_libraries(blas m)
......
......@@ -58,6 +58,7 @@ if(WIN32)
endif()
include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
add_library(f2c ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
set_property(TARGET f2c PROPERTY PREFIX lib)
#set_property(TARGET f2c PROPERTY PREFIX lib)
#pb sous windows avec le prefix lib
\ No newline at end of file
......@@ -376,7 +376,6 @@ if(BUILD_COMPLEX16)
set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX})
endif()
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
add_library(lapack ${ALLOBJ} ${ALLXOBJ})
target_link_libraries(lapack blas)
......@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project(Zinri)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
include_directories(..)
file(
......
......@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project(gzstream)
set(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
include_directories(..)
file(
......
......@@ -24,14 +24,20 @@ IF(WIN32)
SET(DEVIL_LIBRARIES DevIL ILU ILUT)
SET(ZLIB_LIBRARIES zlib)
SET(LIBXML2_LIBRARIES xml2)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/dependencies/include/)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/dependencies/lib/)
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/)
# add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
if (EXISTS "${CGoGN_ROOT_DIR}/Perso")
add_subdirectory(${CGoGN_ROOT_DIR}/Perso Perso)
endif (EXISTS "${CGoGN_ROOT_DIR}/Perso")
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE)
endif()
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
find_package(DevIL)
......
......@@ -23,7 +23,7 @@
*******************************************************************************/
#include <boost/thread.hpp>
#include <boost/thread/barrier.hpp>
#include <vector>
namespace CGoGN
{
......@@ -157,8 +157,8 @@ void foreach_orbit(typename PFP::MAP& map, unsigned int orbit, FunctorType& fun
template <typename PFP>
void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorType& func, unsigned int nbth, unsigned int szbuff, const FunctorSelect& good)
{
std::vector<Dart> vd[nbth];
boost::thread* threads[nbth];
std::vector<Dart>* vd = new std::vector<Dart>[nbth];
boost::thread** threads = new boost::thread*[nbth];
CellMarker cm(map,cell);
Dart d=map.begin();
......@@ -188,7 +188,8 @@ void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorType& func,
threads[i] = new boost::thread(ThreadFunctor(func, vd[i],sync1,sync2, finished));
// and continue to traverse the map
std::vector<Dart> tempo[nbth];
std::vector<Dart>* tempo = new std::vector<Dart>[nbth];
for (unsigned int i=0; i<nbth; ++i)
tempo[i].reserve(szbuff);
......@@ -225,6 +226,9 @@ void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorType& func,
threads[i]->join();
delete threads[i];
}
delete[] threads;
delete[] vd;
delete[] tempo;
}
......
......@@ -37,7 +37,7 @@
#define EMBNULL 0xffffffff
#define NB_ORBITS 5
#define NBTHREAD 8
#define NBTHREAD 16
#define VERTEX_ORBIT (unsigned int)(0)
#define EDGE_ORBIT (unsigned int)(1)
......
......@@ -54,7 +54,8 @@ inline void GenericMap::deleteDart(Dart d)
if(emb != EMBNULL)
m_attribs[orbit].unrefLine(emb) ;
}
m_markerTables[DART_ORBIT]->operator[](d.index).clear() ;
for (unsigned int t=0; t<m_nbThreads; ++t)
m_markerTables[DART_ORBIT][t]->operator[](d.index).clear() ;
}
}
......
......@@ -31,8 +31,9 @@
#define __X_GL_H
#define GLAPIENTRY
#include <GL/glut.h>
#include <GL/glx.h>
#ifndef WIN32
#include <GL/glx.h>
#endif
#include "Utils/trackball.h"
#include <IL/ilu.h>
#include <IL/ilut.h>
......@@ -109,11 +110,14 @@ protected:
virtual void myMouseClick(int button, int state, int x, int y) {}
#ifdef WIN32
HDC m_drawable;
HGLRC m_context;
#else
Display* m_dpy;
GLXDrawable m_drawable;
GLXContext m_context;
#endif
public:
//! Others initialization: should be overloaded in derived classes
......
......@@ -102,7 +102,8 @@ void GenericMap::setDartEmbedding(unsigned int orbit, Dart d, unsigned int emb)
if (old != EMBNULL)
{
if(m_attribs[orbit].unrefLine(old))
m_markerTables[orbit]->operator[](old).clear();
for (unsigned int t=0; t<m_nbThreads; ++t)
m_markerTables[orbit][t]->operator[](old).clear();
}
// ref the new emb
if (emb != EMBNULL)
......
......@@ -106,22 +106,35 @@ SimpleGlutWin::SimpleGlutWin(int* argc, char **argv, int winX, int winY)
glEnable(GL_LIGHT0);
//Store context infos
#ifdef WIN32
m_drawable = wglGetCurrentDC();
m_context = wglGetCurrentContext();
#else
m_dpy = glXGetCurrentDisplay();
m_drawable = glXGetCurrentDrawable();
m_context = glXGetCurrentContext();
#endif
// Call other initialization (possibly overloaded in instances)
instance->init();
}
void SimpleGlutWin::releaseContext()
{
glXMakeCurrent(m_dpy,None,NULL);
#ifdef WIN32
wglMakeCurrent(NULL,NULL);
#else
glxMakeCurrent(m_dpy,None,NULL);
#endif
}
void SimpleGlutWin::useContext()
{
glXMakeCurrent(m_dpy, m_drawable, m_context);
#ifdef WIN32
wglMakeCurrent(m_drawable, m_context);
#else
glxMakeCurrent(m_dpy, m_drawable, m_context);
#endif
}
......
......@@ -155,7 +155,7 @@ VBO_Node::VBO_Node(Algo::Render::VBO::MapRender_VBO* vbo)
{}
void VBO_Node::VBO_Node::setVBO(Algo::Render::VBO::MapRender_VBO* vbo)
void VBO_Node::setVBO(Algo::Render::VBO::MapRender_VBO* vbo)
{
m_vbo = vbo;
}
......
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