Commit 27f5e30d authored by Sylvain Thery's avatar Sylvain Thery

compile QGLViewer even on windows

parent b83db656
......@@ -90,13 +90,20 @@ set(FORM_FILES_GROUP "Generated")
include_directories("..")
# The code must be relocatable if we want to link a shared library against it
#if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# add_definitions("-fPIC")
#endif()
if(WIN32)
ADD_DEFINITIONS(-DCREATE_QGLVIEWER_DLL -DNOMINMAX)
else()
ADD_DEFINITIONS("-fPIC")
endif()
add_library(QGLViewer SHARED ${HEADER_FILES} ${MOC_FILES} ${MOC_UI_FILES} ${FORM_FILES} ${SOURCE_FILES})
target_link_libraries(QGLViewer ${QT_LIBRARIES} ${OPENGL_LIBRARY})
# The code must be relocatable if we want to link a shared library against it
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"
OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_definitions("-fPIC")
endif()
......@@ -81,7 +81,7 @@ void BSPSortMethod::sortPrimitives(std::vector<PtrPrimitive>& primitive_tab,VRen
BSPTree tree;
Polygone *P;
unsigned int N = primitive_tab.size()/200 +1;
unsigned int N = (unsigned int)(primitive_tab.size()/200 +1);
int nbinserted = 0;
vector<PtrPrimitive> segments_and_points; // Store segments and points for pass 2, because polygons are deleted
......@@ -313,7 +313,7 @@ void BSPNode::Classify(Polygone *P, Polygone * & moins_, Polygone * & plus_)
return;
}
int n = P->nbVertices();
int n = int(P->nbVertices());
int Smin = 1;
int Smax = -1;
......@@ -596,13 +596,13 @@ void BSPNode::initEquation(const Polygone *P,double & a, double & b, double & c,
if(n.infNorm() <= 0.00001)
{
unsigned int ind = P->nbVertices();
unsigned int ind = (unsigned int)(P->nbVertices());
for(unsigned int i=0;i<P->nbVertices();i++)
if((P->vertex(i+1)-P->vertex(i)).infNorm() > 0.00001)
{
ind = i;
i = P->nbVertices();
i = (unsigned int)(P->nbVertices());
}
if(ind < P->nbVertices()) // the polygon is a true segment
......
......@@ -155,7 +155,7 @@ void EPSExporter::spewPolygone(const Polygone *P, QTextStream& out)
GLfloat red, green, blue;
bool smooth;
nvertices = P->nbVertices() ;
nvertices = int(P->nbVertices()) ;
const Feedback3DColor& vertex = Feedback3DColor(P->sommet3DColor(0)) ;
......
......@@ -73,7 +73,7 @@ void Exporter::exportToFile(const QString& filename,
writeHeader(out) ;
unsigned int N = primitive_tab.size()/200 + 1 ;
unsigned int N = (unsigned int)(primitive_tab.size() / 200 + 1);
for(unsigned int i=0;i<primitive_tab.size();++i)
{
......
......@@ -181,7 +181,7 @@ void FIGExporter::spewPolygone(const Polygone *P, QTextStream& out)
int nvertices;
GLfloat red, green, blue;
nvertices = P->nbVertices() ;
nvertices = int(P->nbVertices()) ;
Feedback3DColor vertex(P->sommet3DColor(0)) ;
......
......@@ -306,7 +306,7 @@ void ParserUtils::NormalizePrimitiveCoordinates(GLfloat * & loc,GLfloat MaxSize,
token = int(*loc) ;
loc++;
int size = Feedback3DColor::sizeInBuffer() ;
int size = int(Feedback3DColor::sizeInBuffer()) ;
switch (token)
{
......@@ -353,7 +353,7 @@ void ParserUtils::ComputePrimitiveBB(GLfloat * & loc,GLfloat & xmin,GLfloat & xm
token = int(*loc) ;
loc++;
int size = Feedback3DColor::sizeInBuffer() ;
int size = int(Feedback3DColor::sizeInBuffer()) ;
switch (token)
{
......
......@@ -404,7 +404,7 @@ gpc_polygon PrimitivePositioning::createGPCPolygon_XY(const Polygone *P)
gpc_vertex_list *gpc_p_verts = new gpc_vertex_list ;
gpc_p_verts->num_vertices = P->nbVertices() ;
gpc_p_verts->num_vertices = long(P->nbVertices()) ;
gpc_p_verts->vertex = new gpc_vertex[P->nbVertices()] ;
for(size_t i=0;i<P->nbVertices();++i)
......
......@@ -61,7 +61,7 @@ void VisibilityOptimizer::optimize(vector<PtrPrimitive>& primitives,VRenderParam
#ifdef DEBUG_VO
cout << "Optimizing visibility." << endl ;
#endif
unsigned long N = primitives.size()/200 + 1 ;
unsigned long N = (unsigned long)(primitives.size()/200 + 1) ;
#ifdef DEBUG_EPSRENDER__SHOW1
// cout << "Showing viewer." << endl ;
......@@ -178,7 +178,7 @@ void VisibilityOptimizer::optimize(vector<PtrPrimitive>& primitives,VRenderParam
}
else
{
new_poly_verts->num_vertices = p->nbVertices() ;
new_poly_verts->num_vertices = long(p->nbVertices()) ;
new_poly_verts->vertex = new gpc_vertex[p->nbVertices()] ;
for(size_t i=0;i<p->nbVertices();++i)
......@@ -191,7 +191,7 @@ void VisibilityOptimizer::optimize(vector<PtrPrimitive>& primitives,VRenderParam
mx /= p->nbVertices() ;
my /= p->nbVertices() ;
new_poly_reduced_verts->num_vertices = p->nbVertices() ;
new_poly_reduced_verts->num_vertices = long(p->nbVertices()) ;
new_poly_reduced_verts->vertex = new gpc_vertex[p->nbVertices()] ;
for(size_t j=0;j<p->nbVertices();++j)
......
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