Skip to content

Commit

Permalink
Adapt to Magnum changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Mar 13, 2020
1 parent 5eb7916 commit a26f0ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/Magnum/BulletIntegration/DebugDraw.cpp
Expand Up @@ -124,9 +124,10 @@ void DebugDraw::flushLines() {
_buffer.setData(_bufferData, GL::BufferUsage::DynamicDraw);

/* Update shader and draw */
_shader.setTransformationProjectionMatrix(_transformationProjectionMatrix);
_mesh.setCount(_bufferData.size()/2)
.draw(_shader);
_mesh.setCount(_bufferData.size()/2);
_shader
.setTransformationProjectionMatrix(_transformationProjectionMatrix)
.draw(_mesh);

/* Clear buffer to receive new data */
arrayResize(_bufferData, 0);
Expand Down
7 changes: 3 additions & 4 deletions src/Magnum/ImGuiIntegration/Context.cpp
Expand Up @@ -320,9 +320,6 @@ void Context::drawFrame() {
for(std::int_fast32_t c = 0; c < cmdList->CmdBuffer.Size; ++c) {
const ImDrawCmd* pcmd = &cmdList->CmdBuffer[c];

auto userTexture = static_cast<GL::Texture2D*>(pcmd->TextureId);
_shader.bindTexture(*userTexture);

GL::Renderer::setScissor(Range2Di{Range2D{
{pcmd->ClipRect.x, fbSize.y() - pcmd->ClipRect.w},
{pcmd->ClipRect.z, fbSize.y() - pcmd->ClipRect.y}}
Expand All @@ -336,7 +333,9 @@ void Context::drawFrame() {

indexBufferOffset += pcmd->ElemCount;

_mesh.draw(_shader);
_shader
.bindTexture(*static_cast<GL::Texture2D*>(pcmd->TextureId))
.draw(_mesh);
}
}

Expand Down

0 comments on commit a26f0ea

Please sign in to comment.