glfw: update from 3.3.8 to 3.4

This commit is contained in:
Laytan Laats
2024-03-18 23:54:26 +01:00
parent 97be7feb99
commit 65e68f11f8
14 changed files with 124 additions and 64 deletions
+22 -7
View File
@@ -21,14 +21,21 @@ when ODIN_OS == .Windows {
"system:shell32.lib",
}
}
} else when ODIN_OS == .Linux {
foreign import glfw "system:glfw"
} else when ODIN_OS == .Darwin {
foreign import glfw {
"../lib/darwin/libglfw3.a",
"system:Cocoa.framework",
"system:IOKit.framework",
"system:OpenGL.framework",
when GLFW_SHARED {
foreign import glfw {
"system:glfw",
"system:Cocoa.framework",
"system:IOKit.framework",
"system:OpenGL.framework",
}
} else {
foreign import glfw {
"../lib/darwin/libglfw3.a",
"system:Cocoa.framework",
"system:IOKit.framework",
"system:OpenGL.framework",
}
}
} else {
foreign import glfw "system:glfw"
@@ -44,6 +51,10 @@ foreign glfw {
InitHint :: proc(hint, value: c.int) ---
InitAllocator :: proc(#by_ptr allocator: Allocator) ---
InitVulkanLoader :: proc(loader: vk.ProcGetInstanceProcAddr) ---
GetVersion :: proc(major, minor, rev: ^c.int) ---
GetError :: proc(description: ^cstring) -> c.int ---
@@ -94,6 +105,7 @@ foreign glfw {
GetKey :: proc(window: WindowHandle, key: c.int) -> c.int ---
GetKeyName :: proc(key, scancode: c.int) -> cstring ---
SetWindowShouldClose :: proc(window: WindowHandle, value: b32) ---
GetWindowTitle :: proc(window: WindowHandle) -> cstring ---
JoystickPresent :: proc(joy: c.int) -> b32 ---
GetJoystickName :: proc(joy: c.int) -> cstring ---
GetKeyScancode :: proc(key: c.int) -> c.int ---
@@ -184,5 +196,8 @@ foreign glfw {
SetJoystickCallback :: proc(cbfun: JoystickProc) -> JoystickProc ---
SetErrorCallback :: proc(cbfun: ErrorProc) -> ErrorProc ---
GetPlatform :: proc() -> c.int ---
PlatformSupported :: proc(platform: c.int) -> b32 ---
}
+11
View File
@@ -30,6 +30,13 @@ GamepadState :: struct {
axes: [6]f32,
}
Allocator :: struct {
allocate: AllocateProc,
reallocate: ReallocateProc,
deallocate: DeallocateProc,
user: rawptr,
}
/*** Procedure type declarations ***/
WindowIconifyProc :: #type proc "c" (window: WindowHandle, iconified: c.int)
WindowRefreshProc :: #type proc "c" (window: WindowHandle)
@@ -53,3 +60,7 @@ CursorEnterProc :: #type proc "c" (window: WindowHandle, entered: c.int)
JoystickProc :: #type proc "c" (joy, event: c.int)
ErrorProc :: #type proc "c" (error: c.int, description: cstring)
AllocateProc :: #type proc "c" (size: c.size_t, user: rawptr) -> rawptr
ReallocateProc :: #type proc "c" (block: rawptr, size: c.size_t, user: rawptr) -> rawptr
DeallocateProc :: #type proc "c" (block: rawptr, user: rawptr)