mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:37:44 +00:00
LibGL+LibGPU: Implement GL_LINE_SMOOTH
context parameter
This commit is contained in:
parent
f13d4cd3a0
commit
0abb7df09b
4 changed files with 15 additions and 0 deletions
|
@ -50,6 +50,8 @@ Optional<ContextParameter> GLContext::get_context_parameter(GLenum name)
|
||||||
return ContextParameter { .type = GL_INT, .value = { .integer_value = sizeof(float) * 8 } };
|
return ContextParameter { .type = GL_INT, .value = { .integer_value = sizeof(float) * 8 } };
|
||||||
case GL_LIGHTING:
|
case GL_LIGHTING:
|
||||||
return ContextParameter { .type = GL_BOOL, .is_capability = true, .value = { .boolean_value = m_lighting_enabled } };
|
return ContextParameter { .type = GL_BOOL, .is_capability = true, .value = { .boolean_value = m_lighting_enabled } };
|
||||||
|
case GL_LINE_SMOOTH:
|
||||||
|
return ContextParameter { .type = GL_BOOL, .is_capability = true, .value = { .boolean_value = m_line_smooth } };
|
||||||
case GL_MAX_LIGHTS:
|
case GL_MAX_LIGHTS:
|
||||||
return ContextParameter { .type = GL_INT, .value = { .integer_value = static_cast<GLint>(m_device_info.num_lights) } };
|
return ContextParameter { .type = GL_INT, .value = { .integer_value = static_cast<GLint>(m_device_info.num_lights) } };
|
||||||
case GL_MAX_MODELVIEW_STACK_DEPTH:
|
case GL_MAX_MODELVIEW_STACK_DEPTH:
|
||||||
|
@ -213,6 +215,11 @@ void GLContext::gl_disable(GLenum capability)
|
||||||
m_light_states.at(capability - GL_LIGHT0).is_enabled = false;
|
m_light_states.at(capability - GL_LIGHT0).is_enabled = false;
|
||||||
m_light_state_is_dirty = true;
|
m_light_state_is_dirty = true;
|
||||||
break;
|
break;
|
||||||
|
case GL_LINE_SMOOTH:
|
||||||
|
m_line_smooth = false;
|
||||||
|
rasterizer_options.line_smooth = false;
|
||||||
|
update_rasterizer_options = true;
|
||||||
|
break;
|
||||||
case GL_NORMALIZE:
|
case GL_NORMALIZE:
|
||||||
m_normalize = false;
|
m_normalize = false;
|
||||||
rasterizer_options.normalization_enabled = false;
|
rasterizer_options.normalization_enabled = false;
|
||||||
|
@ -347,6 +354,11 @@ void GLContext::gl_enable(GLenum capability)
|
||||||
m_light_states.at(capability - GL_LIGHT0).is_enabled = true;
|
m_light_states.at(capability - GL_LIGHT0).is_enabled = true;
|
||||||
m_light_state_is_dirty = true;
|
m_light_state_is_dirty = true;
|
||||||
break;
|
break;
|
||||||
|
case GL_LINE_SMOOTH:
|
||||||
|
m_line_smooth = true;
|
||||||
|
rasterizer_options.line_smooth = true;
|
||||||
|
update_rasterizer_options = true;
|
||||||
|
break;
|
||||||
case GL_NORMALIZE:
|
case GL_NORMALIZE:
|
||||||
m_normalize = true;
|
m_normalize = true;
|
||||||
rasterizer_options.normalization_enabled = true;
|
rasterizer_options.normalization_enabled = true;
|
||||||
|
|
|
@ -60,6 +60,7 @@ extern "C" {
|
||||||
#define GL_COLOR_BUFFER_BIT 0x04000
|
#define GL_COLOR_BUFFER_BIT 0x04000
|
||||||
|
|
||||||
// Enable capabilities
|
// Enable capabilities
|
||||||
|
#define GL_LINE_SMOOTH 0x0B20
|
||||||
#define GL_POLYGON_MODE 0x0B40
|
#define GL_POLYGON_MODE 0x0B40
|
||||||
#define GL_POLYGON_SMOOTH 0x0B41
|
#define GL_POLYGON_SMOOTH 0x0B41
|
||||||
#define GL_POLYGON_STIPPLE 0x0B42
|
#define GL_POLYGON_STIPPLE 0x0B42
|
||||||
|
|
|
@ -488,6 +488,7 @@ private:
|
||||||
float m_point_size { 1.f };
|
float m_point_size { 1.f };
|
||||||
|
|
||||||
// Line drawing configuration
|
// Line drawing configuration
|
||||||
|
bool m_line_smooth { false };
|
||||||
float m_line_width { 1.f };
|
float m_line_width { 1.f };
|
||||||
|
|
||||||
// Lighting configuration
|
// Lighting configuration
|
||||||
|
|
|
@ -38,6 +38,7 @@ struct RasterizerOptions {
|
||||||
bool fog_enabled { false };
|
bool fog_enabled { false };
|
||||||
float fog_start { 0.0f };
|
float fog_start { 0.0f };
|
||||||
float fog_end { 1.0f };
|
float fog_end { 1.0f };
|
||||||
|
bool line_smooth { false };
|
||||||
bool point_smooth { false };
|
bool point_smooth { false };
|
||||||
float point_size { 1.f };
|
float point_size { 1.f };
|
||||||
bool scissor_enabled { false };
|
bool scissor_enabled { false };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue