/** * Window has changed size, or has just been created. In either case, we need to use the window * dimensions to set the viewport and the projection matrix. */ void ChangeSize(int w, int h) { glViewport(0, 0, w, h); transformPipeline.setMatrixStacks(modelViewMatrix, projectionMatrix); viewFrustum.setPerspective(35.0f, float(w) / float(h), 1.0f, 100.0f); projectionMatrix.setMatrix(viewFrustum.GetProjectionMatrix()); modelViewMatrix.identity(); }
/** * Window has changed size, or has just been created. In either case, we need to use the window * dimensions to set the viewport and the projection matrix. */ void ChangeSize(int w, int h) { glViewport(0, 0, w, h); transformPipeline.setMatrixStacks(modelViewMatrix, projectionMatrix); modelViewMatrix.identity(); screenWidth = w; screenHeight = h; GenerateOrtho2DMat(w, h, hdrTexturesWidth[curHDRTex], hdrTexturesHeight[curHDRTex]); }
/** * Window has changed size, or has just been created. In either case, we need to use the window * dimensions to set the viewport and the projection matrix. */ void ChangeSize(int w, int h) { // Prevent a divide by zero if ( h == 0 ) { h = 1; } // Set viewport to window dimensions glViewport(0, 0, w, h); GLfloat fAspect = (GLfloat)w/(GLfloat)h; // Produce the perspective projection viewFrustum.setPerspective(80.0f, fAspect, 1.0f, 120.0f); projectionMatrix.setMatrix(viewFrustum.GetProjectionMatrix()); transformPipeline.setMatrixStacks(modelViewMatrix, projectionMatrix); }
/** * Window has changed size, or has just been created. In either case, we need to use the window * dimensions to set the viewport and the projection matrix. */ void ChangeSize(int w, int h) { glViewport(0, 0, w, h); transformPipeline.setMatrixStacks(modelViewMatrix, projectionMatrix); viewFrustum.setPerspective(35.0f, float(w) / float(h), 1.0f, 100.0f); projectionMatrix.setMatrix(viewFrustum.GetProjectionMatrix()); modelViewMatrix.identity(); GenerateOrtho2DMat(w, h); screenWidth = w; screenHeight = h; // resize texture glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, depthTextureName); glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 8, GL_DEPTH_COMPONENT24, w, h, GL_FALSE); glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, msTexture[0]); glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 8, GL_RGBA8, w, h, GL_FALSE); }