|
|
Learn the GDK from the first window to complete Scene examples.
|
Overview
The CRM64Pro tutorials are the main teaching path for the GDK. They begin with a minimal application window, then progressively add resources, rendering callbacks, CDC archives, debug tools and the engine managers used by real projects.
Keep the matching source file open while reading each page. The tutorial page explains the code flow, while the complete source remains authoritative.
Requirements
- Install the CRM64Pro GDK and a supported compiler with C++17 support.
- Download the tutorial package and extract the complete ZIP into a writable working folder. It includes the source code, projects and required assets.
- Keep the extracted source/, projects/ and bin/Base/ folders together with their original structure.
- On Windows, open projects/windows/C64 Tutorials.sln in Visual Studio. On Linux or macOS, use the Makefile under projects/linux/ or projects/macOS/.
- EditorC64 is optional, but useful when inspecting tutorial resources.
How to follow the series
- Start with Tutorial 01 and follow the core tutorials in order. Each introduces concepts used by the next examples.
- Read each page alongside its matching C++ source to follow the setup, main loop and cleanup.
- Explore the listed controls, then change one value or behavior at a time and observe the result.
- Use the output log to understand initialization, resource loading and any errors.
- Return to later tutorials as references when adding a specific engine system to your own project.
Learning path
Core: Tutorials 01-05
Start here to learn the application loop, system services, configuration, cursor resources and font rendering.
Tutorial 01: Basic
Open a 960x540 window, load two PNG images, move a ship with the keyboard and save a screenshot.
- Use Main, Log, Timer and Screen.
- Load external images with ImageMgr.
- Read SDL keyboard and mouse events through Main::update().
- Update and render at a fixed rate.
Read Tutorial 01: Basic application setup
Source: Tutorial_01_Basic.cpp
Tutorial 02: System
Extend the first example with a render callback, named CDC resources, a debug window and the built-in console.
- Use a Screen render callback.
- Save and load named image resources through a CDC file.
- Create a DebugWindow with watched variables.
- Use the built-in Console.
Read Tutorial 02: System services
Source: Tutorial_02_System.cpp
Tutorial 03: Configuration
Use the built-in configuration screen, then save and reload the selected settings from the shared CDC archive.
- Open the ConfigMgr setup screen.
- Store config.xml in Tutorial.cdc.
- Save and load the active configuration.
- Restore Screen state after loading.
Read Tutorial 03: Configuration
Source: Tutorial_03_Config.cpp
Tutorial 04: Cursor
Add a custom cursor resource to the CDC archive and use it in the running application.
- Create a cursor from an image.
- Save cursor resources to Tutorial.cdc.
- Load image and cursor resources from the CDC.
- Select and show a custom cursor.
Read Tutorial 04: Custom cursor
Source: Tutorial_04_Cursor.cpp
Tutorial 05: Font
Add bitmap fonts and compare the embedded font variants available through the engine.
- Add a bitmap font resource to the CDC.
- Use FontMgr::getBuiltin().
- Render positioned, scaled and colored text.
- Compare embedded Arial and Courier New variants.
Read Tutorial 05: Fonts
Source: Tutorial_05_Font.cpp
Graphics and resources: Tutorials 06-09
Move from basic image rendering to drawing primitives, tilesets, sprites and audio resources.
Tutorial 06: GFX
Draw primitives, apply image filters and mix immediate GFX drawing with image rendering.
- Use Main::gfx().
- Draw lines, rectangles, circles, ellipses and polygons.
- Apply image filters to duplicate images.
- Draw additive glow helpers.
Read Tutorial 06: GFX drawing
Source: Tutorial_06_GFX.cpp
Tutorial 07: Tileset
Create a tileset resource, render a small map and move the ship from tile to tile.
- Create a tile resource from an image.
- Split a tileset image into 48x48 tiles.
- Render map tile IDs.
- Restrict movement through walkable tiles.
Read Tutorial 07: Tileset maps
Source: Tutorial_07_Tileset.cpp
Tutorial 08: Sprite
Create sprites from a sprite sheet, define animation states and move animated sprites.
- Split a sprite sheet into animations and frames.
- Assign animation states to rows.
- Move a sprite with the keyboard.
- Toggle interpolated positioning.
Read Tutorial 08: Animated sprites
Source: Tutorial_08_Sprite.cpp
Tutorial 09: Audio
Load audio tracks, save them to CDC and mix looping music with sound effects.
- Initialize the audio device.
- Load AudioTrack resources from files.
- Save and load audio tracks through CDC.
- Play music, sound effects and voice-style sounds.
Read Tutorial 09: Audio tracks
Source: Tutorial_09_Audio.cpp
Effects: Tutorials 10-11
Add particles and a 2D lightmap pass to the rendering workflow.
Tutorial 10: Particles
Create an emitter that follows the mouse and spawn one-shot effects on click.
- Create emitters with ParticleMgr.
- Apply built-in particle presets.
- Update particles at the fixed logic rate.
- Render particles from the screen callback.
Read Tutorial 10: Particle effects
Source: Tutorial_10_Particles.cpp
Tutorial 11: Lightmap
Render a scene, accumulate lights and occluders, then apply the final lightmap.
- Use GFX::beginLighting() and GFX::endLighting().
- Add rectangle, circle and segment occluders.
- Draw point and spot lights.
- Keep HUD rendering outside the lighting pass.
Read Tutorial 11: 2D lightmaps
Source: Tutorial_11_Lightmap.cpp
UI, data, media and network: Tutorials 12-15
Use higher-level systems for widgets, XML data, video playback and TCP networking.
Tutorial 12: GUI
Create a small GUI with panels, labels, buttons, text input, checkbox, slider and progress widgets.
- Create modeless and modal panels.
- Add common GUI widgets.
- Assign normal and title fonts.
- Handle widget events from Main::update().
Read Tutorial 12: GUI
Source: Tutorial_12_GUI.cpp
Tutorial 13: XML
Load XML configuration data, read typed values and render them over the background.
- Load XML with XMLMgr::loadFromFile().
- Select nested nodes.
- Read string, integer and float attributes.
- Read node text.
Read Tutorial 13: XML
Source: Tutorial_13_XML.cpp
Tutorial 14: Video
Load a video file, assign a viewport and control playback with audio.
- Initialize audio for video streams.
- Load video with VideoMgr::loadFromFile().
- Read video metadata.
- Control playback and viewport rendering.
Read Tutorial 14: Video
Source: Tutorial_14_Video.cpp
Tutorial 15: Network
Build a small TCP command-line chat with one server and multiple clients.
- Initialize NetTCP.
- Create a threaded server.
- Connect clients and send user data.
- Receive queued network messages.
Read Tutorial 15: Network
Source: Tutorial_15_Network.cpp
Scene examples: Tutorial 16
The final group combines maps, objects, layers, cameras and gameplay logic into complete Scene examples.
Tutorial 16: Scene examples
Use TMX maps, object factories, pathfinding, camera logic, platform movement, shooter objects, strategy-map fog of war, lighting and particle effects.
- Adventure: point-and-click map interactions.
- Island Game v2: weighted A* pathfinding and follow/free camera modes, with v1 as the simpler reference.
- Platform: acceleration, gravity, jumping and tile collision.
- Shooter: projectiles, scrolling and object collisions.
- War Game: terrain costs, pathfinding and fog of war.
- Lighting: animated lights, occluder shadows and Scene particles.
Read Tutorial 16.1: Adventure
Read Tutorial 16.2: Island Game v2
Read Tutorial 16.3: Platform
Read Tutorial 16.4: Shooter
Read Tutorial 16.5: War Game
Read Tutorial 16.6: Scene Lighting
Sources: Tutorial_16_Scene_*.cpp