From 17492d3d406713f637209ada1b625a25eb90e528 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 25 Aug 2017 11:07:43 +0200 Subject: [PATCH] update Eigen dependency --- ext/eigen | 2 +- include/nanogui/common.h | 21 +++++++++++---------- src/common.cpp | 8 ++++---- src/screen.cpp | 4 ++-- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/ext/eigen b/ext/eigen index c34a9130bc..1f05f51517 160000 --- a/ext/eigen +++ b/ext/eigen @@ -1 +1 @@ -Subproject commit c34a9130bc585b288703bd9716d7efae194974e2 +Subproject commit 1f05f51517ec4fd91eed711e0f89e97a7c028c0e diff --git a/include/nanogui/common.h b/include/nanogui/common.h index 79f7e1febb..da8b66c24b 100644 --- a/include/nanogui/common.h +++ b/include/nanogui/common.h @@ -12,6 +12,17 @@ #pragma once +#if defined(_WIN32) +# if defined(NANOGUI_BUILD) + /* Quench a few warnings on when compiling NanoGUI on Windows */ +# pragma warning(disable : 4127) // warning C4127: conditional expression is constant +# pragma warning(disable : 4244) // warning C4244: conversion from X to Y, possible loss of data +# endif +# pragma warning(disable : 4251) // warning C4251: class X needs to have dll-interface to be used by clients of class Y +# pragma warning(disable : 4714) // warning C4714: function X marked as __forceinline not inlined +# pragma warning(disable : 4127) // warning C4127: conditional expression is constant +#endif + #include #include #include @@ -85,16 +96,6 @@ #define NANOGUI_FORCE_DISCRETE_GPU() #endif -#if defined(_WIN32) -#if defined(NANOGUI_BUILD) -/* Quench a few warnings on when compiling NanoGUI on Windows */ -#pragma warning(disable : 4127) // warning C4127: conditional expression is constant -#pragma warning(disable : 4244) // warning C4244: conversion from X to Y, possible loss of data -#endif -#pragma warning(disable : 4251) // warning C4251: class X needs to have dll-interface to be used by clients of class Y -#pragma warning(disable : 4714) // warning C4714: function X marked as __forceinline not inlined -#endif - // These will produce broken links in the docs build #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/common.cpp b/src/common.cpp index 24540f196c..74b178a967 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -12,7 +12,7 @@ #include #if defined(_WIN32) -#include +# include #endif #include @@ -22,9 +22,9 @@ #include #if !defined(_WIN32) - #include - #include - #include +# include +# include +# include #endif NAMESPACE_BEGIN(nanogui) diff --git a/src/screen.cpp b/src/screen.cpp index 00e603d8df..2a2634f07a 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -376,8 +376,8 @@ void Screen::drawWidgets() { glfwGetWindowSize(mGLFWWindow, &mSize[0], &mSize[1]); #if defined(_WIN32) || defined(__linux__) - mSize = (mSize / mPixelRatio).cast(); - mFBSize = (mSize * mPixelRatio).cast(); + mSize = (mSize.cast() / mPixelRatio).cast(); + mFBSize = (mSize.cast() * mPixelRatio).cast(); #else /* Recompute pixel ratio on OSX */ if (mSize[0])