Skip to content

Instantly share code, notes, and snippets.

View mlarouche's full-sized avatar

Michaël Larouche mlarouche

View GitHub Profile
@mlarouche
mlarouche / command_list.zig
Last active March 13, 2022 12:27
free function to Self wrapper
const std = @import("std");
const platform = @import("../platforms/platform.zig").platform;
const GpuResource = @import("gpu_resource.zig").GpuResource;
pub const CommandListKind = enum {
Graphics,
Compute,
Copy,
};
@mlarouche
mlarouche / SaveGameManagement.md
Last active March 29, 2023 21:15
So you want to handle save games ?

So you want to handle save games ?

Most games once reaced a certain size will need to persist data between game sessions. In our game dev jargon, we call this data a Save Game.

Your first reflex would be to think: oh this is easy, we only need to find the user's documents or data folder and use simple file read and write operations to handle the save data.

Assumming we are using the Zig programming language, our favorite here at Cold Bytes Games, and the library known-folders, a naive save game serialization code could look like this (this code has not been tested).

const known_folders = @import("known-folders");