mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-06 18:54:12 +00:00
Add glfw.GetCocoaWindow
This commit is contained in:
33
vendor/glfw/native.odin
vendored
33
vendor/glfw/native.odin
vendored
@@ -1,33 +0,0 @@
|
||||
package glfw
|
||||
|
||||
when ODIN_OS == .Windows {
|
||||
import win32 "core:sys/windows"
|
||||
|
||||
foreign import glfw { "lib/glfw3_mt.lib", "system:user32.lib", "system:gdi32.lib", "system:shell32.lib" }
|
||||
|
||||
@(default_calling_convention="c", link_prefix="glfw")
|
||||
foreign glfw {
|
||||
GetWin32Adapter :: proc(monitor: MonitorHandle) -> cstring ---
|
||||
GetWin32Monitor :: proc(monitor: MonitorHandle) -> cstring ---
|
||||
GetWin32Window :: proc(window: WindowHandle) -> win32.HWND ---
|
||||
GetWGLContext :: proc(window: WindowHandle) -> rawptr ---
|
||||
}
|
||||
} else when ODIN_OS == .Linux {
|
||||
// TODO: Native Linux
|
||||
// Display* glfwGetX11Display(void);
|
||||
// RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
|
||||
// RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
|
||||
// Window glfwGetX11Window(GLFWwindow* window);
|
||||
// void glfwSetX11SelectionString(const char* string);
|
||||
// const char* glfwGetX11SelectionString(void);
|
||||
|
||||
// struct wl_display* glfwGetWaylandDisplay(void);
|
||||
// struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
|
||||
// struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
|
||||
} else when ODIN_OS == .Darwin {
|
||||
// TODO: Native Darwin
|
||||
// CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
|
||||
// id glfwGetCocoaWindow(GLFWwindow* window);
|
||||
// id glfwGetNSGLContext(GLFWwindow* window);
|
||||
}
|
||||
|
||||
16
vendor/glfw/native_darwin.odin
vendored
Normal file
16
vendor/glfw/native_darwin.odin
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
//+build darwin
|
||||
|
||||
package glfw
|
||||
|
||||
import NS "vendor:darwin/foundation"
|
||||
|
||||
foreign import glfw { "lib/darwin/libglfw3.a" }
|
||||
|
||||
@(default_calling_convention="c", link_prefix="glfw")
|
||||
foreign glfw {
|
||||
GetCocoaWindow :: proc(window: WindowHandle) -> ^NS.Window ---
|
||||
}
|
||||
|
||||
// TODO:
|
||||
// CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
|
||||
// id glfwGetNSGLContext(GLFWwindow* window);
|
||||
15
vendor/glfw/native_linux.odin
vendored
Normal file
15
vendor/glfw/native_linux.odin
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
//+build linux
|
||||
|
||||
package glfw
|
||||
|
||||
// TODO: Native Linux
|
||||
// Display* glfwGetX11Display(void);
|
||||
// RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
|
||||
// RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
|
||||
// Window glfwGetX11Window(GLFWwindow* window);
|
||||
// void glfwSetX11SelectionString(const char* string);
|
||||
// const char* glfwGetX11SelectionString(void);
|
||||
|
||||
// struct wl_display* glfwGetWaylandDisplay(void);
|
||||
// struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
|
||||
// struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
|
||||
15
vendor/glfw/native_windows.odin
vendored
Normal file
15
vendor/glfw/native_windows.odin
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
//+build windows
|
||||
|
||||
package glfw
|
||||
|
||||
import win32 "core:sys/windows"
|
||||
|
||||
foreign import glfw { "lib/glfw3_mt.lib", "system:user32.lib", "system:gdi32.lib", "system:shell32.lib" }
|
||||
|
||||
@(default_calling_convention="c", link_prefix="glfw")
|
||||
foreign glfw {
|
||||
GetWin32Adapter :: proc(monitor: MonitorHandle) -> cstring ---
|
||||
GetWin32Monitor :: proc(monitor: MonitorHandle) -> cstring ---
|
||||
GetWin32Window :: proc(window: WindowHandle) -> win32.HWND ---
|
||||
GetWGLContext :: proc(window: WindowHandle) -> rawptr ---
|
||||
}
|
||||
Reference in New Issue
Block a user