mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 18:27:58 -06:00
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Refactoring to simplify client code of GLModel::Geometry
(cherry picked from commit prusa3d/PrusaSlicer@be6b6590be)
This commit is contained in:
parent
6eed22015a
commit
269fbaa60c
10 changed files with 41 additions and 40 deletions
|
@ -353,8 +353,8 @@ void GLVolume::SinkingContours::update()
|
||||||
const Polygons polygons = union_(slice_mesh(mesh.its, 0.0f, slicing_params));
|
const Polygons polygons = union_(slice_mesh(mesh.its, 0.0f, slicing_params));
|
||||||
for (const ExPolygon& expoly : diff_ex(expand(polygons, float(scale_(HalfWidth))), shrink(polygons, float(scale_(HalfWidth))))) {
|
for (const ExPolygon& expoly : diff_ex(expand(polygons, float(scale_(HalfWidth))), shrink(polygons, float(scale_(HalfWidth))))) {
|
||||||
const std::vector<Vec3d> triangulation = triangulate_expolygon_3d(expoly);
|
const std::vector<Vec3d> triangulation = triangulate_expolygon_3d(expoly);
|
||||||
init_data.vertices.reserve(init_data.vertices.size() + triangulation.size() * GUI::GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(init_data.vertices_count() + triangulation.size());
|
||||||
init_data.indices.reserve(init_data.indices.size() + triangulation.size() * GUI::GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(init_data.indices_count() + triangulation.size());
|
||||||
for (const Vec3d& v : triangulation) {
|
for (const Vec3d& v : triangulation) {
|
||||||
init_data.add_vertex((Vec3f)(v.cast<float>() + 0.015f * Vec3f::UnitZ())); // add a small positive z to avoid z-fighting
|
init_data.add_vertex((Vec3f)(v.cast<float>() + 0.015f * Vec3f::UnitZ())); // add a small positive z to avoid z-fighting
|
||||||
++vertices_counter;
|
++vertices_counter;
|
||||||
|
|
|
@ -431,8 +431,8 @@ void GLCanvas3D::LayersEditing::render_active_object_annotations(const GLCanvas3
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P2T2, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P2T2, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(4 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(4);
|
||||||
init_data.indices.reserve(6 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(6);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
const float l = bar_rect.get_left();
|
const float l = bar_rect.get_left();
|
||||||
|
@ -478,8 +478,8 @@ void GLCanvas3D::LayersEditing::render_profile(const Rect& bar_rect)
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P2, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P2, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.color = ColorRGBA::BLACK();
|
init_data.color = ColorRGBA::BLACK();
|
||||||
init_data.vertices.reserve(2 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(2);
|
||||||
init_data.indices.reserve(2 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(2);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
const float x = bar_rect.get_left() + float(m_slicing_parameters->layer_height) * scale_x;
|
const float x = bar_rect.get_left() + float(m_slicing_parameters->layer_height) * scale_x;
|
||||||
|
@ -499,8 +499,8 @@ void GLCanvas3D::LayersEditing::render_profile(const Rect& bar_rect)
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::LineStrip, GLModel::Geometry::EVertexLayout::P2, GLModel::Geometry::EIndexType::UINT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::LineStrip, GLModel::Geometry::EVertexLayout::P2, GLModel::Geometry::EIndexType::UINT };
|
||||||
init_data.color = ColorRGBA::BLUE();
|
init_data.color = ColorRGBA::BLUE();
|
||||||
init_data.vertices.reserve(m_layer_height_profile.size() * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(m_layer_height_profile.size() / 2);
|
||||||
init_data.indices.reserve(m_layer_height_profile.size() * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(m_layer_height_profile.size() / 2);
|
||||||
|
|
||||||
// vertices + indices
|
// vertices + indices
|
||||||
for (unsigned int i = 0; i < (unsigned int)m_layer_height_profile.size(); i += 2) {
|
for (unsigned int i = 0; i < (unsigned int)m_layer_height_profile.size(); i += 2) {
|
||||||
|
@ -6644,8 +6644,8 @@ void GLCanvas3D::_render_background()
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P2T2, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P2T2, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(4 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(4);
|
||||||
init_data.indices.reserve(6 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(6);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex(Vec2f(-1.0f, -1.0f), Vec2f(0.0f, 0.0f));
|
init_data.add_vertex(Vec2f(-1.0f, -1.0f), Vec2f(0.0f, 0.0f));
|
||||||
|
|
|
@ -118,8 +118,8 @@ namespace GUI {
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::LineLoop, GLModel::Geometry::EVertexLayout::P2, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::LineLoop, GLModel::Geometry::EVertexLayout::P2, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(4 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(4);
|
||||||
init_data.indices.reserve(4 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(4);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex(Vec2f(left, bottom));
|
init_data.add_vertex(Vec2f(left, bottom));
|
||||||
|
|
|
@ -664,8 +664,8 @@ void GLTexture::render_sub_texture(unsigned int tex_id, float left, float right,
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P2T2, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P2T2, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(4 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(4);
|
||||||
init_data.indices.reserve(6 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(6);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex(Vec2f(left, bottom), Vec2f(uvs.left_bottom.u, uvs.left_bottom.v));
|
init_data.add_vertex(Vec2f(left, bottom), Vec2f(uvs.left_bottom.u, uvs.left_bottom.v));
|
||||||
|
|
|
@ -885,8 +885,8 @@ void GLGizmoAdvancedCut::render_cut_plane_and_grabbers()
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.color = { 0.8f, 0.8f, 0.8f, 0.5f };
|
init_data.color = { 0.8f, 0.8f, 0.8f, 0.5f };
|
||||||
init_data.vertices.reserve(4 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(4);
|
||||||
init_data.indices.reserve(6 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_vertices(6);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
for (const Vec3d &point : plane_points_rot) {
|
for (const Vec3d &point : plane_points_rot) {
|
||||||
|
|
|
@ -142,8 +142,8 @@ void GLGizmoMove3D::on_render()
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.color = AXES_COLOR[id];
|
init_data.color = AXES_COLOR[id];
|
||||||
init_data.vertices.reserve(2 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(2);
|
||||||
init_data.indices.reserve(2 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(2);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex((Vec3f)center.cast<float>());
|
init_data.add_vertex((Vec3f)center.cast<float>());
|
||||||
|
|
|
@ -199,8 +199,8 @@ void GLGizmoPainterBase::render_cursor_circle()
|
||||||
static const float StepSize = 2.0f * float(PI) / float(StepsCount);
|
static const float StepSize = 2.0f * float(PI) / float(StepsCount);
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::LineLoop, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::LineLoop, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.color = { 0.0f, 1.0f, 0.3f, 1.0f };
|
init_data.color = { 0.0f, 1.0f, 0.3f, 1.0f };
|
||||||
init_data.vertices.reserve(StepsCount * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(StepsCount);
|
||||||
init_data.indices.reserve(StepsCount * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(StepsCount);
|
||||||
|
|
||||||
// vertices + indices
|
// vertices + indices
|
||||||
for (unsigned short i = 0; i < StepsCount; ++i) {
|
for (unsigned short i = 0; i < StepsCount; ++i) {
|
||||||
|
|
|
@ -230,8 +230,8 @@ void GLGizmoRotate::render_circle(const ColorRGBA& color, bool radius_changed)
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::LineLoop, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::LineLoop, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(ScaleStepsCount * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(ScaleStepsCount);
|
||||||
init_data.indices.reserve(ScaleStepsCount * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(ScaleStepsCount);
|
||||||
|
|
||||||
// vertices + indices
|
// vertices + indices
|
||||||
for (unsigned short i = 0; i < ScaleStepsCount; ++i) {
|
for (unsigned short i = 0; i < ScaleStepsCount; ++i) {
|
||||||
|
@ -257,8 +257,8 @@ void GLGizmoRotate::render_scale(const ColorRGBA& color, bool radius_changed)
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(2 * ScaleStepsCount * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(2 * ScaleStepsCount);
|
||||||
init_data.indices.reserve(2 * ScaleStepsCount * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(2 * ScaleStepsCount);
|
||||||
|
|
||||||
// vertices + indices
|
// vertices + indices
|
||||||
for (unsigned short i = 0; i < ScaleStepsCount; ++i) {
|
for (unsigned short i = 0; i < ScaleStepsCount; ++i) {
|
||||||
|
@ -294,8 +294,8 @@ void GLGizmoRotate::render_snap_radii(const ColorRGBA& color, bool radius_change
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(2 * ScaleStepsCount * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(2 * ScaleStepsCount);
|
||||||
init_data.indices.reserve(2 * ScaleStepsCount * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(2 * ScaleStepsCount);
|
||||||
|
|
||||||
// vertices + indices
|
// vertices + indices
|
||||||
for (unsigned short i = 0; i < ScaleStepsCount; ++i) {
|
for (unsigned short i = 0; i < ScaleStepsCount; ++i) {
|
||||||
|
@ -327,8 +327,8 @@ void GLGizmoRotate::render_reference_radius(const ColorRGBA& color, bool radius_
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(2 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(2);
|
||||||
init_data.indices.reserve(2 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(2);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex(Vec3f(0.0f, 0.0f, 0.0f));
|
init_data.add_vertex(Vec3f(0.0f, 0.0f, 0.0f));
|
||||||
|
@ -354,8 +354,8 @@ void GLGizmoRotate::render_angle_arc(const ColorRGBA& color, bool radius_changed
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::LineStrip, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::LineStrip, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve((1 + AngleResolution) * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(1 + AngleResolution);
|
||||||
init_data.indices.reserve((1 + AngleResolution) * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(1 + AngleResolution);
|
||||||
|
|
||||||
// vertices + indices
|
// vertices + indices
|
||||||
for (unsigned short i = 0; i <= AngleResolution; ++i) {
|
for (unsigned short i = 0; i <= AngleResolution; ++i) {
|
||||||
|
@ -379,8 +379,8 @@ void GLGizmoRotate::render_grabber_connection(const ColorRGBA& color, bool radiu
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(2 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(2);
|
||||||
init_data.indices.reserve(2 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(2);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex(Vec3f(0.0f, 0.0f, 0.0f));
|
init_data.add_vertex(Vec3f(0.0f, 0.0f, 0.0f));
|
||||||
|
|
|
@ -280,8 +280,8 @@ void GLGizmoScale3D::render_grabbers_connection(unsigned int id_1, unsigned int
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(2 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(2);
|
||||||
init_data.indices.reserve(2 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(2);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex((Vec3f)m_grabbers[id_1].center.cast<float>());
|
init_data.add_vertex((Vec3f)m_grabbers[id_1].center.cast<float>());
|
||||||
|
|
|
@ -1559,6 +1559,7 @@ void Selection::render(float scale_factor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_scale_factor = scale_factor;
|
m_scale_factor = scale_factor;
|
||||||
|
// render cumulative bounding box of selected volumes
|
||||||
render_bounding_box(get_bounding_box(), ColorRGB::WHITE());
|
render_bounding_box(get_bounding_box(), ColorRGB::WHITE());
|
||||||
render_synchronized_volumes();
|
render_synchronized_volumes();
|
||||||
}
|
}
|
||||||
|
@ -2167,8 +2168,8 @@ void Selection::render_bounding_box(const BoundingBoxf3& box, const ColorRGB& co
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(48 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(48);
|
||||||
init_data.indices.reserve(48 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(48);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex(Vec3f(b_min.x(), b_min.y(), b_min.z()));
|
init_data.add_vertex(Vec3f(b_min.x(), b_min.y(), b_min.z()));
|
||||||
|
@ -2388,8 +2389,8 @@ void Selection::render_sidebar_layers_hints(const std::string& sidebar_field)
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(4 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(4);
|
||||||
init_data.indices.reserve(6 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(6);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex(Vec3f(p1.x(), p1.y(), z1));
|
init_data.add_vertex(Vec3f(p1.x(), p1.y(), z1));
|
||||||
|
@ -2410,8 +2411,8 @@ void Selection::render_sidebar_layers_hints(const std::string& sidebar_field)
|
||||||
|
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.vertices.reserve(4 * GLModel::Geometry::vertex_stride_floats(init_data.format));
|
init_data.reserve_vertices(4);
|
||||||
init_data.indices.reserve(6 * GLModel::Geometry::index_stride_bytes(init_data.format));
|
init_data.reserve_indices(6);
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
init_data.add_vertex(Vec3f(p1.x(), p1.y(), z2));
|
init_data.add_vertex(Vec3f(p1.x(), p1.y(), z2));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue