void GLRenderer::reshape(int width, int height) { glViewport(0, 0, width, height); mViewWidth = width; mViewHeight = height; mProjectionMatrix = glm::perspective(45.0f, (float)width/(float)height, 0.1f, 100.0f); mViewMatrix = glm::lookAt(glm::vec3(0,0,3), glm::vec3(0,0,0), glm::vec3(0,1,0)); glm::vec4 fwidth; fwidth = mProjectionMatrix * mViewMatrix * glm::vec4(mViewWidth, mViewHeight, 0, 1); mMouseWidth = fwidth.x /= fwidth.w; mMouseHeight = fwidth.y /= fwidth.w; createFrameBuffers(); }
void GLRenderer::reshape(int width, int height, bool isLive) { glViewport(0, 0, width, height); mViewWidth = width; mViewHeight = height; mHeightDividedByK = height / mK; mWidthDividedByK = width / mK; mProjectionMatrix = glm::perspective(45.0f, (float)width/(float)height, 0.1f, 100.0f); mViewMatrix = glm::lookAt(glm::vec3(0,0,20), glm::vec3(0,0,0), glm::vec3(0,1,0)); computeMaxSampleTapDistance(); if (!isLive){ createFrameBuffers(); } }
void GLSLWaveformRendererSignal::onResize() { createFrameBuffers(); }