- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
848 B
848 B
RHIDevice::Initialize
virtual bool Initialize(const RHIDeviceDesc& desc) = 0;
初始化 RHI 设备,建立与图形适配器的连接。
参数:
desc- 设备描述符,包含窗口句柄、分辨率、调试选项等配置
返回: 成功返回 true,失败返回 false
复杂度: O(1)
示例:
RHIDeviceDesc desc;
desc.windowHandle = hwnd;
desc.width = 1920;
desc.height = 1080;
desc.appName = L"MyApp";
desc.enableDebugLayer = true;
desc.enableGPUValidation = true;
RHIDevice* device = RHIFactory::CreateRHIDevice(RHIType::D3D12);
if (device->Initialize(desc)) {
// 设备初始化成功
} else {
// 处理初始化失败
delete device;
}
相关文档
- RHIDevice 总览 - 返回类总览
- RHIDeviceDesc - 设备描述结构体