Skip to content

Instantly share code, notes, and snippets.

View sudokit's full-sized avatar
🌍

sudokit sudokit

🌍
  • /home/sudokit
  • 02:00 (UTC +02:00)
View GitHub Profile
@sudokit
sudokit / vertex_attribs.odin
Created September 17, 2024 15:08
A hacky piece of odin code that automatically generates vertex attrib pointers for a given struct. User needs to provide all opengl types in that struct in order.
import gl "vendor:OpenGL"
import "base:intrinsics"
import "base:runtime"
import "core:fmt"
import "core:reflect"
make_vertex_attribs :: proc($T: typeid, gl_types: [$N]u32) where intrinsics.type_is_struct(T),
N == intrinsics.type_struct_field_count(T) {
@sudokit
sudokit / run.sh
Last active July 19, 2024 14:50
A script to run terminal graphics programs in kitty. makes it so that kitty repaints faster and makes the font square meaning that for ex. circles look like circles
#/bin/bash
if [ "$#" -ne 6 ]; then
echo "Invalid number of params. params are:"
echo "\t size_x: window width (columns)"
echo "\t size_y: window height (rows)"
echo "\t repaint_delay: how often should kitty repaint (ms)"
echo "\t font_size: size of the current font"
echo "\t vsync: well... vsync"
echo "\t runnable: what executable to run inside kitty"
@sudokit
sudokit / main.odin
Last active May 27, 2024 08:39
Cool thing in odin which checks for you if you remembered to assign a procedure for each declaration in a struct so you dont have to wrestle with segfaults
package main
import "./utils"
main :: proc() {
Some :: struct {
baa: proc(),
foo: f32,
bar: proc(),
}