From a07455c175db33d8d95bc5cd83738808d74cd105 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 11 Mar 2021 09:14:30 -0800 Subject: Add Linux support to `platform` and `gfx`. (#1744) --- examples/gpu-printing/gpu-printing.cpp | 2 ++ examples/hello-world/main.cpp | 3 +-- examples/shader-toy/main.cpp | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/gpu-printing/gpu-printing.cpp b/examples/gpu-printing/gpu-printing.cpp index 7503c8e03..f1e842e95 100644 --- a/examples/gpu-printing/gpu-printing.cpp +++ b/examples/gpu-printing/gpu-printing.cpp @@ -3,6 +3,8 @@ #include +#include + // This file implements the CPU side of a simple GPU printing // library. The CPU code is responsible for scanning through // buffers of "print commands" produced by GPU shaders, and diff --git a/examples/hello-world/main.cpp b/examples/hello-world/main.cpp index 7b43abcab..b3bee9c07 100644 --- a/examples/hello-world/main.cpp +++ b/examples/hello-world/main.cpp @@ -322,8 +322,7 @@ Slang::Result initialize() swapchainDesc.height = gWindowHeight; swapchainDesc.imageCount = kSwapchainImageCount; swapchainDesc.queue = gQueue; - gfx::WindowHandle windowHandle; - memcpy(&windowHandle, &gWindow->getNativeHandle(), sizeof(windowHandle)); + gfx::WindowHandle windowHandle = gWindow->getNativeHandle().convert(); gSwapchain = gDevice->createSwapchain(swapchainDesc, windowHandle); IFramebufferLayout::AttachmentLayout renderTargetLayout = {gSwapchain->getDesc().format, 1}; diff --git a/examples/shader-toy/main.cpp b/examples/shader-toy/main.cpp index 70bff13a8..27fdf4daa 100644 --- a/examples/shader-toy/main.cpp +++ b/examples/shader-toy/main.cpp @@ -442,9 +442,7 @@ Result initialize() swapchainDesc.height = gWindowHeight; swapchainDesc.imageCount = kSwapchainImageCount; swapchainDesc.queue = gQueue; - gfx::WindowHandle windowHandle; - memcpy(&windowHandle, &gWindow->getNativeHandle(), sizeof(windowHandle)); - gSwapchain = gDevice->createSwapchain(swapchainDesc, windowHandle); + gSwapchain = gDevice->createSwapchain(swapchainDesc, gWindow->getNativeHandle().convert()); IFramebufferLayout::AttachmentLayout renderTargetLayout = {gSwapchain->getDesc().format, 1}; IFramebufferLayout::AttachmentLayout depthLayout = {gfx::Format::D_Float32, 1}; -- cgit v1.2.3