@@ -498,7 +498,7 @@ Device::Device(const Gfx::IntSize& min_size)
498
498
m_options.scissor_box = m_render_target->rect ();
499
499
}
500
500
501
- void Device::draw_primitives (GLenum primitive_type, FloatMatrix4x4 const & transform, FloatMatrix4x4 const & texture_matrix, Vector<Vertex> const & vertices, Vector<size_t > const & enabled_texture_units)
501
+ void Device::draw_primitives (PrimitiveType primitive_type, FloatMatrix4x4 const & transform, FloatMatrix4x4 const & texture_matrix, Vector<Vertex> const & vertices, Vector<size_t > const & enabled_texture_units)
502
502
{
503
503
// At this point, the user has effectively specified that they are done with defining the geometry
504
504
// of what they want to draw. We now need to do a few things (https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview):
@@ -517,7 +517,7 @@ void Device::draw_primitives(GLenum primitive_type, FloatMatrix4x4 const& transf
517
517
m_processed_triangles.clear_with_capacity ();
518
518
519
519
// Let's construct some triangles
520
- if (primitive_type == GL_TRIANGLES ) {
520
+ if (primitive_type == PrimitiveType::Triangles ) {
521
521
Triangle triangle;
522
522
for (size_t i = 0 ; i < vertices.size (); i += 3 ) {
523
523
triangle.vertices [0 ] = vertices.at (i);
@@ -526,7 +526,7 @@ void Device::draw_primitives(GLenum primitive_type, FloatMatrix4x4 const& transf
526
526
527
527
m_triangle_list.append (triangle);
528
528
}
529
- } else if (primitive_type == GL_QUADS ) {
529
+ } else if (primitive_type == PrimitiveType::Quads ) {
530
530
// We need to construct two triangles to form the quad
531
531
Triangle triangle;
532
532
VERIFY (vertices.size () % 4 == 0 );
@@ -543,7 +543,7 @@ void Device::draw_primitives(GLenum primitive_type, FloatMatrix4x4 const& transf
543
543
triangle.vertices [2 ] = vertices.at (i);
544
544
m_triangle_list.append (triangle);
545
545
}
546
- } else if (primitive_type == GL_TRIANGLE_FAN || primitive_type == GL_POLYGON ) {
546
+ } else if (primitive_type == PrimitiveType::TriangleFan ) {
547
547
Triangle triangle;
548
548
triangle.vertices [0 ] = vertices.at (0 ); // Root vertex is always the vertex defined first
549
549
@@ -553,7 +553,7 @@ void Device::draw_primitives(GLenum primitive_type, FloatMatrix4x4 const& transf
553
553
triangle.vertices [2 ] = vertices.at (i + 1 );
554
554
m_triangle_list.append (triangle);
555
555
}
556
- } else if (primitive_type == GL_TRIANGLE_STRIP ) {
556
+ } else if (primitive_type == PrimitiveType::TriangleStrip ) {
557
557
Triangle triangle;
558
558
for (size_t i = 0 ; i < vertices.size () - 2 ; i++) {
559
559
triangle.vertices [0 ] = vertices.at (i);
0 commit comments