aboutsummaryrefslogtreecommitdiff
path: root/ports/openvdb/UseGLEWOnWindowsForViewer.patch
blob: bfa29c46c3805fd97b5e27e6d8cdcb69c1fe18b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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);