Refactored FillMode to enum class

dev
Tomasz Kapuściński 2021-12-05 12:53:31 +01:00
parent 39c837d323
commit 0568fcdb81
3 changed files with 8 additions and 8 deletions

View File

@ -243,14 +243,14 @@ enum ShadeModel
* \enum FillMode * \enum FillMode
* \brief Polygon fill mode * \brief Polygon fill mode
*/ */
enum FillMode enum class FillMode : unsigned char
{ {
//! Draw only points //! Draw only points
FILL_POINT, POINT,
//! Draw only lines //! Draw only lines
FILL_LINES, LINES,
//! Draw full polygons //! Draw full polygons
FILL_POLY POLY
}; };
/** /**

View File

@ -345,7 +345,7 @@ bool CEngine::Create()
m_device->SetClearColor(Color(0.0f, 0.0f, 0.0f, 0.0f)); m_device->SetClearColor(Color(0.0f, 0.0f, 0.0f, 0.0f));
m_device->SetShadeModel(SHADE_SMOOTH); m_device->SetShadeModel(SHADE_SMOOTH);
m_device->SetFillMode(FILL_POLY); m_device->SetFillMode(FillMode::POLY);
SetFocus(m_focus); SetFocus(m_focus);

View File

@ -1547,9 +1547,9 @@ void CGL33Device::SetShadowColor(float value)
void CGL33Device::SetFillMode(FillMode mode) void CGL33Device::SetFillMode(FillMode mode)
{ {
if (mode == FILL_POINT) glPolygonMode(GL_FRONT_AND_BACK, GL_POINT); if (mode == FillMode::POINT) glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
else if (mode == FILL_LINES) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); else if (mode == FillMode::LINES) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else if (mode == FILL_POLY) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); else if (mode == FillMode::POLY) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
else assert(false); else assert(false);
} }