Skip to content

Instantly share code, notes, and snippets.

@maskrosen
maskrosen / raylib_render_extras.h
Created December 10, 2024 10:06
Some extended Raylib rendering functions
/**
raylib-render-extras - Some render functions that avoids extra overhead when rendering multiple instances.
Tested with Raylib 4.2 might work with other versions
See https://youtu.be/2EOjGwhYXds?si=fcJzO1VjbLQ1dzRW&t=319 for a brief explanation of the functions
Copyright (c) 2024 Lingon Studios
The code is derived from Raylib Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
This software is provided "as-is", without any express or implied warranty. In no event
@jakubtomsu
jakubtomsu / obj.odin
Created October 6, 2024 09:34
Simple .obj 3d model parser, doesn't support 100% features like curves and whatnot but it's good enough for most regular models.
package obj
import "core:fmt"
import "core:math/linalg"
import "core:os"
import "core:strconv"
import "core:strings"
// https://en.wikipedia.org/wiki/Wavefront_.obj_file
@lassade
lassade / fixed_swiss_hashmap.zig
Last active August 31, 2024 03:59
A fixed (no allocations) hashmap that follows the Google Swiss Table design principles
const std = @import("std");
const builtin = @import("builtin");
pub const StringContext = struct {
pub inline fn hash(_: @This(), s: []const u8) u64 {
return std.hash_map.hashString(s);
}
pub inline fn eql(_: @This(), a: []const u8, b: []const u8) bool {
return std.mem.eql(u8, a, b);
}
@jakubtomsu
jakubtomsu / realtime_collision_detection.odin
Last active May 28, 2025 08:00
Port of some functions from 'Real Time Collision Detection' book by Christer Ericson to Odin
// Port of some collision functions to Odin by Jakub Tomšů.
//
// from Real-Time Collision Detection by Christer Ericson, published by Morgan Kaufmann Publishers, © 2005 Elsevier Inc
//
// This should serve as an reference implementation for common collision queries for games.
// The goal is good numerical robustness, handling edge cases and optimized math equations.
// The code isn't necessarily very optimized.
//
// There are a few cases you don't want to use the procedures below directly, but instead manually inline the math and adapt it to your needs.
// In my experience this method is clearer when writing complex level queries where I need to handle edge cases differently etc.
@mmozeiko
mmozeiko / wic.h
Last active February 14, 2025 19:56
simple wrapper to load or save D3D11 texture from/to image file with Windows Imaging Component
#pragma once
#define COBJMACROS
#include <windows.h>
#include <d3d11.h>
//
// interface
//
@Sharktheone
Sharktheone / Arch-Mojo.md
Last active December 10, 2024 14:08
Install the new mojo programming language on Arch. This will be obsolete when mojo adds official Arch support.
@silversquirl
silversquirl / .gitignore
Last active October 2, 2024 20:30
A fast, simple allocator for Zig
.zig-cache/
@tilacog
tilacog / transaction_manager.rs
Created October 20, 2022 22:49
Transaction manager
use std::time::{Duration, Instant};
/// How many confirmations to wait for
const REQUIRED_CONFIRMATIONS: u32 = 1;
const WAIT_TIME_IN_SECONDS: u64 = 60;
const HARD_TIMEOUT_FACTOR: u64 = 10;
/// Time before giving up on waiting for transaction confirmation. After this time, we expect the
/// Transaction Monitor to bump the gas price and re-broadcast the transaction.
@raysan5
raysan5 / raylib_vs_sdl.md
Last active June 17, 2025 06:27
raylib vs SDL - A libraries comparison

raylib_vs_sdl

In the last years I've been asked multiple times about the comparison between raylib and SDL libraries. Unfortunately, my experience with SDL was quite limited so I couldn't provide a good comparison. In the last two years I've learned about SDL and used it to teach at University so I feel that now I can provide a good comparison between both.

Hope it helps future users to better understand this two libraries internals and functionality.

Table of Content

@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active June 17, 2025 10:30
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27