diff --git a/btgui/GwenOpenGLTest/premake4.lua b/btgui/GwenOpenGLTest/premake4.lua index 8146c80b7..27e027a2f 100644 --- a/btgui/GwenOpenGLTest/premake4.lua +++ b/btgui/GwenOpenGLTest/premake4.lua @@ -42,8 +42,6 @@ "../../src/Bullet3Common/b3Logging.h", "../../src/Bullet3Common/b3Logging.cpp", "../../src/Bullet3Common/b3AlignedAllocator.cpp", - "../../btgui/Timing/b3Quickprof.cpp", - "../../btgui/Timing/b3Quickprof.h", "../../btgui/Timing/b3Clock.cpp", "../../btgui/Timing/b3Clock.h", "**.cpp", diff --git a/btgui/OpenGLWindow/GLInstancingRenderer.cpp b/btgui/OpenGLWindow/GLInstancingRenderer.cpp index 63273be62..a5bf00803 100644 --- a/btgui/OpenGLWindow/GLInstancingRenderer.cpp +++ b/btgui/OpenGLWindow/GLInstancingRenderer.cpp @@ -1192,6 +1192,10 @@ void GLInstancingRenderer::renderSceneInternal(int renderMode) // glEnable(GL_DEPTH_TEST); + GLint dims[4]; + glGetIntegerv(GL_VIEWPORT, dims); + //we need to get the viewport dims, because on Apple Retina the viewport dimension is different from screenWidth + //printf("dims=%d,%d,%d,%d\n",dims[0],dims[1],dims[2],dims[3]); // Accept fragment if it closer to the camera than the former one //glDepthFunc(GL_LESS); @@ -1504,7 +1508,8 @@ void GLInstancingRenderer::renderSceneInternal(int renderMode) { // writeTextureToPng(shadowMapWidth,shadowMapHeight,"shadowmap.png",4); m_data->m_shadowMap->disable(); - glViewport(0,0,m_screenWidth,m_screenHeight); + glViewport(dims[0],dims[1],dims[2],dims[3]); + } err = glGetError();