Odin language bindings for the Playdate SDK.
- Odin compiler
- Playdate SDK 3.0.0
- Playdate SDK C Prerequisites (ARM toolchain for device builds)
Make sure you have these installed before proceeding.
To try the example:
cd example
make simulatorThis will build Example.pdx - open it with the Playdate Simulator to run the example game.
Place this repository's playdate folder somewhere in your project. You can import it in your Odin code as:
import playdate "path/to/playdate"You can use the files in the example folder as the basis for your game. Copy them into your project and configure:
pdxinfo- Update with your game's name, author, description, and bundle IDMakefile- Update your product name (the name of the final.pdxapp folder) and the path toplaydate/buildsupport/Makefile.inc
Set the Playdate SDK path in your environment:
export PLAYDATE_SDK_PATH=/path/to/PlaydateSDKOr alternatively, set it at the top of your Makefile:
PLAYDATE_SDK_PATH=/path/to/PlaydateSDKBuild your game with one of these commands:
make simulator # Build for simulator
make simulator-run # Build and launch in the Playdate Simulator
make device # Build for device
make device-run # Build and launch on the device
make clean # Clean build filesBuilds default to BUILD=debug (full runtime checks, assertions, source locations, and -debug/DWARF on the simulator). Pass BUILD=release to strip those and optimize for speed:
make simulator BUILD=release
make device BUILD=releaseThe build will create a .pdx bundle in your project directory that you can run in the Playdate Simulator or upload to your device.
The eventHandler function you copied from the example is the entry point of your game. See the Game Initialization guide for details on how it works.
For the complete API reference, see the Playdate C API documentation. These Odin bindings directly mirror the C API, so the C documentation applies to the Odin code as well.
The API bindings are generated using the awesome odin-c-bindgen by Karl Zylinski.