mirror of
https://github.com/glfw/glfw.git
synced 2025-08-31 19:11:49 +00:00
Adjust formatting of new code to fit in with the rest of the code
This commit is contained in:
parent
44f8a80ade
commit
54fcbc8220
@ -2020,12 +2020,14 @@ VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance,
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
typedef struct WGPUSurfaceSourceMetalLayer {
|
||||
typedef struct WGPUSurfaceSourceMetalLayer
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
void * layer;
|
||||
} WGPUSurfaceSourceMetalLayer;
|
||||
|
||||
WGPUSurface _glfwCreateWindowWGPUSurfaceCocoa(WGPUInstance instance, _GLFWwindow* window) {
|
||||
WGPUSurface _glfwCreateWindowWGPUSurfaceCocoa(WGPUInstance instance, _GLFWwindow* window)
|
||||
{
|
||||
[window->ns.view setLayer:window->ns.layer];
|
||||
[window->ns.view setWantsLayer:YES];
|
||||
|
||||
|
@ -335,12 +335,14 @@ typedef VkResult (APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const c
|
||||
typedef struct WGPUInstanceImpl* WGPUInstance;
|
||||
typedef struct WGPUSurfaceImpl* WGPUSurface;
|
||||
|
||||
typedef struct WGPUStringView {
|
||||
typedef struct WGPUStringView
|
||||
{
|
||||
char const * data;
|
||||
size_t length;
|
||||
} WGPUStringView;
|
||||
|
||||
typedef enum WGPUSType {
|
||||
typedef enum WGPUSType
|
||||
{
|
||||
WGPUSType_ShaderSourceSPIRV = 0x00000001,
|
||||
WGPUSType_ShaderSourceWGSL = 0x00000002,
|
||||
WGPUSType_RenderPassMaxDrawCount = 0x00000003,
|
||||
@ -353,12 +355,14 @@ typedef enum WGPUSType {
|
||||
WGPUSType_Force32 = 0x7FFFFFFF
|
||||
} WGPUSType;
|
||||
|
||||
typedef struct WGPUChainedStruct {
|
||||
typedef struct WGPUChainedStruct
|
||||
{
|
||||
struct WGPUChainedStruct const * next;
|
||||
WGPUSType sType;
|
||||
} WGPUChainedStruct;
|
||||
|
||||
typedef struct WGPUSurfaceDescriptor {
|
||||
typedef struct WGPUSurfaceDescriptor
|
||||
{
|
||||
WGPUChainedStruct const * nextInChain;
|
||||
WGPUStringView label;
|
||||
} WGPUSurfaceDescriptor;
|
||||
|
@ -29,12 +29,14 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
GLFWAPI void glfwSetWGPUInstanceCreateSurfaceAddr(WGPUSurface (*addr)(WGPUInstance, const WGPUSurfaceDescriptor*)) {
|
||||
GLFWAPI void glfwSetWGPUInstanceCreateSurfaceAddr(WGPUSurface (*addr)(WGPUInstance, const WGPUSurfaceDescriptor*))
|
||||
{
|
||||
_GLFW_REQUIRE_INIT()
|
||||
_glfw.wgpu.instanceCreateSurface = addr;
|
||||
}
|
||||
|
||||
GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindow* handle) {
|
||||
GLFWAPI WGPUSurface glfwCreateWindowWGPUSurface(WGPUInstance instance, GLFWwindow* handle)
|
||||
{
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL)
|
||||
|
||||
_GLFWwindow* window = (_GLFWwindow*)handle;
|
||||
|
@ -2562,13 +2562,15 @@ VkResult _glfwCreateWindowSurfaceWin32(VkInstance instance,
|
||||
return err;
|
||||
}
|
||||
|
||||
typedef struct WGPUSurfaceSourceWindowsHWND {
|
||||
typedef struct WGPUSurfaceSourceWindowsHWND
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
void * hinstance;
|
||||
void * hwnd;
|
||||
} WGPUSurfaceSourceWindowsHWND;
|
||||
|
||||
WGPUSurface _glfwCreateWindowWGPUSurfaceWin32(WGPUInstance instance, _GLFWwindow *window) {
|
||||
WGPUSurface _glfwCreateWindowWGPUSurfaceWin32(WGPUInstance instance, _GLFWwindow *window)
|
||||
{
|
||||
WGPUSurfaceSourceWindowsHWND windowsSurface;
|
||||
windowsSurface.chain.sType = WGPUSType_SurfaceSourceWindowsHWND;
|
||||
windowsSurface.chain.next = NULL;
|
||||
|
@ -3326,13 +3326,15 @@ VkResult _glfwCreateWindowSurfaceWayland(VkInstance instance,
|
||||
return err;
|
||||
}
|
||||
|
||||
typedef struct WGPUSurfaceSourceWaylandSurface {
|
||||
typedef struct WGPUSurfaceSourceWaylandSurface
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
void * display;
|
||||
void * surface;
|
||||
} WGPUSurfaceSourceWaylandSurface;
|
||||
|
||||
WGPUSurface _glfwCreateWindowWGPUSurfaceWayland(WGPUInstance instance, _GLFWwindow* window) {
|
||||
WGPUSurface _glfwCreateWindowWGPUSurfaceWayland(WGPUInstance instance, _GLFWwindow* window)
|
||||
{
|
||||
WGPUSurfaceSourceWaylandSurface waylandSurface;
|
||||
waylandSurface.chain.sType = WGPUSType_SurfaceSourceWaylandSurface;
|
||||
waylandSurface.chain.next = NULL;
|
||||
|
@ -3282,13 +3282,15 @@ VkResult _glfwCreateWindowSurfaceX11(VkInstance instance,
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct WGPUSurfaceSourceXCBWindow {
|
||||
typedef struct WGPUSurfaceSourceXCBWindow
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
void * connection;
|
||||
uint32_t window;
|
||||
} WGPUSurfaceSourceXCBWindow;
|
||||
|
||||
typedef struct WGPUSurfaceSourceXlibWindow {
|
||||
typedef struct WGPUSurfaceSourceXlibWindow
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
void * display;
|
||||
uint64_t window;
|
||||
|
Loading…
Reference in New Issue
Block a user