From 0dd7e34602d0abec6442e4b63c22a8b2e760aad2 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Thu, 23 Jan 2025 00:16:41 +0100 Subject: Dx12 surface creation --- api-test/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'api-test/main.cpp') diff --git a/api-test/main.cpp b/api-test/main.cpp index 9fa7ef9..f61fa13 100644 --- a/api-test/main.cpp +++ b/api-test/main.cpp @@ -114,8 +114,9 @@ int main() { #endif device.init(); - auto main_scene = scene(camera(position, target, v_fov, aspect_ratio, aperture, focus_distance), window_width, window_height); + // auto main_scene = scene(camera(position, target, v_fov, aspect_ratio, aperture, focus_distance), window_width, window_height); +#ifdef VK auto surface_handle = device.create_surface({ .window_handle = wnd.handle, .surface_format = { @@ -125,6 +126,14 @@ int main() { .present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR, .usages = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_STORAGE_BIT, }); +#else + auto surface_handle = device.create_surface({ + .window_handle = wnd.handle, + .surface_format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + .present_mode = DXGI_SWAP_EFFECT_FLIP_DISCARD, + .usages = DXGI_USAGE_UNORDERED_ACCESS | DXGI_USAGE_RENDER_TARGET_OUTPUT, + }); +#endif auto& surface = device.get_surface(surface_handle); #ifdef VK -- cgit v1.3