Skip to content

Instantly share code, notes, and snippets.

View wrapperup's full-sized avatar
💤

wrap wrapperup

💤
View GitHub Profile
@wrapperup
wrapperup / parallel_for.odin
Last active May 13, 2025 16:26
Simple parallel for + task pool
package game
import "core:math"
import "core:sync"
import "core:thread"
import "core:fmt"
POOL: thread.Pool
THREAD_COUNT: int = 0
@wrapperup
wrapperup / example.odin
Created November 25, 2024 07:24
Odin Vulkan + Slang Hot-Reloading Example
package example
import "core:fmt"
import "core:os"
import "core:slice"
import "core:time"
import "vendor:glfw"
import vk "vendor:vulkan"
@wrapperup
wrapperup / imgui_config.odin
Created October 17, 2024 00:23
My Imgui Theme
configure_im :: proc() {
io := im.GetIO()
font_config: im.FontConfig = {}
font_config.FontDataOwnedByAtlas = true
font_config.OversampleH = 6
font_config.OversampleV = 6
font_config.GlyphMaxAdvanceX = max(f32)
font_config.RasterizerMultiply = 1.4
@wrapperup
wrapperup / vulkan_matrix_math.odin
Created July 15, 2024 20:40
Vulkan / DirectX matrix functions
@(require_results)
matrix4_perspective_z0_f32 :: proc "contextless" (
fovy, aspect, near, far: f32,
) -> (
m: linalg.Matrix4f32,
) #no_bounds_check {
tan_half_fovy := math.tan(0.5 * fovy)
m[0, 0] = 1 / (aspect * tan_half_fovy)
m[1, 1] = 1 / (tan_half_fovy)
m[3, 2] = +1