This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |