vcpkg/ports/openvdb/UseGLEWOnWindowsForViewer.patch
2017-11-21 19:23:38 +01:00

61 lines
1.9 KiB
Diff

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);