Support retina resolution.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
solution "objview"
|
solution "objview"
|
||||||
-- location ( "build" )
|
-- location ( "build" )
|
||||||
configurations { "Debug", "Release" }
|
configurations { "Release", "Debug" }
|
||||||
platforms {"native", "x64", "x32"}
|
platforms {"native", "x64", "x32"}
|
||||||
|
|
||||||
project "objview"
|
project "objview"
|
||||||
|
|||||||
@@ -292,8 +292,11 @@ bool LoadObjAndConvert(float bmin[3], float bmax[3], std::vector<DrawObject>& dr
|
|||||||
|
|
||||||
void reshapeFunc(GLFWwindow* window, int w, int h)
|
void reshapeFunc(GLFWwindow* window, int w, int h)
|
||||||
{
|
{
|
||||||
printf("reshape\n");
|
int fb_w, fb_h;
|
||||||
glViewport(0, 0, w, h);
|
// Get actual framebuffer size.
|
||||||
|
glfwGetFramebufferSize(window, &fb_w, &fb_h);
|
||||||
|
|
||||||
|
glViewport(0, 0, fb_w, fb_h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
gluPerspective(45.0, (float)w / (float)h, 0.01f, 100.0f);
|
gluPerspective(45.0, (float)w / (float)h, 0.01f, 100.0f);
|
||||||
|
|||||||
Reference in New Issue
Block a user