aboutsummaryrefslogtreecommitdiff
path: root/ports/openvdb/UseGLEWOnWindowsForViewer.patch
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-11-25 14:16:49 -0800
committerGitHub <noreply@github.com>2017-11-25 14:16:49 -0800
commit6b64a9adb606ad442e71ba562efd17d42baee3a0 (patch)
tree613d82ab0009c0e37c754aa6a076f67b4f51180e /ports/openvdb/UseGLEWOnWindowsForViewer.patch
parent8b591b2c439727e8c02fbd230de65207f0a244c2 (diff)
parent7c6fb6081b461a8d546a76ea38bd3f0300111458 (diff)
downloadvcpkg-6b64a9adb606ad442e71ba562efd17d42baee3a0.tar.gz
vcpkg-6b64a9adb606ad442e71ba562efd17d42baee3a0.zip
Merge pull request #2237 from kypp/openvdb
new port: openvdb
Diffstat (limited to 'ports/openvdb/UseGLEWOnWindowsForViewer.patch')
-rw-r--r--ports/openvdb/UseGLEWOnWindowsForViewer.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/ports/openvdb/UseGLEWOnWindowsForViewer.patch b/ports/openvdb/UseGLEWOnWindowsForViewer.patch
new file mode 100644
index 000000000..bfa29c46c
--- /dev/null
+++ b/ports/openvdb/UseGLEWOnWindowsForViewer.patch
@@ -0,0 +1,60 @@
+diff --git a/openvdb/viewer/ClipBox.h b/openvdb/viewer/ClipBox.h
+index b792491..d2f50cc 100644
+--- a/openvdb/viewer/ClipBox.h
++++ b/openvdb/viewer/ClipBox.h
+@@ -36,6 +36,8 @@
+ #if defined(__APPLE__) || defined(MACOSX)
+ #include <OpenGL/gl.h>
+ #include <OpenGL/glu.h>
++#elif defined(WIN32)
++#include <GL/glew.h>
+ #else
+ #include <GL/gl.h>
+ #include <GL/glu.h>
+diff --git a/openvdb/viewer/Font.h b/openvdb/viewer/Font.h
+index 6e79704..566cfbd 100644
+--- a/openvdb/viewer/Font.h
++++ b/openvdb/viewer/Font.h
+@@ -36,6 +36,8 @@
+ #if defined(__APPLE__) || defined(MACOSX)
+ #include <OpenGL/gl.h>
+ #include <OpenGL/glu.h>
++#elif defined(WIN32)
++#include <GL/glew.h>
+ #else
+ #include <GL/gl.h>
+ #include <GL/glu.h>
+diff --git a/openvdb/viewer/RenderModules.h b/openvdb/viewer/RenderModules.h
+index f4745d9..339dfc3 100644
+--- a/openvdb/viewer/RenderModules.h
++++ b/openvdb/viewer/RenderModules.h
+@@ -43,6 +43,8 @@
+ #if defined(__APPLE__) || defined(MACOSX)
+ #include <OpenGL/gl.h>
+ #include <OpenGL/glu.h>
++#elif defined(WIN32)
++#include <GL/glew.h>
+ #else
+ #include <GL/gl.h>
+ #include <GL/glu.h>
+diff --git a/openvdb/viewer/Viewer.cc b/openvdb/viewer/Viewer.cc
+index 307aa2b..8b79358 100644
+--- a/openvdb/viewer/Viewer.cc
++++ b/openvdb/viewer/Viewer.cc
+@@ -540,7 +540,15 @@ ViewerImpl::open(int width, int height)
+ std::shared_ptr<GLFWwindow> curWindow(
+ glfwGetCurrentContext(), glfwMakeContextCurrent);
+ glfwMakeContextCurrent(mWindow);
+- BitmapFont13::initialize();
++ BitmapFont13::initialize();
++#ifdef WIN32
++ if (glewInit() == GLEW_OK) {
++ OPENVDB_LOG_DEBUG_RUNTIME("initialized GLEW from thread "
++ << boost::this_thread::get_id());
++ } else {
++ OPENVDB_LOG_ERROR("GLEW initialization failed");
++ }
++#endif
+ }
+ }
+ mCamera->setWindow(mWindow);