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
12 changes: 0 additions & 12 deletions docs/guide/performance-on-a-phone.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ lines through exactly the same FFI:
(recur (inc i)))))
```

<img src="../images/spirograph.gif" width="240" alt="Spirograph, after the fix">

*Spirograph after the loop was rewritten: the curve draws itself at 55 fps
where the lazy-sequence version managed 14 at the same point count.*

| spirograph, points | 1008 | 1288 | 1552 | 1768 |
| --- | --- | --- | --- | --- |
| lazy sequence | 14 | - | - | - |
Expand Down Expand Up @@ -132,13 +127,6 @@ On this runtime, in a loop that runs hundreds of times per frame:
None of this is exotic Clojure advice. What is different is the magnitude: on a
JIT these habits cost a few percent, and here they cost three to four times.

<a href="../images/penrose.png"><img src="../images/thumbs/penrose.png" width="260" alt="Penrose P3 tiling"></a>
<a href="../images/kaleidoscope.png"><img src="../images/thumbs/kaleidoscope.png" width="260" alt="Kaleidoscope"></a>

*Left: penrose, 340 triangles and about 2400 FFI calls a frame, at 57 fps. It
is the scene that disproved the draw-call theory. Right: kaleidoscope, 708
lines a frame at 58, after the allocation came out of its draw loop.*

## Where the budget lands

With the loops fixed, the remaining limit really is line count. Numbers to
Expand Down
16 changes: 4 additions & 12 deletions docs/guide/porting-an-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
examples. 48 of them need no input at all, and those port almost mechanically.
This is what "almost" means, worked through with the five that are done.

![Spirograph](../images/spirograph.png)

*spirograph, the first port. Same maths as the original, a screen 1206x2622
instead of 800x450, and a loop it no longer owns.*
Same maths as the original, a screen 1206x2622 instead of 800x450, and a loop
it no longer owns. (No screenshot: every capture in this guide was
raylib-ios's, the sibling build this project was ported from, not this one's,
and they're dropped until there's a real Android capture to show.)

## They are desktop-shaped in two ways

Expand Down Expand Up @@ -87,14 +87,6 @@ nothing new at all; only `analog_clock` does, wanting `DrawLineEx`, `DrawRing`
and a local-time call. Penrose needed rlgl immediate mode only because it fills
polygons and raylib's shapes API has no call for that.

<img src="../images/kaleidoscope.gif" width="220" alt="Kaleidoscope">
<img src="../images/spirograph.gif" width="220" alt="Spirograph">
<img src="../images/boids.gif" width="220" alt="Boids">
<img src="../images/fireworks.gif" width="220" alt="Fireworks">

*Three of the five ports, running on the phone. None of them needed a single
new raylib binding.*

## Then measure it, because the port is the easy half

Two of the five did not hold 60 fps on first run, and neither for the reason
Expand Down
9 changes: 6 additions & 3 deletions docs/site.edn
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
:title "raylib-android"
:description "raylib on an Android phone, driven from Clojure on Chez Scheme via Jolt. Seventeen scenes as native arm64 code in a NativeActivity, with no JVM, no Kotlin and no Java in the app."

;; docs/images holds the GIFs and stills, referenced from the homepage and
;; the guides. Without this the pages render with every image broken, and the
;; engine only warns about a missing asset dir, so docs/check-site.sh turns
;; docs/images holds the raylib-ios captures this project ported from.
;; Nothing in the homepage or the guides shows them any more (they were
;; screenshots of a different build, not this one, and got pulled once that
;; stopped being clearly labelled), but the dir stays configured so an
;; Android capture dropped in here later just works. Without this line the
;; engine only warns about a missing asset dir; docs/check-site.sh turns
;; that into an error.
:asset-dirs ["images"]

Expand Down