Skip to content

Commit

Permalink
Some Windows-related fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
steiner- authored and eile committed Sep 21, 2017
1 parent 21b3de0 commit df077e1
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 19 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ if(APPLE)
include_directories(SYSTEM /opt/X11/include /usr/X11R6/include) include_directories(SYSTEM /opt/X11/include /usr/X11R6/include)
endif() endif()


if(MSVC)
include(UseGnuWin32)
else()
set(PTHREAD_LIBRARIES pthread)
endif()

common_find_package(Boost REQUIRED COMPONENTS common_find_package(Boost REQUIRED COMPONENTS
program_options filesystem system thread) program_options filesystem system thread)
common_find_package(BISON REQUIRED) common_find_package(BISON REQUIRED)
Expand Down Expand Up @@ -154,12 +160,6 @@ endif()


list(APPEND CPPCHECK_EXTRA_ARGS -DEQUALIZERFABRIC_STATIC=) list(APPEND CPPCHECK_EXTRA_ARGS -DEQUALIZERFABRIC_STATIC=)


if(MSVC)
include(UseGnuWin32)
else()
set(PTHREAD_LIBRARIES pthread)
endif()

if(APPLE) if(APPLE)
add_definitions(-DDarwin) add_definitions(-DDarwin)
endif(APPLE) endif(APPLE)
Expand Down
4 changes: 1 addition & 3 deletions eq/fabric/projection.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
*/ */


#include "projection.h" #include "projection.h"
#include "vmmlib.h"
#include "wall.h" #include "wall.h"


#include <lunchbox/log.h> #include <lunchbox/log.h>


#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#endif
#define DEG2RAD(angle) ((angle) * static_cast<float>(M_PI) / 180.f) #define DEG2RAD(angle) ((angle) * static_cast<float>(M_PI) / 180.f)
#define RAD2DEG(angle) ((angle)*180.f / static_cast<float>(M_PI)) #define RAD2DEG(angle) ((angle)*180.f / static_cast<float>(M_PI))


Expand Down
13 changes: 13 additions & 0 deletions eq/fabric/vmmlib.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
#ifndef EQFABRIC_VMMLIB_H #ifndef EQFABRIC_VMMLIB_H
#define EQFABRIC_VMMLIB_H #define EQFABRIC_VMMLIB_H


#if defined(_MSC_VER)
//can otherwise cause problems with, e.g., M_PI under Windows.
#define _USE_MATH_DEFINES
#include <cmath>
#ifndef M_PI
#include <corecrt_math_defines.h>
#endif
#else
#ifndef M_PI
#define M_PI 3.1415926535897932
#endif
#endif

#include <eq/fabric/types.h> #include <eq/fabric/types.h>
#include <lunchbox/bitOperation.h> #include <lunchbox/bitOperation.h>


Expand Down
4 changes: 1 addition & 3 deletions eq/fabric/wall.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
*/ */


#include "wall.h" #include "wall.h"
#include "vmmlib.h"
#include "pixelViewport.h" #include "pixelViewport.h"
#include "projection.h" #include "projection.h"


#include <lunchbox/log.h> #include <lunchbox/log.h>


#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#endif
#define DEG2RAD(angle) ((angle) * static_cast<float>(M_PI) / 180.f) #define DEG2RAD(angle) ((angle) * static_cast<float>(M_PI) / 180.f)


namespace eq namespace eq
Expand Down
2 changes: 1 addition & 1 deletion eq/fabric/wall.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#ifndef EQFABRIC_WALL_H #ifndef EQFABRIC_WALL_H
#define EQFABRIC_WALL_H #define EQFABRIC_WALL_H


#include <iostream>
#include <eq/fabric/api.h> #include <eq/fabric/api.h>
#include <eq/fabric/types.h> #include <eq/fabric/types.h>
#include <eq/fabric/vmmlib.h> #include <eq/fabric/vmmlib.h>
#include <iostream>


namespace eq namespace eq
{ {
Expand Down
4 changes: 1 addition & 3 deletions eq/server/frustumData.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
#include "frustumData.h" #include "frustumData.h"


#include <eq/fabric/projection.h> #include <eq/fabric/projection.h>
#include <eq/fabric/vmmlib.h>
#include <eq/fabric/wall.h> #include <eq/fabric/wall.h>


#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#endif
#define DEG2RAD(angle) ((angle) * static_cast<float>(M_PI) / 180.f) #define DEG2RAD(angle) ((angle) * static_cast<float>(M_PI) / 180.f)


namespace eq namespace eq
Expand Down
8 changes: 6 additions & 2 deletions eq/wgl/window.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <eq/pipe.h> #include <eq/pipe.h>


#include <lunchbox/log.h> #include <lunchbox/log.h>
#include <lunchbox/debug.h>


namespace eq namespace eq
{ {
Expand Down Expand Up @@ -842,8 +843,11 @@ HGLRC Window::createWGLContext()
} }


// share context // share context
if (!coreContext && shareCtx && !wglShareLists(shareCtx, context)) if (!coreContext && shareCtx && !wglShareLists(shareCtx, context))
LBWARN << "Context sharing failed: " << lunchbox::sysError << std::endl; {
LBWARN << "Context sharing failed: " << lunchbox::sysError
<< lunchbox::backtrace << std::endl;
}


return context; return context;
} }
Expand Down
1 change: 0 additions & 1 deletion tools/eVolveConverter/codebase.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#endif #endif
#ifdef WINOS #ifdef WINOS
#define NOMINMAX #define NOMINMAX
#include <winbase.h>
#include <windows.h> #include <windows.h>
#endif #endif


Expand Down

0 comments on commit df077e1

Please sign in to comment.