| 251 | } |
| 252 | |
| 253 | void window_impl::draw(const std::shared_ptr<AbstractRenderable>& pRenderable) |
| 254 | { |
| 255 | CheckGL("Begin window_impl::draw"); |
| 256 | MakeContextCurrent(this); |
| 257 | mWindow->resetCloseFlag(); |
| 258 | glViewport(0, 0, mWindow->mWidth, mWindow->mHeight); |
| 259 | |
| 260 | const glm::mat4& viewMatrix = mWindow->getViewMatrix(std::make_tuple(1, 1, 0)); |
| 261 | const glm::mat4& orientMatrix = mWindow->getOrientationMatrix(std::make_tuple(1, 1, 0)); |
| 262 | |
| 263 | // clear color and depth buffers |
| 264 | glClearColor(WHITE[0], WHITE[1], WHITE[2], WHITE[3]); |
| 265 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| 266 | |
| 267 | // set colormap call is equivalent to noop for non-image renderables |
| 268 | pRenderable->setColorMapUBOParams(mColorMapUBO, mUBOSize); |
| 269 | pRenderable->render(mID, 0, 0, mWindow->mWidth, mWindow->mHeight, |
| 270 | viewMatrix, orientMatrix); |
| 271 | |
| 272 | mWindow->swapBuffers(); |
| 273 | mWindow->pollEvents(); |
| 274 | CheckGL("End window_impl::draw"); |
| 275 | } |
| 276 | |
| 277 | void window_impl::draw(const int pRows, const int pCols, const int pIndex, |
| 278 | const std::shared_ptr<AbstractRenderable>& pRenderable, |
nothing calls this directly
no test coverage detected