Directories
¶
| Path | Synopsis |
|---|---|
|
Package anim animates entities.
|
Package anim animates entities. |
|
Package asset finds and loads a game's files.
|
Package asset finds and loads a game's files. |
|
Package audio mixes sounds in Go and passes float32 stereo frames to the platform's output device.
|
Package audio mixes sounds in Go and passes float32 stereo frames to the platform's output device. |
|
tracker
Package tracker loads and plays tracker music: ProTracker MOD (4 to 32 channels), ScreamTracker 3 S3M, FastTracker 2 XM and Impulse Tracker IT.
|
Package tracker loads and plays tracker music: ProTracker MOD (4 to 32 channels), ScreamTracker 3 S3M, FastTracker 2 XM and Impulse Tracker IT. |
|
cmd
|
|
|
bunyip-bundle
command
Command bunyip-bundle packages a built game for distribution: a .app bundle on macOS with the Vulkan loader and MoltenVK inside, or a plain folder with the executable and assets elsewhere.
|
Command bunyip-bundle packages a built game for distribution: a .app bundle on macOS with the Vulkan loader and MoltenVK inside, or a plain folder with the executable and assets elsewhere. |
|
bunyip-docs
command
Command bunyip-docs renders the module's documentation as a static website: guides written in Markdown, a walkthrough of every example program, every package's godoc with its examples, a symbol search, and links back to the source on GitHub.
|
Command bunyip-docs renders the module's documentation as a static website: guides written in Markdown, a walkthrough of every example program, every package's godoc with its examples, a symbol search, and links back to the source on GitHub. |
|
bunyip-info
command
Command bunyip-info reports the graphics stack Bunyip would run on: which Vulkan library loaded, the instance version, and every physical device with its driver and queue families.
|
Command bunyip-info reports the graphics stack Bunyip would run on: which Vulkan library loaded, the instance version, and every physical device with its driver and queue families. |
|
bunyip-pack
command
Command bunyip-pack bundles an asset directory into a pack file that asset.Open can read alongside, or instead of, loose directories.
|
Command bunyip-pack bundles an asset directory into a pack file that asset.Open can read alongside, or instead of, loose directories. |
|
bunyip-play
command
Command bunyip-play plays an audio file through the engine's mixer and the native output device: WAV, Ogg Vorbis, MP3, MOD, S3M, XM or IT.
|
Command bunyip-play plays an audio file through the engine's mixer and the native output device: WAV, Ogg Vorbis, MP3, MOD, S3M, XM or IT. |
|
bunyip-shader
command
Command bunyip-shader compiles WGSL to SPIR-V using the pure-Go compiler.
|
Command bunyip-shader compiles WGSL to SPIR-V using the pure-Go compiler. |
|
bunyip-tex
command
Command bunyip-tex compresses PNG and JPEG images into KTX2 texture files that asset.Texture and gfx.NewCompressedTexture upload straight to the GPU, with the whole mip chain built here rather than while a game runs.
|
Command bunyip-tex compresses PNG and JPEG images into KTX2 texture files that asset.Texture and gfx.NewCompressedTexture upload straight to the GPU, with the whole mip chain built here rather than while a game runs. |
|
vkgen
command
Command vkgen generates the Vulkan binding in internal/vk from the Khronos registry.
|
Command vkgen generates the Vulkan binding in internal/vk from the Khronos registry. |
|
Package console is the engine's in-game debug console: a drop-down command line over the top of the view, and a window of panels that show what every part of the engine is doing.
|
Package console is the engine's in-game debug console: a drop-down command line over the top of the view, and a window of panels that show what every part of the engine is doing. |
|
Package ecs is the engine's entity component system.
|
Package ecs is the engine's entity component system. |
|
Package engine runs a game's main loop.
|
Package engine runs a game's main loop. |
|
examples
|
|
|
animation
command
Command animation shows the anim package on 2D and 3D entities alike: keyframe clips drive sprite positions, sizes, rotations and tints and 3D transforms; a flipbook plays sprite-sheet frames; buttons crossfade the hero cube between clips, with a Finished event sending it back to idle; and three robot arms from a generated glTF model show a skeletal clip with an animation event, two-bone IK reaching for a moving target, and a 1D blend space mixing a slow swing into a fast one by a slider.
|
Command animation shows the anim package on 2D and 3D entities alike: keyframe clips drive sprite positions, sizes, rotations and tints and 3D transforms; a flipbook plays sprite-sheet frames; buttons crossfade the hero cube between clips, with a Finished event sending it back to idle; and three robot arms from a generated glTF model show a skeletal clip with an animation event, two-bone IK reaching for a moving target, and a 1D blend space mixing a slow swing into a fast one by a slider. |
|
assets
command
Command assets shows the asset and save packages: a directory of images is decoded on worker goroutines behind a progress bar, textures are created on the main thread as each finishes, files that change on disk are reloaded live (the example rewrites one every two seconds to prove it), P packs the directory into assets.pak, and a settings file remembers how many times the example has run.
|
Command assets shows the asset and save packages: a directory of images is decoded on worker goroutines behind a progress bar, textures are created on the main thread as each finishes, files that change on disk are reloaded live (the example rewrites one every two seconds to prove it), P packs the directory into assets.pak, and a settings file remembers how many times the example has run. |
|
audio
command
Command audio is the sound tour: positional voices orbiting the listener with Doppler and occlusion on sliders, panning or the binaural head model on a checkbox, a shared reverb and a low-pass filter on sliders, fades, pitch, voice priorities under a small voice cap, a synthesised music stream, -music to stream an Ogg, MP3 or WAV file from disk, -zone to put a reverb zone at the listener so the room changes as the orbiting sources pass through it, and -mic to record from the microphone and draw a level meter.
|
Command audio is the sound tour: positional voices orbiting the listener with Doppler and occlusion on sliders, panning or the binaural head model on a checkbox, a shared reverb and a low-pass filter on sliders, fades, pitch, voice priorities under a small voice cap, a synthesised music stream, -music to stream an Ogg, MP3 or WAV file from disk, -zone to put a reverb zone at the listener so the room changes as the orbiting sources pass through it, and -mic to record from the microphone and draw a level meter. |
|
autotile
command
Command autotile paints terrain that picks its own tiles.
|
Command autotile paints terrain that picks its own tiles. |
|
clear
command
Command clear opens a window and clears it to a colour that cycles over time.
|
Command clear opens a window and clears it to a colour that cycles over time. |
|
gallery
command
Command gallery shows every UI widget, the built-in colour themes, a texture skin, scalable SDF text and an audio beep.
|
Command gallery shows every UI widget, the built-in colour themes, a texture skin, scalable SDF text and an audio beep. |
|
inputs
command
Command inputs visualises everything the input package reports: keys held, mouse buttons, wheel, position, relative motion while the cursor is captured (C toggles, Escape releases), fullscreen (F), typed text with IME composition, and up to four gamepads with sticks, triggers and buttons.
|
Command inputs visualises everything the input package reports: keys held, mouse buttons, wheel, position, relative motion while the cursor is captured (C toggles, Escape releases), fullscreen (F), typed text with IME composition, and up to four gamepads with sticks, triggers and buttons. |
|
lighting
command
Command lighting is the renderer playground: a skinned mesh bent by joint matrices computed each frame, cascaded shadows, two lamps that cast their own shadows over a field of 160 small point lights, and every post-processing setting on a slider (exposure, bloom, vignette, saturation, contrast, ambient occlusion, FXAA, temporal anti-aliasing, depth of field, motion blur, god rays and the lens effects).
|
Command lighting is the renderer playground: a skinned mesh bent by joint matrices computed each frame, cascaded shadows, two lamps that cast their own shadows over a field of 160 small point lights, and every post-processing setting on a slider (exposure, bloom, vignette, saturation, contrast, ambient occlusion, FXAA, temporal anti-aliasing, depth of field, motion blur, god rays and the lens effects). |
|
materials
command
Command materials shows every material feature on a row of spheres and a few props: clearcoat, sheen, subsurface, iridescence, anisotropy, a specular tint, fur, alpha cutout, unlit, vertex colours, a scrolling texture transform, occlusion, an outline and an x-ray tint through a wall, a stencil mask, a projected decal, all under image-based lighting from a sky or a panorama (-env file.png, .hdr or .exr).
|
Command materials shows every material feature on a row of spheres and a few props: clearcoat, sheen, subsurface, iridescence, anisotropy, a specular tint, fur, alpha cutout, unlit, vertex colours, a scrolling texture transform, occlusion, an outline and an x-ray tint through a wall, a stencil mask, a projected decal, all under image-based lighting from a sky or a panorama (-env file.png, .hdr or .exr). |
|
network
command
Command network is a chat room over the network package.
|
Command network is a chat room over the network package. |
|
particles
command
Command particles shows the particle package: a campfire of fire and smoke, rain from a line along the top of the screen, sparks where the mouse is clicked, and a confetti burst on Space.
|
Command particles shows the particle package: a campfire of fire and smoke, rain from a line along the top of the screen, sparks where the mouse is clicked, and a confetti burst on Space. |
|
pathfinding
command
Command pathfinding shows the grid package: paint walls with the left mouse button (right erases), and watch A* route from the start to the cell under the pointer, a Dijkstra map colour every reachable cell by distance, field of view light what the start can see, and flood fill count the connected region.
|
Command pathfinding shows the grid package: paint walls with the left mouse button (right erases), and watch A* route from the start to the cell under the pointer, a Dijkstra map colour every reachable cell by distance, field of view light what the start can see, and flood fill count the connected region. |
|
physics-lab
command
Command physics-lab shows the newer parts of the phys package in one scene: capsules, convex hulls, spheres and boxes tumbling onto a heightfield terrain mesh, a chain of hinge joints with a ball on the end, a paddle wheel turned by a hinge motor, a ragdoll dropped from the sky, and a character controller walking back and forth over a staircase on a timer.
|
Command physics-lab shows the newer parts of the phys package in one scene: capsules, convex hulls, spheres and boxes tumbling onto a heightfield terrain mesh, a chain of hinge joints with a ball on the end, a paddle wheel turned by a hinge motor, a ragdoll dropped from the sky, and a character controller walking back and forth over a staircase on a timer. |
|
physics2d
command
Command physics2d shows the 2D rigid bodies: balls, boxes and a triangle fall into a pit, a kinematic paddle sweeps through them, a car on sprung wheel joints drives back and forth along the floor, a trigger zone tints whatever enters it, and a raycast from the corner to the pointer reports what it hits.
|
Command physics2d shows the 2D rigid bodies: balls, boxes and a triangle fall into a pit, a kinematic paddle sweeps through them, a car on sprung wheel joints drives back and forth along the floor, a trigger zone tints whatever enters it, and a raycast from the corner to the pointer reports what it hits. |
|
physics3d
command
Command physics3d drops five hundred cubes into a pile.
|
Command physics3d drops five hundred cubes into a pile. |
|
probes
command
Command probes shows the light a scene has beyond one environment map: a reflection probe baked inside a room, so the chrome ball mirrors the walls around it instead of the sky; a grid of light probes, so the matte balls take the colour of the wall they stand by; and screen-space reflections on the polished floor, so what is above it appears in it.
|
Command probes shows the light a scene has beyond one environment map: a reflection probe baked inside a room, so the chrome ball mirrors the walls around it instead of the sky; a grid of light probes, so the matte balls take the colour of the wall they stand by; and screen-space reflections on the polished floor, so what is above it appears in it. |
|
roguelike
command
Command roguelike is a small turn-based dungeon crawl: rooms, corridors, line-of-sight, goblins that chase, and a message log.
|
Command roguelike is a small turn-based dungeon crawl: rooms, corridors, line-of-sight, goblins that chase, and a message log. |
|
shaders
command
Command shaders shows fragment shaders written by the game: a 2D wave shader and a dissolve on sprites, and a lava surface shader on a mesh under the engine's lighting.
|
Command shaders shows fragment shaders written by the game: a 2D wave shader and a dissolve on sprites, and a lava surface shader on a mesh under the engine's lighting. |
|
softbody
command
Command softbody shows the phys/soft package: a flag of cloth flapping on a pole, a jelly cube dropping onto the floor beside a rigid crate, and a tank of two-dimensional fluid in the corner of the screen.
|
Command softbody shows the phys/soft package: a flag of cloth flapping on a pole, a jelly cube dropping onto the floor beside a rigid crate, and a tank of two-dimensional fluid in the corner of the screen. |
|
solar
command
Command solar shows the entity component system driving a scene: the sun, its planets and their moons come from an embedded scene document (system.json) instantiated into the world, with the moons as references to a prefab (moon.json); an asteroid belt of hundreds of entities is spawned in code and drawn as one instanced call; systems run orbits and spin; clicking picks a body with a screen ray; a render texture is used as a top-down minimap; and profile scopes show in the debug overlay (F3).
|
Command solar shows the entity component system driving a scene: the sun, its planets and their moons come from an embedded scene document (system.json) instantiated into the world, with the moons as references to a prefab (moon.json); an asteroid belt of hundreds of entities is spawned in code and drawn as one instanced call; systems run orbits and spin; clicking picks a body with a screen ray; a render texture is used as a top-down minimap; and profile scopes show in the debug overlay (F3). |
|
space
command
Command space flies a ship through a fictional star system: a star, seven planets with a dozen moons between them, an asteroid belt and a comet, every one on an exact Kepler orbit around its primary.
|
Command space flies a ship through a fictional star system: a star, seven planets with a dozen moons between them, an asteroid belt and a comet, every one on an exact Kepler orbit around its primary. |
|
sprites
command
Command sprites bounces a few hundred textured sprites around the window with a coloured grid behind them.
|
Command sprites bounces a few hundred textured sprites around the window with a coloured grid behind them. |
|
terrain
command
Command terrain is an outdoor scene of the kind a strategy or survival game draws, built on gfx.Terrain: a chunked heightfield with per-chunk levels of detail and a splat map blending sand, grass, rock and snow, a lake, pine models near and baked impostors of them far, billboard trees, rocks at several levels of detail, campfires as point lights, a watchtower's searchlight as a spot light, an atmospheric sky and valley fog, labels in the world, and terrain the player digs into with a click.
|
Command terrain is an outdoor scene of the kind a strategy or survival game draws, built on gfx.Terrain: a chunked heightfield with per-chunk levels of detail and a splat map blending sand, grass, rock and snow, a lake, pine models near and baked impostors of them far, billboard trees, rocks at several levels of detail, campfires as point lights, a watchtower's searchlight as a spot light, an atmospheric sky and valley fog, labels in the world, and terrain the player digs into with a click. |
|
tetris
command
Command tetris is the game the Tetris guide builds on the entity component system: settled blocks are entities, the falling piece is an entity, and systems for input, gravity, locking and effects run each update over resources such as the score and the board.
|
Command tetris is the game the Tetris guide builds on the entity component system: settled blocks are entities, the falling piece is an entity, and systems for input, gravity, locking and effects run each update over resources such as the score and the board. |
|
text
command
Command text shows shaped text: kerning and ligatures from HarfBuzz, Arabic joining and right-to-left order, mixed-direction lines, a fallback font behind the main one, Unicode line wrapping, hyphenation in the text's own language, colour glyphs from a system emoji font, vertical text, and scalable distance-field text.
|
Command text shows shaped text: kerning and ligatures from HarfBuzz, Arabic joining and right-to-left order, mixed-direction lines, a fallback font behind the main one, Unicode line wrapping, hyphenation in the text's own language, colour glyphs from a system emoji font, vertical text, and scalable distance-field text. |
|
tiled
command
Command tiled loads a map made in the Tiled editor from an embedded .tmj, builds it into tilemaps with the tiled package, and draws it under a Camera2D. The tileset image is painted at start-up: a grid of coloured tiles with an arrow so flipped cells show their flips, and a two-frame animated water tile.
|
Command tiled loads a map made in the Tiled editor from an embedded .tmj, builds it into tilemaps with the tiled package, and draws it under a Camera2D. The tileset image is painted at start-up: a grid of coloured tiles with an arrow so flipped cells show their flips, and a two-frame animated water tile. |
|
tiles
command
Command tiles is the 2D tour: a generated sprite sheet, a tilemap with view culling, a Camera2D that follows the player (scroll to zoom, Q and E to rotate), a walking animation, draw layers, particles driven by a timer and tweens, and a nine-slice HUD with wrapped, centred text.
|
Command tiles is the 2D tour: a generated sprite sheet, a tilemap with view culling, a Camera2D that follows the player (scroll to zoom, Q and E to rotate), a walking animation, draw layers, particles driven by a timer and tweens, and a nine-slice HUD with wrapped, centred text. |
|
vector
command
Command vector draws with paths: filled shapes with both fill rules, curves and arcs, strokes with every cap and join, textured fills, blend modes and the transform stack, all anti-aliased and all going through the same 2D stream as sprites and text.
|
Command vector draws with paths: filled shapes with both fill rules, curves and arcs, strokes with every cap and join, textured fills, blend modes and the transform stack, all anti-aliased and all going through the same 2D stream as sprites and text. |
|
viewer
command
Command viewer shows a 3D scene with an orbit camera.
|
Command viewer shows a 3D scene with an orbit camera. |
|
window
command
Command window opens a native window, presents cleared frames through a Vulkan swapchain and prints every event until the window is closed or -seconds elapse.
|
Command window opens a native window, presents cleared frames through a Vulkan swapchain and prints every event until the window is closed or -seconds elapse. |
|
Package gfx draws a game's 2D and 3D graphics.
|
Package gfx draws a game's 2D and 3D graphics. |
|
ktx2
Package ktx2 reads and writes KTX2 texture files and encodes and decodes the block-compressed formats they carry.
|
Package ktx2 reads and writes KTX2 texture files and encodes and decodes the block-compressed formats they carry. |
|
shaders
Package shaders holds the gfx package's WGSL sources and committed SPIR-V, and the preludes that game shaders are compiled against.
|
Package shaders holds the gfx package's WGSL sources and committed SPIR-V, and the preludes that game shaders are compiled against. |
|
Package gltf loads glTF 2.0 models (.gltf with external or embedded buffers, and .glb) into plain Go slices: positions, normals, UVs, vertex colours, joints and weights, indices, materials with their textures and the KHR extensions the renderer supports (clearcoat, sheen, transmission, volume, IOR, emissive strength, texture transforms, specular, iridescence, anisotropy and converted specular-glossiness), decoded images, morph targets with their default weights, skins, animation clips (node transforms and morph weights) and the flattened node hierarchy with world matrices.
|
Package gltf loads glTF 2.0 models (.gltf with external or embedded buffers, and .glb) into plain Go slices: positions, normals, UVs, vertex colours, joints and weights, indices, materials with their textures and the KHR extensions the renderer supports (clearcoat, sheen, transmission, volume, IOR, emissive strength, texture transforms, specular, iridescence, anisotropy and converted specular-glossiness), decoded images, morph targets with their default weights, skins, animation clips (node transforms and morph weights) and the flattened node hierarchy with world matrices. |
|
Package grid provides the tile-map helpers roguelikes and strategy games need: a generic cell grid, A* and Dijkstra pathfinding, Bresenham lines, shadowcasting field of view and flood fill.
|
Package grid provides the tile-map helpers roguelikes and strategy games need: a generic cell grid, A* and Dijkstra pathfinding, Bresenham lines, shadowcasting field of view and flood fill. |
|
autotile
Package autotile picks tile frames from a terrain grid, so a map of plain terrain ids draws with matching edges, corners and transitions.
|
Package autotile picks tile frames from a terrain grid, so a map of plain terrain ids draws with matching edges, corners and transitions. |
|
Package input reports the state of the keyboard, mouse and gamepads, and names the keys, buttons and axes the platform layers fill that state with.
|
Package input reports the state of the keyboard, mouse and gamepads, and names the keys, buttons and axes the platform layers fill that state with. |
|
internal
|
|
|
audioout
Package audioout enumerates and opens native audio endpoints and pulls interleaved float32 stereo frames from a callback on the device's own thread.
|
Package audioout enumerates and opens native audio endpoints and pulls interleaved float32 stereo frames from a callback on the device's own thread. |
|
hook
Package hook is the seam between the engine loop and the public packages.
|
Package hook is the seam between the engine loop and the public packages. |
|
platform
Package platform owns the operating system: windows, the event queue, keyboard and mouse input, display scaling, window visibility, the clipboard and Vulkan surface creation.
|
Package platform owns the operating system: windows, the event queue, keyboard and mouse input, display scaling, window visibility, the clipboard and Vulkan surface creation. |
|
render
Package render is the Vulkan backend: instance, device, swapchain, frame pacing, resource uploads and readback.
|
Package render is the Vulkan backend: instance, device, swapchain, frame pacing, resource uploads and readback. |
|
render/shaders
Package shaders holds the engine's WGSL sources and their SPIR-V builds.
|
Package shaders holds the engine's WGSL sources and their SPIR-V builds. |
|
vk
Package vk is a generated, cgo-free binding to the Vulkan API.
|
Package vk is a generated, cgo-free binding to the Vulkan API. |
|
Package lin provides the engine's linear algebra: vectors, matrices and quaternions in float32.
|
Package lin provides the engine's linear algebra: vectors, matrices and quaternions in float32. |
|
Package locale translates a game's strings.
|
Package locale translates a game's strings. |
|
Package network moves typed messages between game instances over TCP and UDP.
|
Package network moves typed messages between game instances over TCP and UDP. |
|
Package orbit computes celestial mechanics for space games.
|
Package orbit computes celestial mechanics for space games. |
|
sol
Package sol holds real-world constants for games set in our solar system.
|
Package sol holds real-world constants for games set in our solar system. |
|
Package particle simulates 2D particles on the CPU and draws them through the sprite stream: fire, smoke, sparks, rain and confetti from an Emitter of plain fields.
|
Package particle simulates 2D particles on the CPU and draws them through the sprite stream: fire, smoke, sparks, rain and confetti from an Emitter of plain fields. |
|
Package phys simulates rigid bodies in 2D and 3D on the entity component system.
|
Package phys simulates rigid bodies in 2D and 3D on the entity component system. |
|
soft
Package soft simulates soft bodies, cloth and fluids as particles on the entity component system.
|
Package soft simulates soft bodies, cloth and fluids as particles on the entity component system. |
|
Package rng provides a small, fast, seedable random number generator (PCG32) for games.
|
Package rng provides a small, fast, seedable random number generator (PCG32) for games. |
|
Package save stores a game's files in the platform's own data directory: settings, save slots and anything else worth keeping between runs, written as JSON through a synced temporary file and renamed into place to avoid exposing partial JSON.
|
Package save stores a game's files in the platform's own data directory: settings, save slots and anything else worth keeping between runs, written as JSON through a synced temporary file and renamed into place to avoid exposing partial JSON. |
|
Package tiled reads maps saved by the Tiled editor and builds drawable levels from them.
|
Package tiled reads maps saved by the Tiled editor and builds drawable levels from them. |
|
Package timer schedules callbacks on game time, after a delay or on every interval.
|
Package timer schedules callbacks on game time, after a delay or on every interval. |
|
Package tween animates values over time.
|
Package tween animates values over time. |
|
Package ui is an immediate-mode interface toolkit drawn with gfx.
|
Package ui is an immediate-mode interface toolkit drawn with gfx. |
Click to show internal directories.
Click to hide internal directories.