mirror of
https://github.com/glfw/glfw.git
synced 2025-10-01 04:10:59 +00:00
Provide weak default implementation for wgpuInstanceCreateSurface
This commit is contained in:
parent
b0b39d678e
commit
044774dcee
@ -73,8 +73,16 @@ int main(void)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
WGPUAdapter adapter;
|
|
||||||
WGPUSurface surface = glfwCreateWindowWGPUSurface(instance, window);
|
WGPUSurface surface = glfwCreateWindowWGPUSurface(instance, window);
|
||||||
|
if (!surface)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error: Failed to create WebGPU surface.\n");
|
||||||
|
wgpuInstanceRelease(instance);
|
||||||
|
glfwDestroyWindow(window);
|
||||||
|
glfwTerminate();
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
WGPUAdapter adapter;
|
||||||
WGPUDevice device;
|
WGPUDevice device;
|
||||||
WGPUQueue queue;
|
WGPUQueue queue;
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
@ -367,7 +367,9 @@ typedef struct WGPUSurfaceDescriptor
|
|||||||
WGPUStringView label;
|
WGPUStringView label;
|
||||||
} WGPUSurfaceDescriptor;
|
} WGPUSurfaceDescriptor;
|
||||||
|
|
||||||
extern WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, const WGPUSurfaceDescriptor* descriptor) __attribute((weak));
|
#if !defined(_MSC_VER)
|
||||||
|
WGPUSurface __attribute__((weak)) wgpuInstanceCreateSurface(WGPUInstance instance, const WGPUSurfaceDescriptor* descriptor);
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
@ -29,6 +29,13 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#if !defined(_MSC_VER)
|
||||||
|
WGPUSurface __attribute__((weak)) wgpuInstanceCreateSurface(WGPUInstance instance, const WGPUSurfaceDescriptor* descriptor)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindow* handle)
|
GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindow* handle)
|
||||||
{
|
{
|
||||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL)
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user