Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Examples read at <https://raylib-clj.b12n.app>.

## Unreleased

- 3 further example ports, taking the suite to **109**: `tiled-drawing`,
`palette-switch` and `ascii-rendering`. These are the three that were
waiting on asset files; all three now use them.
- `set-shader-value-vec2!` added. The namespace had float, vec3, vec4 and int
helpers but no vec2, so a `resolution` uniform had nowhere to go.
- A `texture-filter` enum for `set-texture-filter!`, which previously took a
bare int with no named constants.

- **Bundled raylib upgraded from 5.5.0 to 6.0** across all five platforms.
Nothing this project binds was removed, so no example changed: all 209
bound symbols resolve against 6.0 exactly as they did against 5.5.0.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Run the gate. It is fast and opens no window:
bb check # compile every namespace under src/, then clj-kondo
```

Step 1 requires all 135 namespaces; this is the check that catches a new
Step 1 requires all 138 namespaces; this is the check that catches a new
example whose requires are broken, which is the easiest mistake to make and
the one a passing `bb <your-example>` will not reveal (you only ran one).

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ in Clojure. It calls raylib's C library directly through
[coffi](https://github.com/IGJoshua/coffi) over JDK 22+'s Foreign Function &
Memory API (Project Panama): no wrapper library, no codegen.

106 examples ship in `src/examples/`: original games plus ports of raylib's own
109 examples ship in `src/examples/`: original games plus ports of raylib's own
C examples across the core, shapes, text, textures, shaders, audio, and models
categories.

Expand Down Expand Up @@ -270,7 +270,7 @@ Full guide: [`docs/guide/`](docs/guide/index.md)
the shared example skeleton and the recipe for porting a new one
- [`repl-workflow.md`](docs/guide/repl-workflow.md): live game
development over the embedded nREPL
- [`example-catalog.md`](docs/guide/example-catalog.md): all 106
- [`example-catalog.md`](docs/guide/example-catalog.md): all 109
examples, grouped and tabulated, with a preview-thumbnail column
- [`demos.md`](docs/guide/demos.md): the full-size demo gallery (every
example's animated GIF, one-line description)
Expand Down
9 changes: 9 additions & 0 deletions bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,15 @@
clipboard-text {:doc "📋 Clipboard Text - cut/copy/paste with the system clipboard"
:task (h/run-example! "clipboard-text")}

tiled-drawing {:doc "🧱 Tiled Drawing - tile a texture patch across a resizable window"
:task (h/run-example! "tiled-drawing")}

palette-switch {:doc "🎨 Palette Switch - shader remaps index-encoded bands"
:task (h/run-example! "palette-switch")}

ascii-rendering {:doc "🔤 Ascii Rendering - post-process the scene into ASCII glyphs"
:task (h/run-example! "ascii-rendering")}

easings-testbed {:doc "🔷 Easings Testbed - all 28 easing curves, one per axis"
:task (h/run-example! "easings-testbed")}

Expand Down
15 changes: 15 additions & 0 deletions bb/helpers.bb
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,21 @@
:title "Clipboard Text"
:desc "Cut, copy and paste against the system clipboard"
:controls "Buttons or CTRL+X / CTRL+C / CTRL+V, click the box to edit"}
{:alias "tiled-drawing"
:category :textures
:title "Tiled Drawing"
:desc "Tile a texture patch with selectable pattern, tint, scale and rotation"
:controls "Click a pattern or colour, UP/DOWN scale, LEFT/RIGHT rotate, SPACE reset"}
{:alias "palette-switch"
:category :shaders
:title "Palette Switch"
:desc "Fragment shader remaps index-encoded bands through a palette"
:controls "LEFT/RIGHT to switch palette"}
{:alias "ascii-rendering"
:category :shaders
:title "Ascii Rendering"
:desc "Post-process the scene into ASCII glyphs via a render texture"
:controls "LEFT/RIGHT to change the glyph cell size"}
{:alias "easings-testbed"
:category :shapes
:title "Easings Testbed"
Expand Down
15 changes: 15 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,21 @@
"-XstartOnFirstThread"
"-Djava.library.path=libs:libs/macos:libs/linux_amd64:libs/win64_msvc16:/opt/homebrew/opt/raylib/lib:/opt/homebrew/lib:/usr/local/lib:/usr/lib"]
:main-opts ["-m" "examples.clipboard-text"]}
:tiled-drawing
{:jvm-opts ["--enable-native-access=ALL-UNNAMED"
"-XstartOnFirstThread"
"-Djava.library.path=libs:libs/macos:libs/linux_amd64:libs/win64_msvc16:/opt/homebrew/opt/raylib/lib:/opt/homebrew/lib:/usr/local/lib:/usr/lib"]
:main-opts ["-m" "examples.tiled-drawing"]}
:palette-switch
{:jvm-opts ["--enable-native-access=ALL-UNNAMED"
"-XstartOnFirstThread"
"-Djava.library.path=libs:libs/macos:libs/linux_amd64:libs/win64_msvc16:/opt/homebrew/opt/raylib/lib:/opt/homebrew/lib:/usr/local/lib:/usr/lib"]
:main-opts ["-m" "examples.palette-switch"]}
:ascii-rendering
{:jvm-opts ["--enable-native-access=ALL-UNNAMED"
"-XstartOnFirstThread"
"-Djava.library.path=libs:libs/macos:libs/linux_amd64:libs/win64_msvc16:/opt/homebrew/opt/raylib/lib:/opt/homebrew/lib:/usr/local/lib:/usr/lib"]
:main-opts ["-m" "examples.ascii-rendering"]}

:easings-testbed
{:jvm-opts ["--enable-native-access=ALL-UNNAMED"
Expand Down
18 changes: 18 additions & 0 deletions docs/demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,12 @@ Spritesheet

![sprite-animation](sprite-animation.gif)

### tiled-drawing

Tile a texture patch with selectable pattern, tint, scale and rotation

![tiled-drawing](tiled-drawing.gif)

### srcrec-dstrec

Source/destination rects with rotation
Expand Down Expand Up @@ -506,6 +512,18 @@ Dynamic lighting

![basic-lighting](basic-lighting.gif)

### palette-switch

Fragment shader remaps index-encoded bands through a palette

![palette-switch](palette-switch.gif)

### ascii-rendering

Post-process the scene into ASCII glyphs via a render texture

![ascii-rendering](ascii-rendering.gif)

## 🗿 Models Examples

### geometric-shapes
Expand Down
Binary file added docs/demos/ascii-rendering.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/demos/ledger.edn

Large diffs are not rendered by default.

Binary file added docs/demos/palette-switch.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/demos/tiled-drawing.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/guide/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ flowchart LR
- `gestures.clj`: touch gesture detection
- `shaders.clj`: shader loading and management
- `text/`, `shapes/`, `textures/`: text, shape and texture bindings
- `src/examples/`: the 106 example namespaces (82 top-level + 3 in `games/` + 21 in `models/`)
- `src/examples/`: the 109 example namespaces (85 top-level + 3 in `games/` + 21 in `models/`)
- `src/debug_stats.clj`: F1 overlay plugin (see [Example Architecture Patterns](example-architecture-patterns.md) for usage)
- `libs/`: bundled native libraries per platform

Expand Down
22 changes: 20 additions & 2 deletions docs/guide/demos.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ type into a text box (click to focus, Backspace to edit)
![input-box](../demos/input-box.gif)


## 🖼️ Textures (3)
## 🖼️ Textures (4)

### background-scrolling

Expand All @@ -501,15 +501,33 @@ source and destination rectangles with rotation applied

![srcrec-dstrec](../demos/srcrec-dstrec.gif)

### tiled-drawing

## ✨ Shaders (1)
one patch of a texture atlas tiled across the window, with the pattern, tint, scale and rotation all selectable

![tiled-drawing](../demos/tiled-drawing.gif)


## ✨ Shaders (3)

### basic-lighting

dynamic per-pixel lighting (mouse moves it, Y/R/G/B toggle lights)

![basic-lighting](../demos/basic-lighting.gif)

### ascii-rendering

the scene rendered to an offscreen target, then post-processed into ASCII glyphs (arrows resize the cells)

![ascii-rendering](../demos/ascii-rendering.gif)

### palette-switch

eight near-black bands that a fragment shader remaps through a palette, so the colour on screen is never drawn by the program

![palette-switch](../demos/palette-switch.gif)


## 🔊 Audio (4)

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/example-architecture-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## The shared skeleton

Most examples follow the same shape: start the embedded nREPL, open a
window, loop until the user closes it, clean up (95 of 106; 11
window, loop until the user closes it, clean up (98 of 109; 11
examples, including `pong`, `camera-2d`, and `music-stream`, skip the
embedded nREPL; `grep -rL "nrepl/start" src/examples/*.clj
src/examples/*/*.clj` lists them). Here's
Expand Down
9 changes: 6 additions & 3 deletions docs/guide/example-catalog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The example catalog: 106 raylib examples
# The example catalog: 109 raylib examples

A map of the whole suite. Each example is one namespace under
`src/examples/` (or `src/examples/games/`, `src/examples/models/`),
Expand Down Expand Up @@ -131,19 +131,22 @@ credit).
| [<img src="../demos/format-text.gif" width="80">](demos.md#format-text) | `format-text` | Format Text | Formatted score/timer display | ESC to exit | `text_format_text.c` |
| [<img src="../demos/input-box.gif" width="80">](demos.md#input-box) | `input-box` | Input Box | Text input field | Click, type, Backspace | `text_input_box.c` |

## 🖼️ Textures (3)
## 🖼️ Textures (4)

| preview | `bb` name | title | shows | controls | ported from |
|---|---|---|---|---|---|
| [<img src="../demos/background-scrolling.gif" width="80">](demos.md#background-scrolling) | `background-scrolling` | Background Scrolling | Parallax demo | Watch | `textures_background_scrolling.c` |
| [<img src="../demos/sprite-animation.gif" width="80">](demos.md#sprite-animation) | `sprite-animation` | Sprite Animation | Spritesheet | LEFT/RIGHT | `textures_sprite_animation.c` |
| [<img src="../demos/srcrec-dstrec.gif" width="80">](demos.md#srcrec-dstrec) | `srcrec-dstrec` | Srcrec Dstrec | Source/destination rects with rotation | Watch | `textures_srcrec_dstrec.c` |
| [<img src="../demos/tiled-drawing.gif" width="80">](demos.md#tiled-drawing) | `tiled-drawing` | Tiled Drawing | Tile a texture patch with selectable pattern, tint, scale and rotation | Click pattern/colour, arrows, SPACE | `textures_tiled_drawing.c` |

## ✨ Shaders (1)
## ✨ Shaders (3)

| preview | `bb` name | title | shows | controls | ported from |
|---|---|---|---|---|---|
| [<img src="../demos/basic-lighting.gif" width="80">](demos.md#basic-lighting) | `basic-lighting` | Basic Lighting | Dynamic lighting | Mouse, Y/R/G/B | `shaders_basic_lighting.c` |
| [<img src="../demos/palette-switch.gif" width="80">](demos.md#palette-switch) | `palette-switch` | Palette Switch | Fragment shader remaps index-encoded bands through a palette | &lt; &gt; to switch palette | `shaders_palette_switch.c` |
| [<img src="../demos/ascii-rendering.gif" width="80">](demos.md#ascii-rendering) | `ascii-rendering` | Ascii Rendering | Post-process the scene into ASCII glyphs via a render texture | &lt; &gt; to change cell size | `shaders_ascii_rendering.c` |

## 🔊 Audio (4)

Expand Down
4 changes: 2 additions & 2 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ A `.clj` (JVM Clojure) project:
(rcw/close-window!)
```

