Skip to content

Commit 134f416

Browse files
authored
Merge pull request #138 from resibots/new_magnum
[magnum]: do not use deprecated Magnum functions
2 parents 4e62a9d + 1133f0c commit 134f416

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/robot_dart/gui/magnum/base_application.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ namespace robot_dart {
157157
// _lights.push_back(light);
158158

159159
/* Initialize 3D axis visualization mesh */
160-
_3D_axis_shader.reset(new Magnum::Shaders::VertexColor3D);
160+
_3D_axis_shader.reset(new Magnum::Shaders::VertexColorGL3D);
161161
_3D_axis_mesh.reset(new Magnum::GL::Mesh);
162162

163-
_background_shader.reset(new Magnum::Shaders::Flat2D);
163+
_background_shader.reset(new Magnum::Shaders::FlatGL2D);
164164
_background_mesh.reset(new Magnum::GL::Mesh{Magnum::MeshTools::compile(Magnum::Primitives::squareSolid())});
165165

166166
Magnum::Trade::MeshData axis_data = Magnum::Primitives::axis3D();
@@ -174,7 +174,7 @@ namespace robot_dart {
174174

175175
_3D_axis_mesh->setPrimitive(Magnum::GL::MeshPrimitive::Lines)
176176
.setCount(axis_data.indexCount())
177-
.addVertexBuffer(std::move(axis_vertices), 0, Magnum::Shaders::VertexColor3D::Position{}, Magnum::Shaders::VertexColor3D::Color4{})
177+
.addVertexBuffer(std::move(axis_vertices), 0, Magnum::Shaders::VertexColorGL3D::Position{}, Magnum::Shaders::VertexColorGL3D::Color4{})
178178
.setIndexBuffer(std::move(axis_indices), 0, compressed.second);
179179

180180
/* Initialize text visualization */
@@ -197,7 +197,7 @@ namespace robot_dart {
197197
_text_indices.reset(new Magnum::GL::Buffer);
198198

199199
/* Initialize text shader */
200-
_text_shader.reset(new Magnum::Shaders::DistanceFieldVector2D);
200+
_text_shader.reset(new Magnum::Shaders::DistanceFieldVectorGL2D);
201201
_text_shader->bindVectorTexture(_glyph_cache->texture());
202202
}
203203
}

src/robot_dart/gui/magnum/base_application.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ namespace robot_dart {
112112
};
113113

114114
struct DebugDrawData {
115-
Magnum::Shaders::VertexColor3D* axes_shader;
115+
Magnum::Shaders::VertexColorGL3D* axes_shader;
116116
Magnum::GL::Mesh* axes_mesh;
117-
Magnum::Shaders::Flat2D* background_shader;
117+
Magnum::Shaders::FlatGL2D* background_shader;
118118
Magnum::GL::Mesh* background_mesh;
119119

120-
Magnum::Shaders::DistanceFieldVector2D* text_shader;
120+
Magnum::Shaders::DistanceFieldVectorGL2D* text_shader;
121121
Magnum::GL::Buffer* text_vertices;
122122
Magnum::GL::Buffer* text_indices;
123123
Magnum::Text::AbstractFont* font;
@@ -227,12 +227,12 @@ namespace robot_dart {
227227

228228
/* Debug visualization */
229229
std::unique_ptr<Magnum::GL::Mesh> _3D_axis_mesh;
230-
std::unique_ptr<Magnum::Shaders::VertexColor3D> _3D_axis_shader;
230+
std::unique_ptr<Magnum::Shaders::VertexColorGL3D> _3D_axis_shader;
231231
std::unique_ptr<Magnum::GL::Mesh> _background_mesh;
232-
std::unique_ptr<Magnum::Shaders::Flat2D> _background_shader;
232+
std::unique_ptr<Magnum::Shaders::FlatGL2D> _background_shader;
233233

234234
/* Text visualization */
235-
std::unique_ptr<Magnum::Shaders::DistanceFieldVector2D> _text_shader;
235+
std::unique_ptr<Magnum::Shaders::DistanceFieldVectorGL2D> _text_shader;
236236
Corrade::PluginManager::Manager<Magnum::Text::AbstractFont> _font_manager;
237237
Corrade::Containers::Pointer<Magnum::Text::DistanceFieldGlyphCache> _glyph_cache;
238238
Corrade::Containers::Pointer<Magnum::Text::AbstractFont> _font;

0 commit comments

Comments
 (0)