From 0a49fb9df26c1a7b5a8a156b32f5ff2bf771e6ac Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 18 Feb 2022 06:14:39 +0100 Subject: rename types --- main.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 6ee11db9..4292076f 100644 --- a/main.cpp +++ b/main.cpp @@ -18,8 +18,8 @@ namespace Magnum::Examples { -struct TexturedQuadExample: Platform::Application { - explicit TexturedQuadExample(const Arguments& arguments); +struct application : Platform::Application { + explicit application(const Arguments& arguments); void drawEvent() override; const Utility::Resource rs{"texturedquad-data"}; @@ -28,7 +28,7 @@ struct TexturedQuadExample: Platform::Application { plugins.loadAndInstantiate("TgaImporter"); GL::Mesh _mesh; - TexturedQuadShader _shader; + tile_shader _shader; atlas_texture atlas = make_atlas("images/tiles.tga", {8, 4}); atlas_texture make_atlas(const std::string& file, Vector2i dims) @@ -43,7 +43,7 @@ struct TexturedQuadExample: Platform::Application { } }; -TexturedQuadExample::TexturedQuadExample(const Arguments& arguments): +application::application(const Arguments& arguments): Platform::Application{arguments, Configuration{} .setTitle("Magnum Textured Quad Example") .setSize({512, 512})} @@ -60,15 +60,13 @@ TexturedQuadExample::TexturedQuadExample(const Arguments& arguments): for (unsigned i = 0; i < std::size(vertices); i++) vertices[i] = { positions[i], texcoords[i] }; - _mesh.setCount(std::size(indices)) - .addVertexBuffer(GL::Buffer{vertices}, 0, - TexturedQuadShader::Position{}, - TexturedQuadShader::TextureCoordinates{}) + _mesh.setCount((int)std::size(indices)) + .addVertexBuffer(GL::Buffer{vertices}, 0, tile_shader::Position{}, tile_shader::TextureCoordinates{}) .setIndexBuffer(GL::Buffer{indices}, 0, GL::MeshIndexType::UnsignedShort); } -void TexturedQuadExample::drawEvent() { +void application::drawEvent() { GL::defaultFramebuffer.clear(GL::FramebufferClear::Color); using namespace Math::Literals; @@ -83,7 +81,7 @@ void TexturedQuadExample::drawEvent() { } // namespace Magnum::Examples -MAGNUM_APPLICATION_MAIN(Magnum::Examples::TexturedQuadExample); +MAGNUM_APPLICATION_MAIN(Magnum::Examples::application); #include -- cgit v1.2.3