mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:27:35 +00:00
LibSoftGPU: Remove OpenGL type for polygon mode
Replaces the GLenum used to setup polygon mode in RasterizerOptions with our own enum.
This commit is contained in:
parent
f4d29bf665
commit
de0069188f
2 changed files with 20 additions and 2 deletions
|
@ -2293,7 +2293,19 @@ void SoftwareGLContext::gl_polygon_mode(GLenum face, GLenum mode)
|
||||||
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
|
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
|
||||||
|
|
||||||
auto options = m_rasterizer.options();
|
auto options = m_rasterizer.options();
|
||||||
options.polygon_mode = mode;
|
|
||||||
|
// FIXME: This must support different polygon modes for front- and backside
|
||||||
|
switch (mode) {
|
||||||
|
case GL_POINT:
|
||||||
|
options.polygon_mode = SoftGPU::PolygonMode::Point;
|
||||||
|
break;
|
||||||
|
case GL_LINE:
|
||||||
|
options.polygon_mode = SoftGPU::PolygonMode::Line;
|
||||||
|
break;
|
||||||
|
case GL_FILL:
|
||||||
|
options.polygon_mode = SoftGPU::PolygonMode::Fill;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
m_rasterizer.set_options(options);
|
m_rasterizer.set_options(options);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,12 @@ enum FogMode {
|
||||||
Exp2
|
Exp2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class PolygonMode {
|
||||||
|
Point,
|
||||||
|
Line,
|
||||||
|
Fill,
|
||||||
|
};
|
||||||
|
|
||||||
enum class WindingOrder {
|
enum class WindingOrder {
|
||||||
Clockwise,
|
Clockwise,
|
||||||
CounterClockwise,
|
CounterClockwise,
|
||||||
|
@ -87,7 +93,7 @@ struct RasterizerOptions {
|
||||||
float depth_min { 0 };
|
float depth_min { 0 };
|
||||||
float depth_max { 1 };
|
float depth_max { 1 };
|
||||||
DepthTestFunction depth_func { DepthTestFunction::Less };
|
DepthTestFunction depth_func { DepthTestFunction::Less };
|
||||||
GLenum polygon_mode { GL_FILL };
|
PolygonMode polygon_mode { PolygonMode::Fill };
|
||||||
FloatVector4 fog_color { 0.0f, 0.0f, 0.0f, 0.0f };
|
FloatVector4 fog_color { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
float fog_density { 1.0f };
|
float fog_density { 1.0f };
|
||||||
FogMode fog_mode { FogMode::Exp };
|
FogMode fog_mode { FogMode::Exp };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue