Move OpenGL shape draw mappings
This commit is contained in:
@@ -133,6 +133,29 @@ void names_framebuffer_status_codes(pp::tests::Harness& h)
|
||||
PP_EXPECT(h, pp::renderer::gl::framebuffer_status_name(0U) == std::string_view("UNKNOWN"));
|
||||
}
|
||||
|
||||
void maps_shape_index_and_primitive_modes(pp::tests::Harness& h)
|
||||
{
|
||||
constexpr std::uint32_t gl_points = 0x0000U;
|
||||
constexpr std::uint32_t gl_lines = 0x0001U;
|
||||
constexpr std::uint32_t gl_triangles = 0x0004U;
|
||||
constexpr std::uint32_t gl_unsigned_short = 0x1403U;
|
||||
constexpr std::uint32_t gl_unsigned_int = 0x1405U;
|
||||
|
||||
PP_EXPECT(h, pp::renderer::gl::index_type_for_index_size(2U) == gl_unsigned_short);
|
||||
PP_EXPECT(h, pp::renderer::gl::index_type_for_index_size(4U) == gl_unsigned_int);
|
||||
PP_EXPECT(h, pp::renderer::gl::index_type_for_index_size(1U) == 0U);
|
||||
PP_EXPECT(h, pp::renderer::gl::index_type_for_index_size(8U) == 0U);
|
||||
|
||||
PP_EXPECT(h, pp::renderer::gl::primitive_mode_for_fill_count(1U) == gl_points);
|
||||
PP_EXPECT(h, pp::renderer::gl::primitive_mode_for_fill_count(2U) == gl_lines);
|
||||
PP_EXPECT(h, pp::renderer::gl::primitive_mode_for_fill_count(3U) == gl_triangles);
|
||||
PP_EXPECT(h, pp::renderer::gl::primitive_mode_for_fill_count(99U) == gl_triangles);
|
||||
|
||||
PP_EXPECT(h, pp::renderer::gl::primitive_mode_for_stroke_count(1U) == gl_points);
|
||||
PP_EXPECT(h, pp::renderer::gl::primitive_mode_for_stroke_count(2U) == gl_lines);
|
||||
PP_EXPECT(h, pp::renderer::gl::primitive_mode_for_stroke_count(99U) == gl_lines);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -145,5 +168,6 @@ int main()
|
||||
harness.run("selects_texture_upload_type_from_internal_format", selects_texture_upload_type_from_internal_format);
|
||||
harness.run("maps_image_channel_count_to_texture_format", maps_image_channel_count_to_texture_format);
|
||||
harness.run("names_framebuffer_status_codes", names_framebuffer_status_codes);
|
||||
harness.run("maps_shape_index_and_primitive_modes", maps_shape_index_and_primitive_modes);
|
||||
return harness.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user