feat(d3d12): 实现交换链与渲染表面管理
- 新增 d3d12_surface 类,管理交换链和渲染目标 - 实现三重缓冲后台缓冲区管理 - 添加视口和裁剪矩形配置 - 修复 GraphicsPlatformInterface.h 循环包含问题 - 添加完整的中文 Doxygen 注释 - 更新 D3D12 学习 Wiki,添加交换链章节
This commit is contained in:
@@ -1,16 +1,60 @@
|
||||
#pragma once
|
||||
#include "CommonHeader.h"
|
||||
#include "..\Platform\Window.h"
|
||||
#pragma once
|
||||
#include "Platform/Window.h"
|
||||
|
||||
|
||||
namespace XEngine::graphics {
|
||||
|
||||
DEFINE_TYPED_ID(surface_id);
|
||||
|
||||
/**
|
||||
* @brief 表面类
|
||||
* @details 定义了渲染表面的属性与操作
|
||||
*/
|
||||
class surface
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief 由表面 ID 构造句柄。
|
||||
* @param id 表面 ID。
|
||||
*/
|
||||
constexpr explicit surface(surface_id id) : _id{ id } {}
|
||||
/**
|
||||
* @brief 构造无效表面句柄。
|
||||
*/
|
||||
constexpr surface() = default;
|
||||
/**
|
||||
* @brief 获取表面 ID。
|
||||
* @return 表面 ID。
|
||||
*/
|
||||
constexpr surface_id get_id() const { return _id; }
|
||||
/**
|
||||
* @brief 判断表面句柄是否有效。
|
||||
* @return 有效返回 true。
|
||||
*/
|
||||
constexpr bool is_valid() const { return id::is_valid(_id); }
|
||||
|
||||
|
||||
/**
|
||||
* @brief 调整表面大小。
|
||||
* @param width 目标宽度。
|
||||
* @param height 目标高度。
|
||||
*/
|
||||
void resize(u32 width, u32 height) const;
|
||||
/**
|
||||
* @brief 获取表面宽度。
|
||||
* @return 宽度像素值。
|
||||
*/
|
||||
u32 width() const;
|
||||
/**
|
||||
* @brief 获取表面高度。
|
||||
* @return 高度像素值。
|
||||
*/
|
||||
u32 height() const;
|
||||
|
||||
void render() const;
|
||||
|
||||
private:
|
||||
surface_id _id{ id::invalid_id };
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -53,4 +97,17 @@ void shutdown();
|
||||
*/
|
||||
void render();
|
||||
|
||||
/**
|
||||
* @brief 创建渲染表面
|
||||
* @details window 渲染表面的窗口
|
||||
* @return 渲染表面对象柄
|
||||
*/
|
||||
surface create_surface(platform::window window);
|
||||
|
||||
/**
|
||||
* @brief 移除渲染表面
|
||||
* @details id 渲染表面的 ID
|
||||
*/
|
||||
void remove_surface(surface_id id);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user