From a26f0ea3324c1224546a6c8c5b893de92025cf24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 13 Mar 2020 13:19:14 +0100 Subject: [PATCH] Adapt to Magnum changes. --- src/Magnum/BulletIntegration/DebugDraw.cpp | 7 ++++--- src/Magnum/ImGuiIntegration/Context.cpp | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Magnum/BulletIntegration/DebugDraw.cpp b/src/Magnum/BulletIntegration/DebugDraw.cpp index e69bc1051..8c32e90cf 100644 --- a/src/Magnum/BulletIntegration/DebugDraw.cpp +++ b/src/Magnum/BulletIntegration/DebugDraw.cpp @@ -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); diff --git a/src/Magnum/ImGuiIntegration/Context.cpp b/src/Magnum/ImGuiIntegration/Context.cpp index 13b180473..c58e358e0 100644 --- a/src/Magnum/ImGuiIntegration/Context.cpp +++ b/src/Magnum/ImGuiIntegration/Context.cpp @@ -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(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}} @@ -336,7 +333,9 @@ void Context::drawFrame() { indexBufferOffset += pcmd->ElemCount; - _mesh.draw(_shader); + _shader + .bindTexture(*static_cast(pcmd->TextureId)) + .draw(_mesh); } }