Support retina resolution.

This commit is contained in:
Syoyo Fujita
2016-05-29 16:30:54 +09:00
parent 5f4a557d69
commit 629f1825c5
2 changed files with 6 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
solution "objview"
-- location ( "build" )
configurations { "Debug", "Release" }
configurations { "Release", "Debug" }
platforms {"native", "x64", "x32"}
project "objview"

View File

@@ -292,8 +292,11 @@ bool LoadObjAndConvert(float bmin[3], float bmax[3], std::vector<DrawObject>& dr
void reshapeFunc(GLFWwindow* window, int w, int h)
{
printf("reshape\n");
glViewport(0, 0, w, h);
int fb_w, fb_h;
// Get actual framebuffer size.
glfwGetFramebufferSize(window, &fb_w, &fb_h);
glViewport(0, 0, fb_w, fb_h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0, (float)w / (float)h, 0.01f, 100.0f);