mirror of
https://github.com/glfw/glfw.git
synced 2025-08-31 19:11:49 +00:00
Revert "Try loading surface creation function via dlsym
instead"
This reverts commit cb0c28908f
.
This commit is contained in:
parent
cb0c28908f
commit
37812b7e36
@ -6531,6 +6531,19 @@ GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window
|
||||
|
||||
#if defined(WEBGPU_H_)
|
||||
|
||||
/*! @brief Provide the address of the `wgpuInstanceCreateSurface` function to GLFW.
|
||||
*
|
||||
* This function passes the address provided for the `wgpuInstanceCreateSurface` function
|
||||
* to GLFW.
|
||||
*
|
||||
* @param[in] addr The address of the `wgpuInstanceCreateSurface` function.
|
||||
*
|
||||
* @since Added in version 3.5
|
||||
*
|
||||
* @ingroup webgpu
|
||||
*/
|
||||
GLFWAPI void glfwSetWGPUInstanceCreateSurfaceAddr(WGPUSurface (*addr)(WGPUInstance, const WGPUSurfaceDescriptor*));
|
||||
|
||||
/*! @brief Creates a WebGPU surface for the specified window.
|
||||
*
|
||||
* This function creates a WebGPU surface for the specified window.
|
||||
|
@ -402,8 +402,6 @@ GLFWAPI int glfwInit(void)
|
||||
if (!_glfwSelectPlatform(_glfw.hints.init.platformID, &_glfw.platform))
|
||||
return GLFW_FALSE;
|
||||
|
||||
_glfwLoadWGPUInstanceCreateSurfaceAddr();
|
||||
|
||||
if (!_glfw.platform.init())
|
||||
{
|
||||
terminate();
|
||||
|
@ -1051,8 +1051,6 @@ GLFWbool _glfwInitVulkan(int mode);
|
||||
void _glfwTerminateVulkan(void);
|
||||
const char* _glfwGetVulkanResultString(VkResult result);
|
||||
|
||||
void _glfwLoadWGPUInstanceCreateSurfaceAddr(void);
|
||||
|
||||
size_t _glfwEncodeUTF8(char* s, uint32_t codepoint);
|
||||
char** _glfwParseUriList(char* text, int* count);
|
||||
|
||||
|
11
src/webgpu.c
11
src/webgpu.c
@ -28,14 +28,11 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#if defined(_GLFW_WIN32)
|
||||
// TODO: Implement Window version
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
void _glfwLoadWGPUInstanceCreateSurfaceAddr() {
|
||||
_glfw.wgpu.instanceCreateSurface = dlsym(RTLD_DEFAULT, "wgpuInstanceCreateSurface");
|
||||
|
||||
GLFWAPI void glfwSetWGPUInstanceCreateSurfaceAddr(WGPUSurface (*addr)(WGPUInstance, const WGPUSurfaceDescriptor*)) {
|
||||
_GLFW_REQUIRE_INIT()
|
||||
_glfw.wgpu.instanceCreateSurface = addr;
|
||||
}
|
||||
#endif
|
||||
|
||||
GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindow* handle) {
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user