| 80 | } |
| 81 | |
| 82 | void TexQuad::Render(glm::mat4* transform) { |
| 83 | float aspect = SceneManager::GetInstance()->GetScreenAspect(); |
| 84 | glm::mat4 orthoMat = glm::ortho(0.0f, aspect, 0.0f, 1.0f); |
| 85 | glm::mat4 modelMat, mat; |
| 86 | |
| 87 | bool hadDepthTest = glIsEnabled(GL_DEPTH_TEST); |
| 88 | glDisable(GL_DEPTH_TEST); |
| 89 | |
| 90 | modelMat = |
| 91 | glm::translate(glm::mat4(1.0f), glm::vec3(mCenterX, mCenterY, 0.0f)); |
| 92 | modelMat = |
| 93 | glm::scale(modelMat, glm::vec3(mScale * mHeight, mScale * mHeight, 0.0f)); |
| 94 | if (transform) { |
| 95 | mat = orthoMat * (*transform) * modelMat; |
| 96 | } else { |
| 97 | mat = orthoMat * modelMat; |
| 98 | } |
| 99 | |
| 100 | mOurShader->BeginRender(mGeom->vbuf); |
| 101 | mOurShader->SetTexture(mTexture); |
| 102 | mOurShader->Render(mGeom->ibuf, &mat); |
| 103 | mOurShader->EndRender(); |
| 104 | |
| 105 | if (hadDepthTest) { |
| 106 | glEnable(GL_DEPTH_TEST); |
| 107 | } |
| 108 | } |
nothing calls this directly
no test coverage detected