Move GL state utility mapping to renderer gl
This commit is contained in:
@@ -11,6 +11,12 @@ constexpr std::uint32_t gl_unsigned_short = 0x1403U;
|
||||
constexpr std::uint32_t gl_unsigned_int = 0x1405U;
|
||||
constexpr std::uint32_t gl_float = 0x1406U;
|
||||
constexpr std::uint32_t gl_half_float = 0x140BU;
|
||||
constexpr std::uint32_t gl_no_error = 0U;
|
||||
constexpr std::uint32_t gl_invalid_enum = 0x0500U;
|
||||
constexpr std::uint32_t gl_invalid_value = 0x0501U;
|
||||
constexpr std::uint32_t gl_invalid_operation = 0x0502U;
|
||||
constexpr std::uint32_t gl_out_of_memory = 0x0505U;
|
||||
constexpr std::uint32_t gl_invalid_framebuffer_operation = 0x0506U;
|
||||
constexpr std::uint32_t gl_false = 0U;
|
||||
constexpr std::uint32_t gl_points = 0x0000U;
|
||||
constexpr std::uint32_t gl_lines = 0x0001U;
|
||||
@@ -40,6 +46,11 @@ constexpr std::uint32_t gl_blend = 0x0BE2U;
|
||||
constexpr std::uint32_t gl_color_clear_value = 0x0C22U;
|
||||
constexpr std::uint32_t gl_scissor_test = 0x0C11U;
|
||||
constexpr std::uint32_t gl_depth_test = 0x0B71U;
|
||||
constexpr std::uint32_t gl_current_program = 0x8B8DU;
|
||||
constexpr std::uint32_t gl_active_texture = 0x84E0U;
|
||||
constexpr std::uint32_t gl_texture_binding_2d = 0x8069U;
|
||||
constexpr std::uint32_t gl_texture_binding_cube_map = 0x8514U;
|
||||
constexpr std::uint32_t gl_sampler_binding = 0x8919U;
|
||||
constexpr std::uint32_t gl_func_add = 0x8006U;
|
||||
constexpr std::uint32_t gl_max = 0x8008U;
|
||||
constexpr std::uint32_t gl_program_point_size = 0x8642U;
|
||||
@@ -159,6 +170,31 @@ std::uint32_t extension_string_name() noexcept
|
||||
return gl_extensions;
|
||||
}
|
||||
|
||||
std::uint32_t no_error_code() noexcept
|
||||
{
|
||||
return gl_no_error;
|
||||
}
|
||||
|
||||
const char* opengl_error_name(std::uint32_t error_code) noexcept
|
||||
{
|
||||
switch (error_code) {
|
||||
case gl_no_error:
|
||||
return "GL_NO_ERROR";
|
||||
case gl_invalid_enum:
|
||||
return "GL_INVALID_ENUM";
|
||||
case gl_invalid_value:
|
||||
return "GL_INVALID_VALUE";
|
||||
case gl_invalid_operation:
|
||||
return "GL_INVALID_OPERATION";
|
||||
case gl_invalid_framebuffer_operation:
|
||||
return "GL_INVALID_FRAMEBUFFER_OPERATION";
|
||||
case gl_out_of_memory:
|
||||
return "GL_OUT_OF_MEMORY";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
std::uint32_t texture_upload_type_for_internal_format(std::uint32_t internal_format) noexcept
|
||||
{
|
||||
switch (internal_format) {
|
||||
@@ -496,6 +532,31 @@ std::uint32_t color_clear_value_query() noexcept
|
||||
return gl_color_clear_value;
|
||||
}
|
||||
|
||||
std::uint32_t current_program_query() noexcept
|
||||
{
|
||||
return gl_current_program;
|
||||
}
|
||||
|
||||
std::uint32_t active_texture_query() noexcept
|
||||
{
|
||||
return gl_active_texture;
|
||||
}
|
||||
|
||||
std::uint32_t texture_binding_2d_query() noexcept
|
||||
{
|
||||
return gl_texture_binding_2d;
|
||||
}
|
||||
|
||||
std::uint32_t texture_binding_cube_map_query() noexcept
|
||||
{
|
||||
return gl_texture_binding_cube_map;
|
||||
}
|
||||
|
||||
std::uint32_t sampler_binding_query() noexcept
|
||||
{
|
||||
return gl_sampler_binding;
|
||||
}
|
||||
|
||||
std::uint32_t blend_state() noexcept
|
||||
{
|
||||
return gl_blend;
|
||||
|
||||
Reference in New Issue
Block a user