106 examples ship in `src/examples/` on top of the FFI bindings in
109 examples ship in `src/examples/` on top of the FFI bindings in
`src/raylib/`: a mix of original games and ports of official raylib C
examples across core/shapes/text/textures/shaders/audio/models
categories. See [`example-catalog.md`](example-catalog.md) for the
Expand Down Expand Up @@ -73,7 +73,7 @@ ported from which raylib C source file.
nREPL integration, the porting recipe
- [`repl-workflow.md`](repl-workflow.md): embedded vs standalone REPL,
live game development
- [`example-catalog.md`](example-catalog.md): all 106 examples, grouped
- [`example-catalog.md`](example-catalog.md): all 109 examples, grouped
and tabulated
- [`demos.md`](demos.md): the full-size demo gallery (every example's
animated GIF, one-line description)
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/repl-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ change code while a game is running and see the change immediately.

## Live game development (recommended)

Most games start an **embedded nREPL server on port 7888** (95 of the
106 examples; 11, including `pong`, `camera-2d`, and `music-stream`,
Most games start an **embedded nREPL server on port 7888** (98 of the
109 examples; 11, including `pong`, `camera-2d`, and `music-stream`,
don't call `nrepl/start`). This is the proper way to do live
development for the examples that do:

Expand Down
17 changes: 16 additions & 1 deletion scripts/demo_manifest.edn
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,22 @@
;; flaky pipeline, and never judge a take by its frame count: open the GIF.
;; ---------------------------------------------------------------------
:overrides
{;; NOTE: the committed GIF for this one was NOT produced by the timeline
{;; ascii-rendering animates unaided (the sprite tracks back and forth), so
;; the keys only exercise the glyph-size uniform. Arrow keys read
;; is-key-pressed?, which latches for a frame, so taps register.
"ascii-rendering" {:input [[1.0 :key "right"] [1.8 :key "right"]
[2.6 :key "right"] [3.4 :key "right"]
[4.4 :key "left"] [5.2 :key "left"]]}
"palette-switch" {:input [[1.2 :key "right"] [2.6 :key "right"]
[4.0 :key "right"] [5.2 :key "left"]]}
;; Pattern and colour are chosen by CLICKING, which `bb record` cannot
;; deliver (b12n-screen-grab#1), so this leans on the keys instead: scale
;; and rotation both read is-key-pressed? and both visibly re-tile.
"tiled-drawing" {:input [[0.8 :key "up"] [1.6 :key "up"]
[2.4 :key "right"] [3.2 :key "right"]
[4.0 :key "down"] [4.8 :key "left"]
[5.5 :key "space"]]}
;; NOTE: the committed GIF for this one was NOT produced by the timeline
;; below. Every control here is a button, and `bb record` posts input
;; pid-routed, which cannot actuate a button in ANY app - AppKit or GLFW
;; alike, measured against Finder and Calculator too, not just raylib
Expand Down
Loading