diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-20 15:23:50 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-20 15:23:50 +0200 |
commit | 1ec8e253172112e0f2bb98426c8d0ad900addfe7 (patch) | |
tree | 9f7f6ea3bda9eef2ef34e395de466b6761a0480f | |
parent | b2f30235c9a2b11adc31567b044beb04ec7ac3e6 (diff) |
a
-rw-r--r-- | draw/floor-mesh.cpp | 2 | ||||
-rw-r--r-- | draw/wall-mesh.cpp | 2 | ||||
-rw-r--r-- | draw/wireframe-mesh.hpp | 2 | ||||
-rw-r--r-- | main/app.hpp | 2 | ||||
-rw-r--r-- | main/draw.cpp | 2 | ||||
-rw-r--r-- | main/imgui-raii.hpp | 2 | ||||
-rw-r--r-- | main/imgui.cpp | 4 |
7 files changed, 9 insertions, 7 deletions
diff --git a/draw/floor-mesh.cpp b/draw/floor-mesh.cpp index 3b253966..7fef5109 100644 --- a/draw/floor-mesh.cpp +++ b/draw/floor-mesh.cpp @@ -32,7 +32,7 @@ void floor_mesh::set_tile(quad_data& data, tile& x) void floor_mesh::draw(tile_shader& shader, chunk& c) { - _vertex_buffer.setData({nullptr, sizeof(quad_data) * TILE_COUNT}, Magnum::GL::BufferUsage::DynamicDraw); // orphan the buffer + //_vertex_buffer.setData({nullptr, sizeof(quad_data) * TILE_COUNT}, Magnum::GL::BufferUsage::DynamicDraw); // orphan the buffer std::array<quad_data, TILE_COUNT> data; for (auto& [x, idx, pt] : c) { set_tile(data[idx], x); diff --git a/draw/wall-mesh.cpp b/draw/wall-mesh.cpp index c15be873..dfbb739e 100644 --- a/draw/wall-mesh.cpp +++ b/draw/wall-mesh.cpp @@ -39,7 +39,7 @@ void wall_mesh::maybe_add_tile(vertex_array& data, texture_array& textures, tile void wall_mesh::draw(tile_shader& shader, chunk& c) { - _vertex_buffer.setData({nullptr, sizeof(vertex_array)}, Magnum::GL::BufferUsage::DynamicDraw); // orphan the buffer + //_vertex_buffer.setData({nullptr, sizeof(vertex_array)}, Magnum::GL::BufferUsage::DynamicDraw); // orphan the buffer texture_array textures = {}; { vertex_array data; diff --git a/draw/wireframe-mesh.hpp b/draw/wireframe-mesh.hpp index 40471f8d..67b35ecd 100644 --- a/draw/wireframe-mesh.hpp +++ b/draw/wireframe-mesh.hpp @@ -55,7 +55,7 @@ wireframe_mesh<T>::wireframe_mesh() : template <wireframe::traits T> void wireframe_mesh<T>::draw(tile_shader& shader, T x) { - _vertex_buffer.setData({nullptr, sizeof(Vector3) * T::num_vertices}, GL::BufferUsage::DynamicDraw); // orphan the buffer + //_vertex_buffer.setData({nullptr, sizeof(Vector3) * T::num_vertices}, GL::BufferUsage::DynamicDraw); // orphan the buffer _vertex_buffer.setSubData(0, x.make_vertex_array()); x.on_draw(); mesh_base::draw(shader); diff --git a/main/app.hpp b/main/app.hpp index 96400cda..a4da922c 100644 --- a/main/app.hpp +++ b/main/app.hpp @@ -70,7 +70,7 @@ private: void draw_editor_pane(tile_type& type, float main_menu_height); void draw_fps(); void draw_cursor_coord(); - void display_menu(); + void render_menu(); void debug_callback(GL::DebugOutput::Source src, GL::DebugOutput::Type type, UnsignedInt id, GL::DebugOutput::Severity severity, const std::string& str) const; diff --git a/main/draw.cpp b/main/draw.cpp index ddeccc23..5eeb413c 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -37,7 +37,7 @@ void app::drawEvent() draw_cursor_tile(); } - display_menu(); + render_menu(); swapBuffers(); redraw(); diff --git a/main/imgui-raii.hpp b/main/imgui-raii.hpp index 85512b2d..9f446bf2 100644 --- a/main/imgui-raii.hpp +++ b/main/imgui-raii.hpp @@ -2,7 +2,9 @@ #include <Corrade/Containers/StringView.h> #include <Magnum/Math/Color.h> +#ifndef __CLION_IDE__ #include <imgui.h> +#endif namespace floormat::imgui { diff --git a/main/imgui.cpp b/main/imgui.cpp index e1790968..0a70149b 100644 --- a/main/imgui.cpp +++ b/main/imgui.cpp @@ -1,7 +1,7 @@ #include "app.hpp" #include <Magnum/GL/Renderer.h> -#ifndef __CLION_IDE__ #include "imgui-raii.hpp" +#ifndef __CLION_IDE__ #include <Magnum/ImGuiIntegration/Integration.h> #endif @@ -9,7 +9,7 @@ namespace floormat { using namespace floormat::imgui; -void app::display_menu() +void app::render_menu() { GL::Renderer::setBlendEquation(GL::Renderer::BlendEquation::Add, GL::Renderer::BlendEquation::Add); GL::Renderer::setBlendFunction(GL::Renderer::BlendFunction::SourceAlpha, GL::Renderer::BlendFunction::OneMinusSourceAlpha); |