mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 05:08:14 +00:00
sdl2: add openbsd support
This commit is contained in:
Vendored
+2
-1
@@ -7,6 +7,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2_image.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2_image" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2_image" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2_image" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2_image" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_image" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_image" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2_image" }
|
||||||
|
|
||||||
bool :: SDL.bool
|
bool :: SDL.bool
|
||||||
|
|
||||||
@@ -119,4 +120,4 @@ foreign lib {
|
|||||||
|
|
||||||
/* Individual loading functions */
|
/* Individual loading functions */
|
||||||
LoadGIFAnimation_RW :: proc(src: ^SDL.RWops) -> ^Animation ---
|
LoadGIFAnimation_RW :: proc(src: ^SDL.RWops) -> ^Animation ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -7,7 +7,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2_mixer.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2_mixer" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2_mixer" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2_mixer" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2_mixer" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_mixer" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_mixer" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2_mixer" }
|
||||||
|
|
||||||
MAJOR_VERSION :: 2
|
MAJOR_VERSION :: 2
|
||||||
MINOR_VERSION :: 0
|
MINOR_VERSION :: 0
|
||||||
|
|||||||
Vendored
+2
-1
@@ -7,6 +7,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2_net.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2_net" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2_net" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2_net" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2_net" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_net" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_net" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2_net" }
|
||||||
|
|
||||||
bool :: SDL.bool
|
bool :: SDL.bool
|
||||||
|
|
||||||
@@ -188,4 +189,4 @@ Read16 :: #force_inline proc "c" (areap: rawptr) -> u16 {
|
|||||||
Read32 :: #force_inline proc "c" (areap: rawptr) -> u32 {
|
Read32 :: #force_inline proc "c" (areap: rawptr) -> u32 {
|
||||||
area := (^[4]u8)(areap)
|
area := (^[4]u8)(areap)
|
||||||
return u32(area[0])<<24 | u32(area[1])<<16 | u32(area[2])<<8 | u32(area[3])
|
return u32(area[0])<<24 | u32(area[1])<<16 | u32(area[2])<<8 | u32(area[3])
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -29,6 +29,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
version :: struct {
|
version :: struct {
|
||||||
major: u8, /**< major version */
|
major: u8, /**< major version */
|
||||||
@@ -314,4 +315,4 @@ foreign lib {
|
|||||||
IsShapedWindow :: proc(window: ^Window) -> bool ---
|
IsShapedWindow :: proc(window: ^Window) -> bool ---
|
||||||
SetWindowShape :: proc(window: ^Window, shape: ^Surface, shape_mode: ^WindowShapeMode) -> c.int ---
|
SetWindowShape :: proc(window: ^Window, shape: ^Surface, shape_mode: ^WindowShapeMode) -> c.int ---
|
||||||
GetShapedWindowMode :: proc(window: ^Window, shape_mode: ^WindowShapeMode) -> c.int ---
|
GetShapedWindowMode :: proc(window: ^Window, shape_mode: ^WindowShapeMode) -> c.int ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Audio format flags.
|
* \brief Audio format flags.
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief The blend mode used in SDL_RenderCopy() and drawing operations.
|
* \brief The blend mode used in SDL_RenderCopy() and drawing operations.
|
||||||
@@ -62,4 +63,4 @@ BlendFactor :: enum c.int {
|
|||||||
foreign lib {
|
foreign lib {
|
||||||
ComposeCustomBlendMode :: proc(srcColorFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation,
|
ComposeCustomBlendMode :: proc(srcColorFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation,
|
||||||
srcAlphaFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) -> BlendMode ---
|
srcAlphaFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) -> BlendMode ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
/* This is a guess for the cacheline size used for padding.
|
/* This is a guess for the cacheline size used for padding.
|
||||||
* Most x86 processors have a 64 byte cache line.
|
* Most x86 processors have a 64 byte cache line.
|
||||||
@@ -41,4 +42,4 @@ foreign lib {
|
|||||||
SIMDAlloc :: proc(len: c.size_t) -> rawptr ---
|
SIMDAlloc :: proc(len: c.size_t) -> rawptr ---
|
||||||
SIMDRealloc :: proc(mem: rawptr, len: c.size_t) -> rawptr ---
|
SIMDRealloc :: proc(mem: rawptr, len: c.size_t) -> rawptr ---
|
||||||
SIMDFree :: proc(ptr: rawptr) ---
|
SIMDFree :: proc(ptr: rawptr) ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
RELEASED :: 0
|
RELEASED :: 0
|
||||||
PRESSED :: 1
|
PRESSED :: 1
|
||||||
@@ -498,4 +499,4 @@ foreign lib {
|
|||||||
FilterEvents :: proc(filter: EventFilter, userdata: rawptr) ---
|
FilterEvents :: proc(filter: EventFilter, userdata: rawptr) ---
|
||||||
EventState :: proc(type: EventType, state: c.int) -> u8 ---
|
EventState :: proc(type: EventType, state: c.int) -> u8 ---
|
||||||
RegisterEvents :: proc(numevents: c.int) -> u32 ---
|
RegisterEvents :: proc(numevents: c.int) -> u32 ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
GameController :: struct {}
|
GameController :: struct {}
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
// Gesture
|
// Gesture
|
||||||
|
|
||||||
@@ -259,4 +260,4 @@ foreign lib {
|
|||||||
HapticRumbleInit :: proc(haptic: ^Haptic) -> c.int ---
|
HapticRumbleInit :: proc(haptic: ^Haptic) -> c.int ---
|
||||||
HapticRumblePlay :: proc(haptic: ^Haptic, strength: f32, length: u32) -> c.int ---
|
HapticRumblePlay :: proc(haptic: ^Haptic, strength: f32, length: u32) -> c.int ---
|
||||||
HapticRumbleStop :: proc(haptic: ^Haptic) -> c.int ---
|
HapticRumbleStop :: proc(haptic: ^Haptic) -> c.int ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
HINT_ACCELEROMETER_AS_JOYSTICK :: "SDL_ACCELEROMETER_AS_JOYSTICK"
|
HINT_ACCELEROMETER_AS_JOYSTICK :: "SDL_ACCELEROMETER_AS_JOYSTICK"
|
||||||
HINT_ALLOW_ALT_TAB_WHILE_GRABBED :: "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"
|
HINT_ALLOW_ALT_TAB_WHILE_GRABBED :: "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"
|
||||||
@@ -146,4 +147,4 @@ foreign lib {
|
|||||||
AddHintCallback :: proc(name: cstring, callback: HintCallback, userdata: rawptr) ---
|
AddHintCallback :: proc(name: cstring, callback: HintCallback, userdata: rawptr) ---
|
||||||
DelHintCallback :: proc(name: cstring, callback: HintCallback, userdata: rawptr) ---
|
DelHintCallback :: proc(name: cstring, callback: HintCallback, userdata: rawptr) ---
|
||||||
ClearHints :: proc() ---
|
ClearHints :: proc() ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
Joystick :: struct {}
|
Joystick :: struct {}
|
||||||
|
|
||||||
@@ -106,4 +107,4 @@ foreign lib {
|
|||||||
JoystickSendEffect :: proc(joystick: ^Joystick, data: rawptr, size: c.int) -> c.int ---
|
JoystickSendEffect :: proc(joystick: ^Joystick, data: rawptr, size: c.int) -> c.int ---
|
||||||
JoystickClose :: proc(joystick: ^Joystick) ---
|
JoystickClose :: proc(joystick: ^Joystick) ---
|
||||||
JoystickCurrentPowerLevel :: proc(joystick: ^Joystick) -> JoystickPowerLevel ---
|
JoystickCurrentPowerLevel :: proc(joystick: ^Joystick) -> JoystickPowerLevel ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
Keysym :: struct {
|
Keysym :: struct {
|
||||||
scancode: Scancode, /**< SDL physical key code - see ::SDL_Scancode for details */
|
scancode: Scancode, /**< SDL physical key code - see ::SDL_Scancode for details */
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
MAX_LOG_MESSAGE :: 4096
|
MAX_LOG_MESSAGE :: 4096
|
||||||
|
|
||||||
@@ -74,4 +75,4 @@ foreign lib {
|
|||||||
// LogMessageV :: proc(category: c.int, priority: LogPriority, fmt: cstring, ap: va_list) ---
|
// LogMessageV :: proc(category: c.int, priority: LogPriority, fmt: cstring, ap: va_list) ---
|
||||||
LogGetOutputFunction :: proc(callback: ^LogOutputFunction, userdata: ^rawptr) ---
|
LogGetOutputFunction :: proc(callback: ^LogOutputFunction, userdata: ^rawptr) ---
|
||||||
LogSetOutputFunction :: proc(callback: LogOutputFunction, userdata: rawptr) ---
|
LogSetOutputFunction :: proc(callback: LogOutputFunction, userdata: rawptr) ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
MessageBoxFlag :: enum u32 {
|
MessageBoxFlag :: enum u32 {
|
||||||
_ = 0,
|
_ = 0,
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
MetalView :: distinct rawptr
|
MetalView :: distinct rawptr
|
||||||
|
|
||||||
@@ -15,4 +16,4 @@ foreign lib {
|
|||||||
Metal_DestroyView :: proc(view: MetalView) ---
|
Metal_DestroyView :: proc(view: MetalView) ---
|
||||||
Metal_GetLayer :: proc(view: MetalView) -> rawptr ---
|
Metal_GetLayer :: proc(view: MetalView) -> rawptr ---
|
||||||
Metal_GetDrawableSize :: proc(window: ^Window, w, h: ^c.int) ---
|
Metal_GetDrawableSize :: proc(window: ^Window, w, h: ^c.int) ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
Cursor :: struct {}
|
Cursor :: struct {}
|
||||||
|
|
||||||
@@ -61,4 +62,4 @@ foreign lib {
|
|||||||
GetDefaultCursor :: proc() -> ^Cursor ---
|
GetDefaultCursor :: proc() -> ^Cursor ---
|
||||||
FreeCursor :: proc(cursor: ^Cursor) ---
|
FreeCursor :: proc(cursor: ^Cursor) ---
|
||||||
ShowCursor :: proc(toggle: c.int) -> c.int ---
|
ShowCursor :: proc(toggle: c.int) -> c.int ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
MUTEX_TIMEDOUT :: 1
|
MUTEX_TIMEDOUT :: 1
|
||||||
MUTEX_MAXWAIT :: ~u32(0)
|
MUTEX_MAXWAIT :: ~u32(0)
|
||||||
@@ -41,4 +42,4 @@ foreign lib {
|
|||||||
CondBroadcast :: proc(cv: ^cond) -> c.int ---
|
CondBroadcast :: proc(cv: ^cond) -> c.int ---
|
||||||
CondWait :: proc(cv: ^cond, m: ^mutex) -> c.int ---
|
CondWait :: proc(cv: ^cond, m: ^mutex) -> c.int ---
|
||||||
CondWaitTimeout :: proc(cv: ^cond, m: ^mutex, ms: u32) -> c.int ---
|
CondWaitTimeout :: proc(cv: ^cond, m: ^mutex, ms: u32) -> c.int ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
ALPHA_OPAQUE :: 255
|
ALPHA_OPAQUE :: 255
|
||||||
ALPHA_TRANSPARENT :: 0
|
ALPHA_TRANSPARENT :: 0
|
||||||
@@ -234,4 +235,4 @@ foreign lib {
|
|||||||
GetRGB :: proc(pixel: u32, format: ^PixelFormat, r, g, b: ^u8) ---
|
GetRGB :: proc(pixel: u32, format: ^PixelFormat, r, g, b: ^u8) ---
|
||||||
GetRGBA :: proc(pixel: u32, format: ^PixelFormat, r, g, b, a: ^u8) ---
|
GetRGBA :: proc(pixel: u32, format: ^PixelFormat, r, g, b, a: ^u8) ---
|
||||||
CalculateGammaRamp :: proc(gamma: f32, ramp: ^[256]u16) ---
|
CalculateGammaRamp :: proc(gamma: f32, ramp: ^[256]u16) ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
Point :: struct {
|
Point :: struct {
|
||||||
x: c.int,
|
x: c.int,
|
||||||
@@ -47,4 +48,4 @@ foreign lib {
|
|||||||
UnionRect :: proc(A, B: ^Rect, result: ^Rect) ---
|
UnionRect :: proc(A, B: ^Rect, result: ^Rect) ---
|
||||||
EnclosePoints :: proc(points: [^]Point, count: c.int, clip: ^Rect, result: ^Rect) -> bool ---
|
EnclosePoints :: proc(points: [^]Point, count: c.int, clip: ^Rect, result: ^Rect) -> bool ---
|
||||||
IntersectRectAndLine :: proc(rect: ^Rect, X1, Y1, X2, Y2: ^c.int) -> bool ---
|
IntersectRectAndLine :: proc(rect: ^Rect, X1, Y1, X2, Y2: ^c.int) -> bool ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
RendererFlag :: enum u32 {
|
RendererFlag :: enum u32 {
|
||||||
SOFTWARE = 0, /**< The renderer is a software fallback */
|
SOFTWARE = 0, /**< The renderer is a software fallback */
|
||||||
@@ -140,4 +141,4 @@ foreign lib {
|
|||||||
GL_UnbindTexture :: proc(texture: ^Texture) -> c.int ---
|
GL_UnbindTexture :: proc(texture: ^Texture) -> c.int ---
|
||||||
RenderGetMetalLayer :: proc(renderer: ^Renderer) -> rawptr ---
|
RenderGetMetalLayer :: proc(renderer: ^Renderer) -> rawptr ---
|
||||||
RenderGetMetalCommandEncoder :: proc(renderer: ^Renderer) -> rawptr ---
|
RenderGetMetalCommandEncoder :: proc(renderer: ^Renderer) -> rawptr ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
/* RWops Types */
|
/* RWops Types */
|
||||||
RWOPS_UNKNOWN :: 0 /**< Unknown stream type */
|
RWOPS_UNKNOWN :: 0 /**< Unknown stream type */
|
||||||
@@ -105,4 +106,4 @@ foreign lib {
|
|||||||
WriteBE32 :: proc(dst: ^RWops, value: ^u32) -> c.size_t ---
|
WriteBE32 :: proc(dst: ^RWops, value: ^u32) -> c.size_t ---
|
||||||
WriteLE64 :: proc(dst: ^RWops, value: ^u64) -> c.size_t ---
|
WriteLE64 :: proc(dst: ^RWops, value: ^u64) -> c.size_t ---
|
||||||
WriteBE64 :: proc(dst: ^RWops, value: ^u64) -> c.size_t ---
|
WriteBE64 :: proc(dst: ^RWops, value: ^u64) -> c.size_t ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -9,6 +9,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
bool :: distinct b32
|
bool :: distinct b32
|
||||||
#assert(size_of(bool) == size_of(c.int))
|
#assert(size_of(bool) == size_of(c.int))
|
||||||
@@ -160,4 +161,4 @@ iconv_utf8_ucs2 :: proc "c" (s: string) -> [^]u16 {
|
|||||||
iconv_utf8_utf32 :: iconv_utf8_ucs4
|
iconv_utf8_utf32 :: iconv_utf8_ucs4
|
||||||
iconv_utf8_ucs4 :: proc "c" (s: string) -> [^]rune {
|
iconv_utf8_ucs4 :: proc "c" (s: string) -> [^]rune {
|
||||||
return cast([^]rune)iconv_string("UCS-4-INTERNAL", "UTF-8", cstring(raw_data(s)), len(s)+1)
|
return cast([^]rune)iconv_string("UCS-4-INTERNAL", "UTF-8", cstring(raw_data(s)), len(s)+1)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
SWSURFACE :: 0 /**< Just here for compatibility */
|
SWSURFACE :: 0 /**< Just here for compatibility */
|
||||||
PREALLOC :: 0x00000001 /**< Surface uses preallocated memory */
|
PREALLOC :: 0x00000001 /**< Surface uses preallocated memory */
|
||||||
@@ -108,4 +109,4 @@ foreign lib {
|
|||||||
SetYUVConversionMode :: proc(mode: YUV_CONVERSION_MODE) ---
|
SetYUVConversionMode :: proc(mode: YUV_CONVERSION_MODE) ---
|
||||||
GetYUVConversionMode :: proc() -> YUV_CONVERSION_MODE ---
|
GetYUVConversionMode :: proc() -> YUV_CONVERSION_MODE ---
|
||||||
GetYUVConversionModeForResolution :: proc(width, height: c.int) -> YUV_CONVERSION_MODE ---
|
GetYUVConversionModeForResolution :: proc(width, height: c.int) -> YUV_CONVERSION_MODE ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
// General
|
// General
|
||||||
@(default_calling_convention="c", link_prefix="SDL_")
|
@(default_calling_convention="c", link_prefix="SDL_")
|
||||||
@@ -122,4 +123,4 @@ foreign lib {
|
|||||||
AndroidGetExternalStoragePath :: proc() -> cstring ---
|
AndroidGetExternalStoragePath :: proc() -> cstring ---
|
||||||
AndroidRequestPermission :: proc(permission: cstring) -> bool ---
|
AndroidRequestPermission :: proc(permission: cstring) -> bool ---
|
||||||
AndroidShowToast :: proc(message: cstring, duration, gravity, xoffset, yoffset: c.int) -> c.int ---
|
AndroidShowToast :: proc(message: cstring, duration, gravity, xoffset, yoffset: c.int) -> c.int ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
SYSWM_TYPE :: enum c.int {
|
SYSWM_TYPE :: enum c.int {
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
@@ -105,4 +106,4 @@ SysWMinfo :: struct {
|
|||||||
@(default_calling_convention="c", link_prefix="SDL_")
|
@(default_calling_convention="c", link_prefix="SDL_")
|
||||||
foreign lib {
|
foreign lib {
|
||||||
GetWindowWMInfo :: proc(window: ^Window, info: ^SysWMinfo) -> bool ---
|
GetWindowWMInfo :: proc(window: ^Window, info: ^SysWMinfo) -> bool ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
Thread :: struct {}
|
Thread :: struct {}
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
TimerCallback :: proc "c" (interval: u32, param: rawptr) -> u32
|
TimerCallback :: proc "c" (interval: u32, param: rawptr) -> u32
|
||||||
TimerID :: distinct c.int
|
TimerID :: distinct c.int
|
||||||
@@ -22,4 +23,4 @@ foreign lib {
|
|||||||
Delay :: proc(ms: u32) ---
|
Delay :: proc(ms: u32) ---
|
||||||
AddTimer :: proc(interval: u32, callback: TimerCallback, param: rawptr) -> TimerID ---
|
AddTimer :: proc(interval: u32, callback: TimerCallback, param: rawptr) -> TimerID ---
|
||||||
RemoveTimer :: proc(id: TimerID) -> bool ---
|
RemoveTimer :: proc(id: TimerID) -> bool ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
TouchID :: distinct i64
|
TouchID :: distinct i64
|
||||||
FingerID :: distinct i64
|
FingerID :: distinct i64
|
||||||
@@ -34,4 +35,4 @@ foreign lib {
|
|||||||
GetTouchDeviceType :: proc(touchID: TouchID) -> TouchDeviceType ---
|
GetTouchDeviceType :: proc(touchID: TouchID) -> TouchDeviceType ---
|
||||||
GetNumTouchFingers :: proc(touchID: TouchID) -> c.int ---
|
GetNumTouchFingers :: proc(touchID: TouchID) -> c.int ---
|
||||||
GetTouchFinger :: proc(touchID: TouchID, index: c.int) -> ^Finger ---
|
GetTouchFinger :: proc(touchID: TouchID, index: c.int) -> ^Finger ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -6,6 +6,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
DisplayMode :: struct {
|
DisplayMode :: struct {
|
||||||
format: u32, /**< pixel format */
|
format: u32, /**< pixel format */
|
||||||
@@ -310,4 +311,4 @@ foreign lib {
|
|||||||
// Used by vendor:OpenGL
|
// Used by vendor:OpenGL
|
||||||
gl_set_proc_address :: proc(p: rawptr, name: cstring) {
|
gl_set_proc_address :: proc(p: rawptr, name: cstring) {
|
||||||
(^rawptr)(p)^ = GL_GetProcAddress(name)
|
(^rawptr)(p)^ = GL_GetProcAddress(name)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -7,6 +7,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
VkInstance :: vk.Instance
|
VkInstance :: vk.Instance
|
||||||
VkSurfaceKHR :: vk.SurfaceKHR
|
VkSurfaceKHR :: vk.SurfaceKHR
|
||||||
@@ -22,4 +23,4 @@ foreign lib {
|
|||||||
Vulkan_GetInstanceExtensions :: proc(window: ^Window, pCount: ^c.uint, pNames: [^]cstring) -> bool ---
|
Vulkan_GetInstanceExtensions :: proc(window: ^Window, pCount: ^c.uint, pNames: [^]cstring) -> bool ---
|
||||||
Vulkan_CreateSurface :: proc(window: ^Window, instance: VkInstance, surface: ^VkSurfaceKHR) -> bool ---
|
Vulkan_CreateSurface :: proc(window: ^Window, instance: VkInstance, surface: ^VkSurfaceKHR) -> bool ---
|
||||||
Vulkan_GetDrawableSize :: proc(window: ^Window, w, h: ^c.int) ---
|
Vulkan_GetDrawableSize :: proc(window: ^Window, w, h: ^c.int) ---
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-1
@@ -7,6 +7,7 @@ when ODIN_OS == .Windows { foreign import lib "SDL2_ttf.lib" }
|
|||||||
when ODIN_OS == .Linux { foreign import lib "system:SDL2_ttf" }
|
when ODIN_OS == .Linux { foreign import lib "system:SDL2_ttf" }
|
||||||
when ODIN_OS == .Darwin { foreign import lib "system:SDL2_ttf" }
|
when ODIN_OS == .Darwin { foreign import lib "system:SDL2_ttf" }
|
||||||
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_ttf" }
|
when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_ttf" }
|
||||||
|
when ODIN_OS == .OpenBSD { foreign import lib "system:SDL2_ttf" }
|
||||||
|
|
||||||
bool :: SDL.bool
|
bool :: SDL.bool
|
||||||
|
|
||||||
@@ -163,4 +164,4 @@ foreign lib {
|
|||||||
|
|
||||||
SetFontSDF :: proc(font: ^Font, on_off: bool) -> c.int ---
|
SetFontSDF :: proc(font: ^Font, on_off: bool) -> c.int ---
|
||||||
GetFontSDF :: proc(font: ^Font) -> bool ---
|
GetFontSDF :: proc(font: ^Font) -> bool ---
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user