mirror of
https://github.com/ocornut/imgui.git
synced 2026-03-27 23:37:03 -05:00
This commit is contained in:
@@ -1020,15 +1020,18 @@ void ImGui_ImplWGPU_DebugPrintAdapterInfo(const WGPUAdapter& adapter)
|
|||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// MacOS specific: is necessary to compile with "-x objective-c++" flags
|
// MacOS specific: is necessary to compile with "-x objective-c++" flags
|
||||||
// (e.g. using cmake: set_source_files_properties(${IMGUI_DIR}/backends/imgui_impl_wgpu.cpp PROPERTIES COMPILE_FLAGS "-x objective-c++") )
|
// (e.g. using cmake: set_source_files_properties(${IMGUI_DIR}/backends/imgui_impl_wgpu.cpp PROPERTIES COMPILE_FLAGS "-x objective-c++") )
|
||||||
|
#include <TargetConditionals.h>
|
||||||
|
#if TARGET_OS_OSX
|
||||||
#include <Cocoa/Cocoa.h>
|
#include <Cocoa/Cocoa.h>
|
||||||
#include <QuartzCore/CAMetalLayer.h>
|
#include <QuartzCore/CAMetalLayer.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
WGPUSurface ImGui_ImplWGPU_CreateWGPUSurfaceHelper(ImGui_ImplWGPU_CreateSurfaceInfo* info)
|
WGPUSurface ImGui_ImplWGPU_CreateWGPUSurfaceHelper(ImGui_ImplWGPU_CreateSurfaceInfo* info)
|
||||||
{
|
{
|
||||||
WGPUSurfaceDescriptor surface_descriptor = {};
|
WGPUSurfaceDescriptor surface_descriptor = {};
|
||||||
WGPUSurface surface = {};
|
WGPUSurface surface = {};
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__) && TARGET_OS_OSX
|
||||||
if (strcmp(info->System, "cocoa") == 0)
|
if (strcmp(info->System, "cocoa") == 0)
|
||||||
{
|
{
|
||||||
IM_ASSERT(info->RawWindow != nullptr);
|
IM_ASSERT(info->RawWindow != nullptr);
|
||||||
@@ -1075,7 +1078,7 @@ WGPUSurface ImGui_ImplWGPU_CreateWGPUSurfaceHelper(ImGui_ImplWGPU_CreateSurfaceI
|
|||||||
surface = wgpuInstanceCreateSurface(info->Instance, &surface_descriptor);
|
surface = wgpuInstanceCreateSurface(info->Instance, &surface_descriptor);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#error "Unsupported WebGPU native platform!"
|
fprintf(stderr, "'CreateWGPUSurfaceHelper' is not implemented for this platform\n");
|
||||||
#endif
|
#endif
|
||||||
return surface;
|
return surface;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user