summaryrefslogtreecommitdiffhomepage
path: root/draw/wireframe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'draw/wireframe.cpp')
-rw-r--r--draw/wireframe.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/draw/wireframe.cpp b/draw/wireframe.cpp
index 2a41d5c2..7acebc70 100644
--- a/draw/wireframe.cpp
+++ b/draw/wireframe.cpp
@@ -1,13 +1,14 @@
+#include "compat/defs.hpp"
#include "wireframe.hpp"
#include "shaders/tile.hpp"
-//#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/Math/Range.h>
#include <Magnum/ImageView.h>
#include <Magnum/PixelFormat.h>
-//#include <Magnum/PixelStorage.h>
+#include <Magnum/GL/Context.h>
+#include <Magnum/GL/Renderer.h>
+#include <Magnum/GL/TextureFormat.h>
#include <Magnum/Trade/ImageData.h>
namespace floormat::wireframe
@@ -58,4 +59,14 @@ void mesh_base::set_subdata(ArrayView<const void> array)
_vertex_buffer.setSubData(0, array);
}
+void mesh_base::set_line_width(float width)
+{
+ if (GL::Context::current().detectedDriver() == GL::Context::DetectedDriver::Svga3D)
+ return;
+
+ auto range = GL::Renderer::lineWidthRange();
+ if (range.contains(width))
+ GL::Renderer::setLineWidth(width);
+}
+
} // namespace floormat::wireframe