Skip to content

Instantly share code, notes, and snippets.

View kooparse's full-sized avatar
🧨
Wired in

Alexandre Chêne kooparse

🧨
Wired in
View GitHub Profile
@kooparse
kooparse / build_metal_shaders.jai
Created April 2, 2023 09:56
This snippet shows you how to make a Library.metallib from all your .metal files
// You could use this snippet generally before compiling your program.
#run {
build_metal_shaders("./path-to-your-shaders-folder");
}
/*
Build all shaders for our metal backend.
@kooparse
kooparse / model_loader.jai
Last active November 29, 2023 09:49
How to load a glTF model with gltf_parser.
/*
Some important definition here to understand what's going on.
1) Animation.
An animation have multiple "parts" (in glTF it's called channels).
Each part targets only one transformation, meanings one translation or rotation or scale on a specified node.
So when we want to play an animation, we go through each animation parts, and updates transformation "part"
for an associated node. After that, we compute the local transform matrix on those nodes,
@kooparse
kooparse / input.jai
Last active February 27, 2024 22:43
My current input.jai
events_this_frame: [..] SDL_Event;
mouse_delta_x := 0;
mouse_delta_y := 0;
cursor : Vector2;
#scope_file;
key_states : Table(Key_Code, Key_Current_State);