feat: add explicit camera clear modes

This commit is contained in:
2026-04-01 01:33:46 +08:00
parent 96a66d6f6d
commit 51736253e3
5 changed files with 65 additions and 2 deletions

View File

@@ -11,6 +11,13 @@ enum class CameraProjectionType {
Orthographic
};
enum class CameraClearMode {
Auto = 0,
ColorAndDepth,
DepthOnly,
None
};
class CameraComponent : public Component {
public:
std::string GetName() const override { return "Camera"; }
@@ -36,6 +43,9 @@ public:
bool IsPrimary() const { return m_primary; }
void SetPrimary(bool value) { m_primary = value; }
CameraClearMode GetClearMode() const { return m_clearMode; }
void SetClearMode(CameraClearMode value) { m_clearMode = value; }
const Math::Color& GetClearColor() const { return m_clearColor; }
void SetClearColor(const Math::Color& value) { m_clearColor = value; }
@@ -50,6 +60,7 @@ private:
float m_farClipPlane = 1000.0f;
float m_depth = 0.0f;
bool m_primary = true;
CameraClearMode m_clearMode = CameraClearMode::Auto;
Math::Color m_clearColor = Math::Color(0.192f, 0.302f, 0.475f, 1.0f);
};