Skip to content

Instantly share code, notes, and snippets.

View thebirk's full-sized avatar

Aleksander Birkeland thebirk

View GitHub Profile
anonymous
anonymous / lexer.odin
Created May 27, 2017 13:41
#import "fmt.odin";
#import "os.odin";
#import "utf8.odin";
#import "strconv.odin";
Lexer :: struct {
file: []byte,
offset: int,
last_rune_size: int,
@vassvik
vassvik / events.go
Created September 29, 2017 17:39
An event queue backed by a ring buffer and tagged unions implemented in Odin. (Note: File names are .go for syntax highlighting)
import "core:fmt.odin";
// Define event types, based on GLFW's events
Window_Iconify_Event :: struct { iconified: i32};
Window_Refresh_Event :: struct { };
Window_Focus_Event :: struct { focused: i32 };
Window_Close_Event :: struct { };
Window_Size_Event :: struct { width, height: i32 };
Window_Pos_Event :: struct { xpos, ypos: i32 };
@gingerBill
gingerBill / wasm.odin
Last active May 6, 2020 14:26
Basic WASM Assembler in Odin
package wasm_assembler
import "core:fmt"
PAGE_SIZE :: 1<<16;
Val_Type :: enum u8 {
void = 0x00,
i32 = 0x7f,
i64 = 0x7e,