Skip to content

Instantly share code, notes, and snippets.

@yasinkaraaslan
yasinkaraaslan / dds.jai
Last active August 20, 2025 11:10
DDS Loader in Jai
// https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-reference
// NOTE(Yasin): This doesn't support some niche formats for simplicity sake.
// Namely R8G8_B8G8, G8R8_G8B8, legacy UYVY-packed, and legacy YUY2-packed formats.
// Though, it shouldn't be too hard to implement them.
load_dds :: (file_name: string) -> bool, DDS_Data {
content, read_success := read_entire_file(file_name);
if !read_success {
@yasinkaraaslan
yasinkaraaslan / first.jai
Last active June 24, 2025 17:14
Jai Metaprogram for Linking with RAD Linker
LINKER_FILE_NAME :: "radlink.exe";
#run build();
build :: () {
set_build_options_dc(.{do_output=false});
set_working_directory(#filepath);
options := get_build_options();
options.output_type = .EXECUTABLE;
options.output_executable_name = "My Executable";
options.output_path = "./build/";