This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
city64 :: proc(data: []byte) -> u64 { | |
// Some primes between 2^63 and 2^64 for various uses. | |
K0 :: 0xc3a5c85c97cb3127 | |
K1 :: 0xb492b66fbe98f273 | |
K2 :: 0x9ae16a3b2f90404f | |
fetch64 :: proc(p: [^]byte) -> u64 { | |
res := intrinsics.unaligned_load((^u64)(p)) | |
when ODIN_ENDIAN == .Big { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "base:intrinsics" | |
import "base:runtime" | |
import "core:hash" | |
import "core:mem" | |
import "core:strings" | |
import "core:unicode" | |
import "core:unicode/utf8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" style="height: 100%;"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Yo</title> | |
</head> | |
<body id="body" style="height: 100%; padding: 0; margin: 0; overflow: hidden;"> | |
<canvas id="wgpu-canvas"></canvas> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deep_clone :: proc(value: $T, allocator := context.allocator, temp_allocator := context.temp_allocator) -> (clone: T) { | |
internal_deep_clone :: proc(value: any, clone: any, ptrs: ^map[rawptr]rawptr) { | |
// Forgive me father for I have sinned. | |
using reflect | |
value_core := any_core(value) | |
clone_core := any_core(clone) | |
assert(value_core.id == clone_core.id) | |
fti := type_info_of(value_core.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "core:c/libc" | |
import "core:fmt" | |
import "core:io" | |
import "core:os" | |
import "core:time" | |
import "core:unicode/utf8" | |
@(require) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package vendor_wgpu_example_fontstash | |
import intr "base:intrinsics" | |
import "core:fmt" | |
import "core:math/linalg" | |
import sa "core:container/small_array" | |
import fs "vendor:fontstash" | |
import "vendor:wgpu" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program: entry.c program.odin | |
odin build . -out:program -no-entry-point -build-mode:object | |
clang entry.c program.o -o program | |
rm program.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rlights | |
import rl "vendor:raylib" | |
MAX_LIGHTS :: 4 | |
Light :: struct { | |
type: LightType, | |
enabled: b32, | |
position: [3]f32, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lldb | |
def is_slice_type(t, internal_dict): | |
return t.name.startswith("[]") or t.name.startswith("[dynamic]") | |
class SliceChildProvider: | |
def __init__(self, val, dict): | |
self.val = val | |
def num_children(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "core:fmt" | |
import "core:io" | |
import "core:odin/ast" | |
import "core:odin/parser" | |
import "core:os" | |
import "core:path/filepath" | |
import "core:slice" | |
import "core:strings" |
NewerOlder