vdb_view window problem

133 views
Skip to first unread message

Tomer Weiss

unread,
May 28, 2015, 5:53:32 PM5/28/15
to openvd...@googlegroups.com
Hi all,

 I installed OpenVdb on Mac OS X Yosemite ( MacBook Pro 15 inch with Nvidia card), with fresh installations from mac ports of all the required packages (boost,glfw...)
 However when I run ./view_vdb I get the current window, notice that the portion of the window which in which I can see the bunny is not expanding to the entire window:

Thanks in advance!

Rafael Campos

unread,
May 29, 2015, 1:54:31 AM5/29/15
to openvd...@googlegroups.com
Hey,

That happens because now in OS X the window and the display framebuffer can be of different sizes. 

I'll code it up more cleanly later, but a quick fix specific to OS X is to apply the following one-line changes: 

diff --git a/openvdb/viewer/Camera.cc b/openvdb/viewer/Camera.cc
index 40cd61d..66e03db 100644
--- a/openvdb/viewer/Camera.cc
+++ b/openvdb/viewer/Camera.cc
@@ -129,7 +129,8 @@ Camera::aim()
     // Get the window size
     int width, height;
 #if GLFW_VERSION_MAJOR >= 3
-    glfwGetWindowSize(mWindow, &width, &height);
+    glfwGetFramebufferSize(mWindow, &width, &height);
 #else
     glfwGetWindowSize(&width, &height);
 #endif



diff --git a/openvdb/viewer/Viewer.cc b/openvdb/viewer/Viewer.cc
index 140ee90..1eeade9 100644
--- a/openvdb/viewer/Viewer.cc
+++ b/openvdb/viewer/Viewer.cc
@@ -812,7 +813,8 @@ ViewerImpl::render()
 
         int width, height;
 #if GLFW_VERSION_MAJOR >= 3
-        glfwGetWindowSize(mWindow, &width, &height);
+        glfwGetFramebufferSize(mWindow, &width, &height);
 #else
         glfwGetWindowSize(&width, &height);
 #endif

-Rafael. 

Tomer Weiss

unread,
May 29, 2015, 5:08:09 AM5/29/15
to openvd...@googlegroups.com
Thanks for the prompt solution! Fix worked for me :-)
Reply all
Reply to author
Forward
0 new messages