mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Make core and vendor adhere to -vet, -strict-style, and -disallow-do
This commit is contained in:
@@ -182,18 +182,20 @@ FP_SUBNORMAL :: 4
|
|||||||
@(private)
|
@(private)
|
||||||
_fpclassify :: #force_inline proc(x: double) -> int {
|
_fpclassify :: #force_inline proc(x: double) -> int {
|
||||||
u := transmute(uint64_t)x
|
u := transmute(uint64_t)x
|
||||||
e := u >> 52 & 0x7ff
|
switch e := u >> 52 & 0x7ff; e {
|
||||||
if e == 0 do return FP_SUBNORMAL if (u << 1) != 0 else FP_ZERO
|
case 0: return FP_SUBNORMAL if (u << 1) != 0 else FP_ZERO
|
||||||
if e == 0x7ff do return FP_NAN if (u << 12) != 0 else FP_INFINITE
|
case 0x7ff: return FP_NAN if (u << 12) != 0 else FP_INFINITE
|
||||||
|
}
|
||||||
return FP_NORMAL
|
return FP_NORMAL
|
||||||
}
|
}
|
||||||
|
|
||||||
@(private)
|
@(private)
|
||||||
_fpclassifyf :: #force_inline proc(x: float) -> int {
|
_fpclassifyf :: #force_inline proc(x: float) -> int {
|
||||||
u := transmute(uint32_t)x
|
u := transmute(uint32_t)x
|
||||||
e := u >> 23 & 0xff
|
switch e := u >> 23 & 0xff; e {
|
||||||
if e == 0 do return FP_SUBNORMAL if (u << 1) != 0 else FP_ZERO
|
case 0: return FP_SUBNORMAL if (u << 1) != 0 else FP_ZERO
|
||||||
if e == 0xff do return FP_NAN if (u << 9) != 0 else FP_INFINITE
|
case 0xff: return FP_NAN if (u << 9) != 0 else FP_INFINITE
|
||||||
|
}
|
||||||
return FP_NORMAL
|
return FP_NORMAL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ atomic_exchange_explicit :: #force_inline proc(object: ^$T, desired: T, order: m
|
|||||||
// [success = acq_rel, failure = relaxed] => acqrel_failrelaxed
|
// [success = acq_rel, failure = relaxed] => acqrel_failrelaxed
|
||||||
atomic_compare_exchange_strong :: #force_inline proc(object, expected: ^$T, desired: T) {
|
atomic_compare_exchange_strong :: #force_inline proc(object, expected: ^$T, desired: T) {
|
||||||
value, ok := intrinsics.atomic_cxchg(object, expected^, desired)
|
value, ok := intrinsics.atomic_cxchg(object, expected^, desired)
|
||||||
if !ok do expected^ = value
|
if !ok { expected^ = value }
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,13 +236,13 @@ atomic_compare_exchange_strong_explicit :: #force_inline proc(object, expected:
|
|||||||
value, ok := intrinsics.atomic_cxchg_failacq(object, expected^, desired)
|
value, ok := intrinsics.atomic_cxchg_failacq(object, expected^, desired)
|
||||||
|
|
||||||
}
|
}
|
||||||
if !ok do expected^ = value
|
if !ok { expected^ = value }
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
atomic_compare_exchange_weak :: #force_inline proc(object, expected: ^$T, desired: T) {
|
atomic_compare_exchange_weak :: #force_inline proc(object, expected: ^$T, desired: T) {
|
||||||
value, ok := intrinsics.atomic_cxchgweak(object, expected^, desired)
|
value, ok := intrinsics.atomic_cxchgweak(object, expected^, desired)
|
||||||
if !ok do expected^ = value
|
if !ok { expected^ = value }
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ atomic_compare_exchange_weak_explicit :: #force_inline proc(object, expected: ^$
|
|||||||
value, ok := intrinsics.atomic_cxchgweak_failacq(object, expected^, desired)
|
value, ok := intrinsics.atomic_cxchgweak_failacq(object, expected^, desired)
|
||||||
|
|
||||||
}
|
}
|
||||||
if !ok do expected^ = value
|
if !ok { expected^ = value }
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,13 +71,17 @@ priority_queue_push :: proc(q: ^$Q/Priority_Queue($T), item: T) {
|
|||||||
i := q.len
|
i := q.len
|
||||||
for i > 0 {
|
for i > 0 {
|
||||||
p := (i - 1) / 2
|
p := (i - 1) / 2
|
||||||
if q.priority(s[p]) <= q.priority(item) do break
|
if q.priority(s[p]) <= q.priority(item) {
|
||||||
|
break
|
||||||
|
}
|
||||||
s[i] = s[p]
|
s[i] = s[p]
|
||||||
i = p
|
i = p
|
||||||
}
|
}
|
||||||
|
|
||||||
q.len += 1
|
q.len += 1
|
||||||
if q.len > 0 do s[i] = item
|
if q.len > 0 {
|
||||||
|
s[i] = item
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -96,12 +100,16 @@ priority_queue_pop :: proc(q: ^$Q/Priority_Queue($T)) -> T {
|
|||||||
b := i * 2 + 2
|
b := i * 2 + 2
|
||||||
c := b < q.len && q.priority(s[b]) < q.priority(s[a]) ? b : a
|
c := b < q.len && q.priority(s[b]) < q.priority(s[a]) ? b : a
|
||||||
|
|
||||||
if q.priority(s[c]) >= q.priority(root) do break
|
if q.priority(s[c]) >= q.priority(root) {
|
||||||
|
break
|
||||||
|
}
|
||||||
s[i] = s[c]
|
s[i] = s[c]
|
||||||
i = c
|
i = c
|
||||||
}
|
}
|
||||||
|
|
||||||
if q.len > 0 do s[i] = root
|
if q.len > 0 {
|
||||||
|
s[i] = root
|
||||||
|
}
|
||||||
return min
|
return min
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ clone_array :: proc(array: $A/[]^$T) -> A {
|
|||||||
}
|
}
|
||||||
res := make(A, len(array))
|
res := make(A, len(array))
|
||||||
for elem, i in array {
|
for elem, i in array {
|
||||||
res[i] = auto_cast clone(elem)
|
res[i] = (^T)(clone(elem))
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ clone_dynamic_array :: proc(array: $A/[dynamic]^$T) -> A {
|
|||||||
}
|
}
|
||||||
res := make(A, len(array))
|
res := make(A, len(array))
|
||||||
for elem, i in array {
|
for elem, i in array {
|
||||||
res[i] = auto_cast clone(elem)
|
res[i] = (^T)(clone(elem))
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
@@ -169,10 +169,10 @@ clone_node :: proc(node: ^Node) -> ^Node {
|
|||||||
r.lhs = clone(r.lhs)
|
r.lhs = clone(r.lhs)
|
||||||
r.rhs = clone(r.rhs)
|
r.rhs = clone(r.rhs)
|
||||||
case Block_Stmt:
|
case Block_Stmt:
|
||||||
r.label = auto_cast clone(r.label)
|
r.label = clone(r.label)
|
||||||
r.stmts = clone(r.stmts)
|
r.stmts = clone(r.stmts)
|
||||||
case If_Stmt:
|
case If_Stmt:
|
||||||
r.label = auto_cast clone(r.label)
|
r.label = clone(r.label)
|
||||||
r.init = clone(r.init)
|
r.init = clone(r.init)
|
||||||
r.cond = clone(r.cond)
|
r.cond = clone(r.cond)
|
||||||
r.body = clone(r.body)
|
r.body = clone(r.body)
|
||||||
@@ -186,13 +186,13 @@ clone_node :: proc(node: ^Node) -> ^Node {
|
|||||||
case Defer_Stmt:
|
case Defer_Stmt:
|
||||||
r.stmt = clone(r.stmt)
|
r.stmt = clone(r.stmt)
|
||||||
case For_Stmt:
|
case For_Stmt:
|
||||||
r.label = auto_cast clone(r.label)
|
r.label = clone(r.label)
|
||||||
r.init = clone(r.init)
|
r.init = clone(r.init)
|
||||||
r.cond = clone(r.cond)
|
r.cond = clone(r.cond)
|
||||||
r.post = clone(r.post)
|
r.post = clone(r.post)
|
||||||
r.body = clone(r.body)
|
r.body = clone(r.body)
|
||||||
case Range_Stmt:
|
case Range_Stmt:
|
||||||
r.label = auto_cast clone(r.label)
|
r.label = clone(r.label)
|
||||||
r.vals = clone(r.vals)
|
r.vals = clone(r.vals)
|
||||||
r.expr = clone(r.expr)
|
r.expr = clone(r.expr)
|
||||||
r.body = clone(r.body)
|
r.body = clone(r.body)
|
||||||
@@ -200,12 +200,12 @@ clone_node :: proc(node: ^Node) -> ^Node {
|
|||||||
r.list = clone(r.list)
|
r.list = clone(r.list)
|
||||||
r.body = clone(r.body)
|
r.body = clone(r.body)
|
||||||
case Switch_Stmt:
|
case Switch_Stmt:
|
||||||
r.label = auto_cast clone(r.label)
|
r.label = clone(r.label)
|
||||||
r.init = clone(r.init)
|
r.init = clone(r.init)
|
||||||
r.cond = clone(r.cond)
|
r.cond = clone(r.cond)
|
||||||
r.body = clone(r.body)
|
r.body = clone(r.body)
|
||||||
case Type_Switch_Stmt:
|
case Type_Switch_Stmt:
|
||||||
r.label = auto_cast clone(r.label)
|
r.label = clone(r.label)
|
||||||
r.tag = clone(r.tag)
|
r.tag = clone(r.tag)
|
||||||
r.expr = clone(r.expr)
|
r.expr = clone(r.expr)
|
||||||
r.body = clone(r.body)
|
r.body = clone(r.body)
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ expect_closing_brace_of_field_list :: proc(p: ^Parser) -> tokenizer.Token {
|
|||||||
}
|
}
|
||||||
if allow_token(p, .Semicolon) {
|
if allow_token(p, .Semicolon) {
|
||||||
str := tokenizer.token_to_string(token)
|
str := tokenizer.token_to_string(token)
|
||||||
error(p, end_of_line_pos(p, p.prev_tok), "expected a comma, got %s", p)
|
error(p, end_of_line_pos(p, p.prev_tok), "expected a comma, got %s", str)
|
||||||
}
|
}
|
||||||
return expect_token(p, .Close_Brace)
|
return expect_token(p, .Close_Brace)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ format_value_decl :: proc(p: ^Printer, index: int) {
|
|||||||
align_next := false
|
align_next := false
|
||||||
|
|
||||||
//check to see if there is a binary operator in the last token(this is guaranteed by the ast visit), otherwise it's not multilined
|
//check to see if there is a binary operator in the last token(this is guaranteed by the ast visit), otherwise it's not multilined
|
||||||
for line, line_index in p.lines[eq_line:] {
|
for line in p.lines[eq_line:] {
|
||||||
|
|
||||||
if len(line.format_tokens) == 0 {
|
if len(line.format_tokens) == 0 {
|
||||||
break
|
break
|
||||||
@@ -309,7 +309,7 @@ format_call :: proc(p: ^Printer, line_index: int, format_index: int) {
|
|||||||
paren_count := 1
|
paren_count := 1
|
||||||
done := false
|
done := false
|
||||||
|
|
||||||
for line, line_index in p.lines[paren_line:] {
|
for line in p.lines[paren_line:] {
|
||||||
|
|
||||||
if len(line.format_tokens) == 0 {
|
if len(line.format_tokens) == 0 {
|
||||||
continue
|
continue
|
||||||
@@ -374,7 +374,7 @@ format_keyword_to_brace :: proc(p: ^Printer, line_index: int, format_index: int,
|
|||||||
panic("Should not be possible")
|
panic("Should not be possible")
|
||||||
}
|
}
|
||||||
|
|
||||||
for line, line_index in p.lines[keyword_line:] {
|
for line, line_idx in p.lines[keyword_line:] {
|
||||||
|
|
||||||
if len(line.format_tokens) == 0 {
|
if len(line.format_tokens) == 0 {
|
||||||
continue
|
continue
|
||||||
@@ -388,7 +388,7 @@ format_keyword_to_brace :: proc(p: ^Printer, line_index: int, format_index: int,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if line_index == 0 && i <= format_index {
|
if line_idx == 0 && i <= format_index {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -403,7 +403,7 @@ format_keyword_to_brace :: proc(p: ^Printer, line_index: int, format_index: int,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if line_index != 0 {
|
if line_idx != 0 {
|
||||||
line.format_tokens[0].spaces_before = largest + 1
|
line.format_tokens[0].spaces_before = largest + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -908,7 +908,7 @@ align_comments :: proc(p: ^Printer) {
|
|||||||
|
|
||||||
length := 0
|
length := 0
|
||||||
|
|
||||||
for format_token, i in l.format_tokens {
|
for format_token in l.format_tokens {
|
||||||
if format_token.kind == .Comment {
|
if format_token.kind == .Comment {
|
||||||
if len(l.format_tokens) == 1 {
|
if len(l.format_tokens) == 1 {
|
||||||
l.format_tokens[i].spaces_before = info.length + 1
|
l.format_tokens[i].spaces_before = info.length + 1
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ visit_attributes :: proc(p: ^Printer, attributes: [dynamic]^ast.Attribute) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for attribute, i in attributes {
|
for attribute in attributes {
|
||||||
move_line_limit(p, attribute.pos, 1)
|
move_line_limit(p, attribute.pos, 1)
|
||||||
|
|
||||||
push_generic_token(p, .At, 0)
|
push_generic_token(p, .At, 0)
|
||||||
@@ -1389,7 +1389,6 @@ visit_proc_type :: proc(p: ^Printer, proc_type: ast.Proc_Type, is_proc_lit := fa
|
|||||||
push_generic_token(p, .Gt, 0)
|
push_generic_token(p, .Gt, 0)
|
||||||
|
|
||||||
use_parens := false
|
use_parens := false
|
||||||
use_named := false
|
|
||||||
|
|
||||||
if len(proc_type.results.list) > 1 {
|
if len(proc_type.results.list) > 1 {
|
||||||
use_parens = true
|
use_parens = true
|
||||||
|
|||||||
@@ -135,9 +135,13 @@ has_suffix :: proc(array: $T/[]$E, needle: E) -> bool where intrinsics.type_is_c
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
fill :: proc(array: $T/[]$E, value: E) {
|
fill :: proc(array: $T/[]$E, value: E) #no_bounds_check {
|
||||||
for _, i in array {
|
if len(array) <= 0 {
|
||||||
array[i] = value
|
return
|
||||||
|
}
|
||||||
|
array[0] = value
|
||||||
|
for i := 1; i < len(array); i *= 2 {
|
||||||
|
copy(array[i:], array[:i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,9 @@ _open_file_dialog :: proc(title: string, dir: string,
|
|||||||
|
|
||||||
// Filters need to be passed as a pair of strings (title, filter)
|
// Filters need to be passed as a pair of strings (title, filter)
|
||||||
filter_len := u32(len(filters))
|
filter_len := u32(len(filters))
|
||||||
if filter_len % 2 != 0 do return "", false
|
if filter_len % 2 != 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
filter: string
|
filter: string
|
||||||
filter = strings.join(filters, "\u0000", context.temp_allocator)
|
filter = strings.join(filters, "\u0000", context.temp_allocator)
|
||||||
|
|||||||
@@ -837,7 +837,9 @@ wstring_to_utf8 :: proc(s: Wstring, N: int, allocator := context.temp_allocator)
|
|||||||
}
|
}
|
||||||
|
|
||||||
utf16_to_utf8 :: proc(s: []u16, allocator := context.temp_allocator) -> string {
|
utf16_to_utf8 :: proc(s: []u16, allocator := context.temp_allocator) -> string {
|
||||||
if len(s) == 0 do return ""
|
if len(s) == 0 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
return wstring_to_utf8(cast(Wstring)&s[0], len(s), allocator)
|
return wstring_to_utf8(cast(Wstring)&s[0], len(s), allocator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-3
@@ -761,7 +761,7 @@ when !ODIN_DEBUG {
|
|||||||
// There can be multiple errors, so we're required to continuously call glGetError until there are no more errors
|
// There can be multiple errors, so we're required to continuously call glGetError until there are no more errors
|
||||||
for i := 0; /**/; i += 1 {
|
for i := 0; /**/; i += 1 {
|
||||||
err := cast(Error_Enum)impl_GetError()
|
err := cast(Error_Enum)impl_GetError()
|
||||||
if err == .NO_ERROR do break
|
if err == .NO_ERROR { break }
|
||||||
|
|
||||||
fmt.printf("%d: glGetError() returned GL_%v\n", i, err)
|
fmt.printf("%d: glGetError() returned GL_%v\n", i, err)
|
||||||
|
|
||||||
@@ -770,7 +770,7 @@ when !ODIN_DEBUG {
|
|||||||
{
|
{
|
||||||
// add input arguments
|
// add input arguments
|
||||||
for arg, i in args[num_ret:] {
|
for arg, i in args[num_ret:] {
|
||||||
if i > 0 do fmt.printf(", ")
|
if i > 0 { fmt.printf(", ") }
|
||||||
|
|
||||||
if v, ok := arg.(u32); ok { // TODO: Assumes all u32 are GLenum (they're not, GLbitfield and GLuint are also mapped to u32), fix later by better typing
|
if v, ok := arg.(u32); ok { // TODO: Assumes all u32 are GLenum (they're not, GLbitfield and GLuint are also mapped to u32), fix later by better typing
|
||||||
if err == .INVALID_ENUM {
|
if err == .INVALID_ENUM {
|
||||||
@@ -789,7 +789,7 @@ when !ODIN_DEBUG {
|
|||||||
} else if num_ret > 1 {
|
} else if num_ret > 1 {
|
||||||
fmt.printf(") -> (")
|
fmt.printf(") -> (")
|
||||||
for arg, i in args[1:num_ret] {
|
for arg, i in args[1:num_ret] {
|
||||||
if i > 0 do fmt.printf(", ")
|
if i > 0 { fmt.printf(", ") }
|
||||||
fmt.printf("%v", arg)
|
fmt.printf("%v", arg)
|
||||||
}
|
}
|
||||||
fmt.printf(")\n")
|
fmt.printf(")\n")
|
||||||
|
|||||||
Vendored
+9
-2
@@ -3,8 +3,15 @@ package glfw_bindings
|
|||||||
import "core:c"
|
import "core:c"
|
||||||
import vk "vendor:vulkan"
|
import vk "vendor:vulkan"
|
||||||
|
|
||||||
when ODIN_OS == "linux" do foreign import glfw "system:glfw" // TODO: Add the billion-or-so static libs to link to in linux
|
when ODIN_OS == "linux" { foreign import glfw "system:glfw" } // TODO: Add the billion-or-so static libs to link to in linux
|
||||||
when ODIN_OS == "windows" do foreign import glfw { "lib/glfw3.lib", "system:user32.lib", "system:gdi32.lib", "system:shell32.lib" }
|
when ODIN_OS == "windows" {
|
||||||
|
foreign import glfw {
|
||||||
|
"lib/glfw3.lib",
|
||||||
|
"system:user32.lib",
|
||||||
|
"system:gdi32.lib",
|
||||||
|
"system:shell32.lib",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#assert(size_of(c.int) == size_of(b32))
|
#assert(size_of(c.int) == size_of(b32))
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -3,7 +3,7 @@ package portmidi
|
|||||||
import "core:c"
|
import "core:c"
|
||||||
import "core:strings"
|
import "core:strings"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "portmidi.lib"
|
when ODIN_OS == "windows" { foreign import lib "portmidi.lib" }
|
||||||
|
|
||||||
#assert(size_of(b32) == size_of(c.int))
|
#assert(size_of(b32) == size_of(c.int))
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -7,7 +7,7 @@ package portmidi
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "portmidi_s.lib"
|
when ODIN_OS == "windows" { foreign import lib "portmidi_s.lib" }
|
||||||
|
|
||||||
|
|
||||||
Queue :: distinct rawptr
|
Queue :: distinct rawptr
|
||||||
|
|||||||
Vendored
+13
-10
@@ -2,21 +2,24 @@ package raylib
|
|||||||
|
|
||||||
import c "core:c/libc"
|
import c "core:c/libc"
|
||||||
|
|
||||||
when #config(RAYLIB_USE_LINALG, false) {
|
USE_LINALG :: #config(RAYLIB_USE_LINALG, true)
|
||||||
|
when USE_LINALG {
|
||||||
import "core:math/linalg"
|
import "core:math/linalg"
|
||||||
}
|
}
|
||||||
|
|
||||||
#assert(size_of(rune) == size_of(c.int))
|
#assert(size_of(rune) == size_of(c.int))
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib {
|
when ODIN_OS == "windows" {
|
||||||
"raylib.lib",
|
foreign import lib {
|
||||||
"system:Winmm.lib",
|
"raylib.lib",
|
||||||
"system:Gdi32.lib",
|
"system:Winmm.lib",
|
||||||
"system:User32.lib",
|
"system:Gdi32.lib",
|
||||||
"system:Shell32.lib",
|
"system:User32.lib",
|
||||||
|
"system:Shell32.lib",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
when ODIN_OS == "linux" do foreign import lib "linux/libraylib.a"
|
when ODIN_OS == "linux" { foreign import lib "linux/libraylib.a" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "macos/libraylib.a"
|
when ODIN_OS == "darwin" { foreign import lib "macos/libraylib.a" }
|
||||||
|
|
||||||
VERSION :: "3.7"
|
VERSION :: "3.7"
|
||||||
|
|
||||||
@@ -53,7 +56,7 @@ MAGENTA :: Color{ 255, 0, 255, 255 } // Magenta
|
|||||||
RAYWHITE :: Color{ 245, 245, 245, 255 } // My own White (raylib logo)
|
RAYWHITE :: Color{ 245, 245, 245, 255 } // My own White (raylib logo)
|
||||||
|
|
||||||
|
|
||||||
when #config(RAYLIB_USE_LINALG, false) {
|
when USE_LINALG {
|
||||||
// Vector2 type
|
// Vector2 type
|
||||||
Vector2 :: linalg.Vector2f32
|
Vector2 :: linalg.Vector2f32
|
||||||
// Vector3 type
|
// Vector3 type
|
||||||
|
|||||||
Vendored
+10
-8
@@ -2,15 +2,17 @@ package raylib
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib {
|
when ODIN_OS == "windows" {
|
||||||
"raylib.lib",
|
foreign import lib {
|
||||||
"system:Winmm.lib",
|
"raylib.lib",
|
||||||
"system:Gdi32.lib",
|
"system:Winmm.lib",
|
||||||
"system:User32.lib",
|
"system:Gdi32.lib",
|
||||||
"system:Shell32.lib",
|
"system:User32.lib",
|
||||||
|
"system:Shell32.lib",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
when ODIN_OS == "linux" do foreign import lib "linux/libraylib.a"
|
when ODIN_OS == "linux" { foreign import lib "linux/libraylib.a" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "macos/libraylib.a"
|
when ODIN_OS == "darwin" { foreign import lib "macos/libraylib.a" }
|
||||||
|
|
||||||
GRAPHICS_API_OPENGL_11 :: false
|
GRAPHICS_API_OPENGL_11 :: false
|
||||||
GRAPHICS_API_OPENGL_21 :: true
|
GRAPHICS_API_OPENGL_21 :: true
|
||||||
|
|||||||
Vendored
+4
-4
@@ -3,10 +3,10 @@ package sdl2_image
|
|||||||
import "core:c"
|
import "core:c"
|
||||||
import SDL ".."
|
import SDL ".."
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2_image.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2_image.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2_image"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2_image" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2_image"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2_image" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2_image"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2_image" }
|
||||||
|
|
||||||
bool :: SDL.bool
|
bool :: SDL.bool
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -3,10 +3,10 @@ package sdl2_mixer
|
|||||||
import "core:c"
|
import "core:c"
|
||||||
import SDL ".."
|
import SDL ".."
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2_mixer.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2_mixer.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2_mixer"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2_mixer" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2_mixer"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2_mixer" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2_mixer"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2_mixer" }
|
||||||
|
|
||||||
|
|
||||||
MAJOR_VERSION :: 2
|
MAJOR_VERSION :: 2
|
||||||
|
|||||||
Vendored
+4
-4
@@ -3,10 +3,10 @@ package sdl2_net
|
|||||||
import "core:c"
|
import "core:c"
|
||||||
import SDL ".."
|
import SDL ".."
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2_net.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2_net.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2_net"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2_net" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2_net"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2_net" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2_net"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2_net" }
|
||||||
|
|
||||||
bool :: SDL.bool
|
bool :: SDL.bool
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -25,10 +25,10 @@ package sdl2
|
|||||||
import "core:c"
|
import "core:c"
|
||||||
import "core:intrinsics"
|
import "core:intrinsics"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
version :: struct {
|
version :: struct {
|
||||||
major: u8, /**< major version */
|
major: u8, /**< major version */
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Audio format flags.
|
* \brief Audio format flags.
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { 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.
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { 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.
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
RELEASED :: 0
|
RELEASED :: 0
|
||||||
PRESSED :: 1
|
PRESSED :: 1
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
GameController :: struct {}
|
GameController :: struct {}
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
// Gesture
|
// Gesture
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { 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"
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
Joystick :: struct {}
|
Joystick :: struct {}
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { 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
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
MAX_LOG_MESSAGE :: 4096
|
MAX_LOG_MESSAGE :: 4096
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
MessageBoxFlag :: enum u32 {
|
MessageBoxFlag :: enum u32 {
|
||||||
_ = 0,
|
_ = 0,
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
MetalView :: distinct rawptr
|
MetalView :: distinct rawptr
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
Cursor :: struct {}
|
Cursor :: struct {}
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
MUTEX_TIMEDOUT :: 1
|
MUTEX_TIMEDOUT :: 1
|
||||||
MUTEX_MAXWAIT :: ~u32(0)
|
MUTEX_MAXWAIT :: ~u32(0)
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
ALPHA_OPAQUE :: 255
|
ALPHA_OPAQUE :: 255
|
||||||
ALPHA_TRANSPARENT :: 0
|
ALPHA_TRANSPARENT :: 0
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
Point :: struct {
|
Point :: struct {
|
||||||
x: c.int,
|
x: c.int,
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { 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 */
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
/* RWops Types */
|
/* RWops Types */
|
||||||
RWOPS_UNKNOWN :: 0 /**< Unknown stream type */
|
RWOPS_UNKNOWN :: 0 /**< Unknown stream type */
|
||||||
|
|||||||
Vendored
+4
-4
@@ -5,10 +5,10 @@ import "core:intrinsics"
|
|||||||
import "core:runtime"
|
import "core:runtime"
|
||||||
_, _ :: intrinsics, runtime
|
_, _ :: intrinsics, runtime
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { 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))
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { 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 */
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
// General
|
// General
|
||||||
@(default_calling_convention="c", link_prefix="SDL_")
|
@(default_calling_convention="c", link_prefix="SDL_")
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
SYSWM_TYPE :: enum c.int {
|
SYSWM_TYPE :: enum c.int {
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
Thread :: struct {}
|
Thread :: struct {}
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { 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
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
TouchID :: distinct i64
|
TouchID :: distinct i64
|
||||||
FingerID :: distinct i64
|
FingerID :: distinct i64
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,10 +2,10 @@ package sdl2
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
DisplayMode :: struct {
|
DisplayMode :: struct {
|
||||||
format: u32, /**< pixel format */
|
format: u32, /**< pixel format */
|
||||||
|
|||||||
Vendored
+4
-4
@@ -3,10 +3,10 @@ package sdl2
|
|||||||
import "core:c"
|
import "core:c"
|
||||||
import vk "vendor:vulkan"
|
import vk "vendor:vulkan"
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
|
||||||
|
|
||||||
VkInstance :: vk.Instance
|
VkInstance :: vk.Instance
|
||||||
VkSurfaceKHR :: vk.SurfaceKHR
|
VkSurfaceKHR :: vk.SurfaceKHR
|
||||||
|
|||||||
Vendored
+4
-4
@@ -3,10 +3,10 @@ package sdl2_ttf
|
|||||||
import "core:c"
|
import "core:c"
|
||||||
import SDL ".."
|
import SDL ".."
|
||||||
|
|
||||||
when ODIN_OS == "windows" do foreign import lib "SDL2_ttf.lib"
|
when ODIN_OS == "windows" { foreign import lib "SDL2_ttf.lib" }
|
||||||
when ODIN_OS == "linux" do foreign import lib "system:SDL2_ttf"
|
when ODIN_OS == "linux" { foreign import lib "system:SDL2_ttf" }
|
||||||
when ODIN_OS == "darwin" do foreign import lib "system:SDL2_ttf"
|
when ODIN_OS == "darwin" { foreign import lib "system:SDL2_ttf" }
|
||||||
when ODIN_OS == "freebsd" do foreign import lib "system:SDL2_ttf"
|
when ODIN_OS == "freebsd" { foreign import lib "system:SDL2_ttf" }
|
||||||
|
|
||||||
bool :: SDL.bool
|
bool :: SDL.bool
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user