Skip to content

Instantly share code, notes, and snippets.

const toolbox = @import("toolbox.zig");
const std = @import("std");
const root = @import("root");
const ENABLE_PROFILER = if (@hasDecl(root, "ENABLE_PROFILER"))
@field(root, "ENABLE_PROFILER")
else
@compileError("Root module must have ENABLE_PROFILER flag!");
pub const State = struct {
@DanB91
DanB91 / README.txt
Last active November 28, 2022 04:57
Playdate Zig starting point
THIS GIST IS OUT OF DATE! Please use my new project template here to get started with Zig on Playdate:
https://github.com/DanB91/Zig-Playdate-Template
The rest of this is preservied for historical reasons:
This is a small snippet of some code to get you started for developing for the Playdate on Zig. This code should be used as a starting point and may not compile without some massaging. This code has only been tested out on macOS and you'll need to modify the addSharedLibrary() portion of build.zig to output a .dll or .so instead of a .dylib, depending on you platform.
This code will help you produce both an executable for the Playdate simulator and also an executable that actually run on the Playdate hardware.