Skip to content

Commit

Permalink
Adapt to GL shader renaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed May 1, 2021
1 parent f56b925 commit 73018a6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions doc/changelog-integration.dox
Expand Up @@ -116,8 +116,9 @@ Released 2020-06-27, tagged as
header is not included by any other header to avoid trigerring a full
rebuild when Git commit changes. If Git is not found, only the first two
defines are present.
- @ref ImGuiIntegration now uses Magnum's own @ref Shaders::Flat2D instead of
a custom shader, which finally makes it work on GLES2 and WebGL 1
- @ref ImGuiIntegration now uses Magnum's own @cpp Shaders::Flat2D @ce
instead of a custom shader, which finally makes it work on GLES2 and WebGL
1

@subsection changelog-integration-2020-06-buildsystem Build system

Expand Down
2 changes: 1 addition & 1 deletion src/Magnum/BulletIntegration/DebugDraw.cpp
Expand Up @@ -64,7 +64,7 @@ Debug& operator<<(Debug& debug, const DebugDraw::Mode value) {
}

DebugDraw::DebugDraw(const std::size_t initialBufferCapacity): _mesh{GL::MeshPrimitive::Lines} {
_mesh.addVertexBuffer(_buffer, 0, Shaders::VertexColor3D::Position{}, Shaders::VertexColor3D::Color3{});
_mesh.addVertexBuffer(_buffer, 0, Shaders::VertexColorGL3D::Position{}, Shaders::VertexColorGL3D::Color3{});
arrayReserve(_bufferData, initialBufferCapacity*4);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Magnum/BulletIntegration/DebugDraw.h
Expand Up @@ -36,7 +36,7 @@
#include <Magnum/GL/Buffer.h>
#include <Magnum/GL/Mesh.h>
#include <Magnum/Math/Matrix4.h>
#include <Magnum/Shaders/VertexColor.h>
#include <Magnum/Shaders/VertexColorGL.h>

#include "Magnum/BulletIntegration/Integration.h"

Expand Down Expand Up @@ -136,7 +136,7 @@ class MAGNUM_BULLETINTEGRATION_EXPORT DebugDraw: public btIDebugDraw {
* @param initialBufferCapacity Amount of lines for which to
* reserve memory in the buffer vector.
*
* Sets up @ref Shaders::VertexColor3D, @ref GL::Buffer and
* Sets up @ref Shaders::VertexColorGL3D, @ref GL::Buffer and
* @ref GL::Mesh for physics debug rendering.
*/
explicit DebugDraw(std::size_t initialBufferCapacity = 0);
Expand Down Expand Up @@ -212,7 +212,7 @@ class MAGNUM_BULLETINTEGRATION_EXPORT DebugDraw: public btIDebugDraw {
Modes _mode{};

Matrix4 _transformationProjectionMatrix;
Shaders::VertexColor3D _shader;
Shaders::VertexColorGL3D _shader;

GL::Buffer _buffer;
GL::Mesh _mesh;
Expand Down
12 changes: 6 additions & 6 deletions src/Magnum/ImGuiIntegration/Context.cpp
Expand Up @@ -53,7 +53,7 @@ Context::Context(const Vector2& size, const Vector2i& windowSize, const Vector2i

Context::Context(const Vector2i& size): Context{Vector2{size}, size, size} {}

Context::Context(ImGuiContext& context, const Vector2& size, const Vector2i& windowSize, const Vector2i& framebufferSize): _context{&context}, _shader{Shaders::Flat2D::Flag::Textured|Shaders::Flat2D::Flag::VertexColor} {
Context::Context(ImGuiContext& context, const Vector2& size, const Vector2i& windowSize, const Vector2i& framebufferSize): _context{&context}, _shader{Shaders::FlatGL2D::Flag::Textured|Shaders::FlatGL2D::Flag::VertexColor} {
/* Ensure we use the context we're linked to */
ImGui::SetCurrentContext(&context);

Expand Down Expand Up @@ -98,11 +98,11 @@ Context::Context(ImGuiContext& context, const Vector2& size, const Vector2i& win

_mesh.setPrimitive(GL::MeshPrimitive::Triangles);
_mesh.addVertexBuffer(_vertexBuffer, 0,
Shaders::Flat2D::Position{},
Shaders::Flat2D::TextureCoordinates{},
Shaders::Flat2D::Color4{
Shaders::Flat2D::Color4::DataType::UnsignedByte,
Shaders::Flat2D::Color4::DataOption::Normalized});
Shaders::FlatGL2D::Position{},
Shaders::FlatGL2D::TextureCoordinates{},
Shaders::FlatGL2D::Color4{
Shaders::FlatGL2D::Color4::DataType::UnsignedByte,
Shaders::FlatGL2D::Color4::DataOption::Normalized});

_timeline.start();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Magnum/ImGuiIntegration/Context.h
Expand Up @@ -38,7 +38,7 @@
#include <Magnum/GL/Texture.h>
#include <Magnum/GL/Buffer.h>
#include <Magnum/GL/Mesh.h>
#include <Magnum/Shaders/Flat.h>
#include <Magnum/Shaders/FlatGL.h>

#include "Magnum/ImGuiIntegration/visibility.h"

Expand Down Expand Up @@ -540,7 +540,7 @@ class MAGNUM_IMGUIINTEGRATION_EXPORT Context {

private:
ImGuiContext* _context;
Shaders::Flat2D _shader;
Shaders::FlatGL2D _shader;
GL::Texture2D _texture{NoCreate};
GL::Buffer _vertexBuffer{GL::Buffer::TargetHint::Array};
GL::Buffer _indexBuffer{GL::Buffer::TargetHint::ElementArray};
Expand Down

0 comments on commit 73018a6

Please sign in to comment.