summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-23 20:49:14 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-23 20:49:14 +0200
commitb6a067678ab9e225647b256595d54dde2ce6f2f5 (patch)
tree5511af38d35cea0cfaf59fffe9b513d46820f0b2
parent4341fb36784a9da7b519d81d78e8df983816d791 (diff)
a
-rw-r--r--draw/wireframe-box.hpp2
-rw-r--r--draw/wireframe-mesh.cpp7
-rw-r--r--draw/wireframe-mesh.hpp4
-rw-r--r--draw/wireframe-quad.hpp2
-rw-r--r--editor/app.hpp19
-rw-r--r--main/CMakeLists.txt3
-rw-r--r--main/draw.cpp7
-rw-r--r--main/events.cpp4
-rw-r--r--main/floormat.hpp8
-rw-r--r--main/main.cpp2
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 <array>
+#include <Corrade/Containers/ArrayViewStl.h>
#include <Magnum/Math/Vector3.h>
#include <Magnum/GL/Mesh.h>
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 <Corrade/Containers/ArrayViewStl.h>
+//#include <Corrade/Containers/ArrayViewStl.h>
#include <Corrade/Containers/Array.h>
+#include <Corrade/Containers/ArrayView.h>
#include <Magnum/GL/TextureFormat.h>
-#include <Magnum/ImageFlags.h>
+//#include <Magnum/ImageFlags.h>
#include <Magnum/ImageView.h>
#include <Magnum/PixelFormat.h>
-#include <Magnum/PixelStorage.h>
+//#include <Magnum/PixelStorage.h>
#include <Magnum/Trade/ImageData.h>
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 <array>
-#include <utility>
-#include <Corrade/Containers/ArrayView.h>
-#include <Magnum/Math/Vector2.h>
#include <Magnum/GL/Buffer.h>
#include <Magnum/GL/Mesh.h>
#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 <array>
#include <Magnum/Math/Vector2.h>
#include <Magnum/Math/Vector3.h>
#include <Magnum/GL/Mesh.h>
+#include <Corrade/Containers/ArrayViewStl.h>
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_quad;
+ wireframe_mesh<wireframe::box> _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<int> 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