feat(渲染): 实现2D渲染风格系统
添加渲染风格预设配置,支持像素风、平滑2D和混合模式 新增纹理采样控制、顶点像素对齐和UV收缩优化 为相机和场景添加渲染风格覆盖功能
This commit is contained in:
@@ -7,32 +7,37 @@ namespace frostbite2D {
|
||||
class Camera {
|
||||
public:
|
||||
Camera();
|
||||
|
||||
|
||||
void setPosition(const Vec2& pos);
|
||||
void setZoom(float zoom);
|
||||
void setViewport(int width, int height);
|
||||
void setFlipY(bool flip) { flipY_ = flip; } // 调试用:Y轴翻转开关
|
||||
|
||||
void setFlipY(bool flip) { flipY_ = flip; } // Debug Y-axis flip.
|
||||
void setPixelSnapEnabled(bool enabled) { pixelSnapEnabled_ = enabled; }
|
||||
|
||||
const Vec2& getPosition() const { return position_; }
|
||||
Vec2 getRenderPosition() const;
|
||||
Vec2 snapWorldPosition(const Vec2& position) const;
|
||||
float getZoom() const { return zoom_; }
|
||||
int getViewportWidth() const { return viewportWidth_; }
|
||||
int getViewportHeight() const { return viewportHeight_; }
|
||||
float getVisibleWidth() const;
|
||||
float getVisibleHeight() const;
|
||||
|
||||
bool isPixelSnapEnabled() const { return pixelSnapEnabled_; }
|
||||
|
||||
void lookAt(const Vec2& target);
|
||||
void move(const Vec2& delta);
|
||||
void zoomAt(float factor, const Vec2& screenPos);
|
||||
|
||||
|
||||
glm::mat4 getViewMatrix() const;
|
||||
glm::mat4 getProjectionMatrix() const;
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
Vec2 position_;
|
||||
float zoom_ = 1.0f;
|
||||
int viewportWidth_ = 1280;
|
||||
int viewportHeight_ = 720;
|
||||
bool flipY_ = false; // 调试用:Y轴翻转开关
|
||||
bool flipY_ = false; // Debug Y-axis flip.
|
||||
bool pixelSnapEnabled_ = false;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace frostbite2D
|
||||
|
||||
Reference in New Issue
Block a user