MCPcopy Create free account
hub / github.com/arrayfire/forge / draw

Method draw

src/backend/opengl/window_impl.cpp:253–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253void 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
277void window_impl::draw(const int pRows, const int pCols, const int pIndex,
278 const std::shared_ptr<AbstractRenderable>& pRenderable,

Callers

nothing calls this directly

Calls 9

MakeContextCurrentFunction · 0.85
resetCloseFlagMethod · 0.45
getViewMatrixMethod · 0.45
getOrientationMatrixMethod · 0.45
setColorMapUBOParamsMethod · 0.45
renderMethod · 0.45
swapBuffersMethod · 0.45
pollEventsMethod · 0.45
setOthro2DMethod · 0.45

Tested by

no test coverage detected