From b6a067678ab9e225647b256595d54dde2ce6f2f5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 23 Oct 2022 20:49:14 +0200 Subject: a --- draw/wireframe-box.hpp | 2 ++ draw/wireframe-mesh.cpp | 7 ++++--- draw/wireframe-mesh.hpp | 4 ---- draw/wireframe-quad.hpp | 2 ++ editor/app.hpp | 19 +++++++++++++++++++ main/CMakeLists.txt | 3 +-- main/draw.cpp | 7 ++++--- main/events.cpp | 4 ++++ main/floormat.hpp | 8 ++++---- main/main.cpp | 2 ++ 10 files changed, 42 insertions(+), 16 deletions(-) diff --git a/draw/wireframe-box.hpp b/draw/wireframe-box.hpp index 998ad92c..b187dc83 100644 --- a/draw/wireframe-box.hpp +++ b/draw/wireframe-box.hpp @@ -1,4 +1,6 @@ #pragma once +#include +#include #include #include diff --git a/draw/wireframe-mesh.cpp b/draw/wireframe-mesh.cpp index 3fc53c6c..1304f141 100644 --- a/draw/wireframe-mesh.cpp +++ b/draw/wireframe-mesh.cpp @@ -1,12 +1,13 @@ #include "wireframe-mesh.hpp" #include "shaders/tile-shader.hpp" -#include +//#include #include +#include #include -#include +//#include #include #include -#include +//#include #include namespace floormat::wireframe diff --git a/draw/wireframe-mesh.hpp b/draw/wireframe-mesh.hpp index 9a8e90c7..f03659d3 100644 --- a/draw/wireframe-mesh.hpp +++ b/draw/wireframe-mesh.hpp @@ -1,10 +1,6 @@ #pragma once #include "tile-defs.hpp" -#include -#include -#include -#include #include #include #include "Magnum/GL/Texture.h" diff --git a/draw/wireframe-quad.hpp b/draw/wireframe-quad.hpp index c2679781..ccefa000 100644 --- a/draw/wireframe-quad.hpp +++ b/draw/wireframe-quad.hpp @@ -1,8 +1,10 @@ #pragma once +#include #include #include #include +#include namespace floormat::wireframe { diff --git a/editor/app.hpp b/editor/app.hpp index e69de29b..0b369936 100644 --- a/editor/app.hpp +++ b/editor/app.hpp @@ -0,0 +1,19 @@ +#pragma once +#include "draw/wireframe-mesh.hpp" +#include "draw/wireframe-quad.hpp" +#include "draw/wireframe-box.hpp" +#include "main/floormat-app.hpp" + +namespace floormat { + +struct app final : floormat_app +{ + app(); + ~app() override; + +private: + wireframe_mesh _wireframe_quad; + wireframe_mesh _wireframe_box; +}; + +} // namespace floormat diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 81a67fee..77538920 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,7 +1,7 @@ file(GLOB sources "*.cpp" CONFIGURE_ARGS) link_libraries(${PROJECT_NAME}) -link_libraries(Magnum::Sdl2Application Magnum::Trade) +link_libraries(Magnum::Sdl2Application Corrade::Containers Magnum::GL Magnum::Trade) link_libraries(MagnumIntegration::ImGui) add_library(${PROJECT_NAME}-main STATIC "${sources}") @@ -9,4 +9,3 @@ add_library(${PROJECT_NAME}-main STATIC "${sources}") if(FLOORMAT_PRECOMPILED-HEADERS) target_precompile_headers(${PROJECT_NAME}-main PRIVATE precomp.hpp) endif() - diff --git a/main/draw.cpp b/main/draw.cpp index cc9e85d3..8c6c3e64 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -8,6 +8,7 @@ namespace floormat { +#if 0 void floormat::drawEvent() { if (const float dt = timeline.previousFrameDuration(); dt > 0) @@ -49,14 +50,14 @@ void floormat::drawEvent() redraw(); timeline.nextFrame(); } - +#endif void floormat::draw_msaa() { const with_shifted_camera_offset o{_shader, BASE_X, BASE_Y}; draw_world(); draw_cursor_tile(); } - +#if 0 void floormat::draw_world() { auto foo = get_draw_bounds(); @@ -82,7 +83,7 @@ void floormat::draw_world() _wall_mesh.draw(_shader, *_world[c]); } } - +#endif void floormat::draw_wireframe_quad(global_coords pos) { constexpr float LINE_WIDTH = 2; diff --git a/main/events.cpp b/main/events.cpp index 989406ba..242e890e 100644 --- a/main/events.cpp +++ b/main/events.cpp @@ -6,6 +6,7 @@ namespace floormat { +#if 0 void main_impl::viewportEvent(Platform::Sdl2Application::ViewportEvent& event) { fm_assert(event.framebufferSize() == event.windowSize()); @@ -29,6 +30,7 @@ void main_impl::mouseReleaseEvent(Platform::Sdl2Application::MouseEvent& event) return event.setAccepted(); do_mouse_release((int)event.button()); } +#endif void main_impl::mouseMoveEvent(Platform::Sdl2Application::MouseMoveEvent& event) { @@ -42,6 +44,7 @@ void main_impl::mouseMoveEvent(Platform::Sdl2Application::MouseMoveEvent& event) do_mouse_move(*_cursor_tile); } +#if 0 void main_impl::mouseScrollEvent(Platform::Sdl2Application::MouseScrollEvent& event) { if (_imgui.handleMouseScrollEvent(event)) @@ -94,6 +97,7 @@ void main_impl::anyEvent(SDL_Event& event) std::fputs("", stdout); break; // put breakpoint here } } +#endif void main_impl::event_focus_out() // TODO move to app { diff --git a/main/floormat.hpp b/main/floormat.hpp index cc73c459..ce9e1b38 100644 --- a/main/floormat.hpp +++ b/main/floormat.hpp @@ -12,12 +12,12 @@ enum class fm_log_level : unsigned char { quiet, normal, verbose, }; struct fm_options final { Magnum::Math::Vector2 resolution{1024, 768}; - Containers::String title{"Test"}; - Containers::String disabled_extensions; // TODO + Corrade::Containers::String title{"Test"}; + Corrade::Containers::String disabled_extensions; // TODO std::uint8_t msaa_samples = 4; fm_tristate vsync = fm_tristate::maybe; - fm_gpu_debug gpu_debug = fm_gpu_debug::on; // TODO - fm_log_level log_level = fm_log_level::normal; // TODO + fm_gpu_debug gpu_debug = fm_gpu_debug::on; + fm_log_level log_level = fm_log_level::normal; std::uint8_t resizable : 1 = true, fullscreen : 1 = false, fullscreen_desktop : 1 = false, diff --git a/main/main.cpp b/main/main.cpp index 37e7164b..7ffc1a28 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -12,6 +12,7 @@ namespace floormat { +#if 0 int floormat::run_from_argv(int argc, char** argv) { Corrade::Utility::Arguments args{}; @@ -83,6 +84,7 @@ void floormat::recalc_viewport(Vector2i size) _msaa_framebuffer.attachRenderbuffer(GL::Framebuffer::ColorAttachment{0}, _msaa_renderbuffer); #endif } +#endif } // namespace floormat -- cgit v1.2.3