From fd1da7002e817d35afd16d6e307a840e5f1c410b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Costa?=
Date: Sun, 3 Nov 2024 14:49:58 +0000
Subject: [PATCH 1/7] Update docs for 0.6.2
---
docs/_docs/advanced-usage.md | 2 +-
docs/_docs/index.html | 6 ++++--
docs/_docs/overview.md | 1 +
docs/_docs/structure.md | 7 +++++++
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/docs/_docs/advanced-usage.md b/docs/_docs/advanced-usage.md
index dc06e178..e0534edd 100644
--- a/docs/_docs/advanced-usage.md
+++ b/docs/_docs/advanced-usage.md
@@ -14,7 +14,7 @@ The Minart project is divided in multiple small packages:
- `minart-core`: This package is always required.
- `minart-backend`: Contains the default implementations for each backend (AWT, HTML and SDL).
While usually required, you can skip it if you plan to implement your own backend.
-- `minart-image`: Contains logic to load and store images in PPM, BMP or QOI format.
+- `minart-image`: Contains logic to load and store images in PBM/PPM, PDI, BMP or QOI format.
You can skip it if you don't plan to read or write any images.
- `minart-sound`: Contains logic to load and store sound files in WAV, AIFF, RTTTL or QOA format.
You can skip it if you don't plan to read or write any sound files.
diff --git a/docs/_docs/index.html b/docs/_docs/index.html
index cfde947a..f82dd310 100644
--- a/docs/_docs/index.html
+++ b/docs/_docs/index.html
@@ -30,7 +30,8 @@ Development status
Minart is still in a 0.x version. Quoting the semver specification:
- Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.
+ Major version zero (0.y.z) is for initial development. Anything MAY change at any time.
+ The public API SHOULD NOT be considered stable.
As such, while it's OK to use Minart for small demos, it's not recommended to use it for commercial projects.
@@ -46,7 +47,8 @@ Limitations
as Indigo.
- Also, Minart is only suitable for bitmap graphics.
+ Also, Minart is only suitable for bitmap graphics. There are a few geometric
+ primitives, but those are quite limited.
For vector graphics it is recommended to use an appropriate library, such
as Doodle.
diff --git a/docs/_docs/overview.md b/docs/_docs/overview.md
index f3b4fb91..51b71014 100644
--- a/docs/_docs/overview.md
+++ b/docs/_docs/overview.md
@@ -24,6 +24,7 @@ Minart comes out of the box with some basic graphic features, such as:
- Double buffered canvas
- Integer scaling
- Surface blitting (with multiple blending modes)
+ - Simple shape and line rendering
It also includes **Surface views** and **Planes** which makes it possible to manipulate
(possibly unbounded) images with familiar operations such as `map` and `flatMap`.
diff --git a/docs/_docs/structure.md b/docs/_docs/structure.md
index de810cb8..23b1fb3e 100644
--- a/docs/_docs/structure.md
+++ b/docs/_docs/structure.md
@@ -29,6 +29,13 @@ A `Canvas` is a special type of `MutableSurface`, which represents a window.
`SurfaceView`s and `Planes` are abstractions to quickly and efficiently manipulate `Surface`s.
+## `eu.joaocosta.minart.geometry`
+
+This package contains abstractions related to geometric primitives, such as
+`Point`, `Matrix`, `Shape` and `Stroke`.
+
+Most of the APIs in this package are still experimental, and may change in future versions.
+
## `eu.joaocosta.minart.audio`
This package contains all abstractions related to audio playback.
From 7607a844577369734ec8850eb2d59af9165870bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Costa?=
Date: Sun, 3 Nov 2024 14:53:13 +0000
Subject: [PATCH 2/7] Update examples for 0.6.2
---
examples/release/01-introduction.md | 2 +-
examples/release/02-portable-applications.md | 2 +-
examples/release/03-animation.md | 2 +-
examples/release/04-pointer-input.md | 2 +-
examples/release/05-stateful-applications.md | 2 +-
examples/release/06-surfaces.md | 2 +-
examples/release/07-canvas-settings.md | 2 +-
examples/release/08-loading-images.md | 4 +-
examples/release/09-surface-views.md | 21 ++--
examples/release/10-vector-shapes.md | 102 ++++++++++++++++++
...audio-playback.md => 11-audio-playback.md} | 4 +-
...loading-sounds.md => 12-loading-sounds.md} | 6 +-
examples/snapshot/01-introduction.md | 2 +-
examples/snapshot/02-portable-applications.md | 2 +-
examples/snapshot/03-animation.md | 2 +-
examples/snapshot/04-pointer-input.md | 2 +-
examples/snapshot/05-stateful-applications.md | 2 +-
examples/snapshot/06-surfaces.md | 2 +-
examples/snapshot/07-canvas-settings.md | 2 +-
examples/snapshot/08-loading-images.md | 4 +-
examples/snapshot/09-surface-views.md | 2 +-
examples/snapshot/10-vector-shapes.md | 2 +-
examples/snapshot/11-audio-playback.md | 2 +-
examples/snapshot/12-loading-sounds.md | 4 +-
24 files changed, 137 insertions(+), 42 deletions(-)
create mode 100644 examples/release/10-vector-shapes.md
rename examples/release/{10-audio-playback.md => 11-audio-playback.md} (98%)
rename examples/release/{11-loading-sounds.md => 12-loading-sounds.md} (92%)
diff --git a/examples/release/01-introduction.md b/examples/release/01-introduction.md
index ead63105..53de073c 100644
--- a/examples/release/01-introduction.md
+++ b/examples/release/01-introduction.md
@@ -24,7 +24,7 @@ The simplest way to use Minart is to simply include the `minart` library, which
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
```
As for the imports, the `eu.joaocosta.minart.backend.defaults` package contains the givens with the backend-specific (JVM/JS/Native) logic.
diff --git a/examples/release/02-portable-applications.md b/examples/release/02-portable-applications.md
index cca5656f..bd9a87ae 100644
--- a/examples/release/02-portable-applications.md
+++ b/examples/release/02-portable-applications.md
@@ -38,7 +38,7 @@ Note, however, that we now also import `eu.joaocosta.minart.runtime.*`, which pr
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/release/03-animation.md b/examples/release/03-animation.md
index aadea389..da008a97 100644
--- a/examples/release/03-animation.md
+++ b/examples/release/03-animation.md
@@ -12,7 +12,7 @@ As before, let's import the backend, graphics and runtime.
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/release/04-pointer-input.md b/examples/release/04-pointer-input.md
index 626126bd..37224c01 100644
--- a/examples/release/04-pointer-input.md
+++ b/examples/release/04-pointer-input.md
@@ -14,7 +14,7 @@ We also need to import the input package. We need this to read data from input d
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/release/05-stateful-applications.md b/examples/release/05-stateful-applications.md
index c781e59f..08301bdf 100644
--- a/examples/release/05-stateful-applications.md
+++ b/examples/release/05-stateful-applications.md
@@ -14,7 +14,7 @@ The dependencies will be the same as before. We also include Scala's `Random` he
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import scala.util.Random
diff --git a/examples/release/06-surfaces.md b/examples/release/06-surfaces.md
index 35dc5421..b65509e3 100644
--- a/examples/release/06-surfaces.md
+++ b/examples/release/06-surfaces.md
@@ -17,7 +17,7 @@ For this example, we just need to use the graphics and runtime
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/release/07-canvas-settings.md b/examples/release/07-canvas-settings.md
index 57244847..8b9e63de 100644
--- a/examples/release/07-canvas-settings.md
+++ b/examples/release/07-canvas-settings.md
@@ -12,7 +12,7 @@ Here's a quick example on how to do that. In this example application, we will c
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/release/08-loading-images.md b/examples/release/08-loading-images.md
index 6366c937..a3ed7178 100644
--- a/examples/release/08-loading-images.md
+++ b/examples/release/08-loading-images.md
@@ -2,7 +2,7 @@
So far we always created our surfaces manually. This is fine for small demos and procedural graphics, but often it can be useful to load an image from an external file.
-Minart has support for some image file formats (PPM, BMP and QOI). Here we will see how to load them.
+Minart has support for some image file formats (PBM/PPM, PDI, BMP and QOI). Here we will see how to load them.
## A simple image viewer
@@ -15,7 +15,7 @@ This package also has an `Image` object with helpers to call the loaders.
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/release/09-surface-views.md b/examples/release/09-surface-views.md
index 67b12962..3eda9aaf 100644
--- a/examples/release/09-surface-views.md
+++ b/examples/release/09-surface-views.md
@@ -13,7 +13,7 @@ This tutorial will show how to use those
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
@@ -59,13 +59,12 @@ Let's see an example with multiple effects, such as:
- Wobble
- Checkerboard invert
-Before we start, let's precompute the convolution window that we will use for the blur
+Before we start, let's precompute the convolution kernel that we will use for the blur.
+We could use a simple function, but Minart already provides some optimized kernels
+out of the box.
```scala
-val convolutionWindow = for {
- x <- (-1 to 1)
- y <- (-1 to 1)
-} yield (x, y)
+val blurKernel = Kernel.averageBlur(3, 3)
```
@@ -79,14 +78,8 @@ def application(t: Double, canvas: Canvas): Unit = {
val image = updatedBitmap.view.repeating // Create an infinite Plane from our surface
.scale(zoom, zoom) // Scale
- .coflatMap { img => // Average blur
- convolutionWindow.iterator
- .map { case (x, y) => img(x, y) }
- .foldLeft(Color(0, 0, 0)) { case (Color(r, g, b), Color(rr, gg, bb)) =>
- Color(r + rr / 9, g + gg / 9, b + bb / 9)
- }
- }
- .rotate(t) // Rotate
+ .coflatMap(blurKernel) // Average blur
+ .rotate(t) // Rotate
.contramap((x, y) => (x + (5 * Math.sin(t + y / 10.0)).toInt, y)) // Wobbly effect
.flatMap(color =>
(x, y) => // Checkerboard effect
diff --git a/examples/release/10-vector-shapes.md b/examples/release/10-vector-shapes.md
new file mode 100644
index 00000000..e51bc6bc
--- /dev/null
+++ b/examples/release/10-vector-shapes.md
@@ -0,0 +1,102 @@
+# 10. Vector shapes
+
+Besides surfaces, Minart also allows you to render some basic vector shapes.
+
+## Drawing shapes
+
+### Dependencies and imports
+
+The relevant methods are in the `eu.joaocosta.minart.geometry` package
+
+```scala
+//> using scala "3.3.3"
+//> using dep "eu.joaocosta::minart::0.6.2"
+
+import eu.joaocosta.minart.backend.defaults.given
+import eu.joaocosta.minart.graphics.*
+import eu.joaocosta.minart.geometry.*
+import eu.joaocosta.minart.runtime.*
+```
+
+### Shapes
+
+Vectorial shapes are represented by the `Shape` abstraction.
+
+Minart already comes with some basic shapes, such as circle and convex polygons, with helper methods in the `Shape` companion object.
+
+First, let's create a few shapes with those methods.
+
+```scala
+import eu.joaocosta.minart.geometry.Point
+
+val triangle = Shape.triangle(Point(-16, 16), Point(0, -16), Point(16, 16))
+val square = Shape.rectangle(Point(-16, -16), Point(16, 16))
+val octagon = Shape.convexPolygon(
+ Point(-8, -16),
+ Point(8, -16),
+ Point(16, -8),
+ Point(16, 8),
+ Point(8, 16),
+ Point(-8, 16),
+ Point(-16, 8),
+ Point(-16, -8)
+)
+val circle = Shape.circle(Point(0, 0), 16)
+```
+
+### Faces
+
+Notice that all shapes are defined with points in clockwise fashion.
+
+All shapes have two faces: A front face and a back face.
+
+Depending on the way they are defined (or transformed), different faces might be shown.
+
+Minart allows you to set different colors for each face, and even no color at all!
+This is helpful if, for some reason, you know you don't want to draw back faces.
+
+### Rasterizing
+
+Now we just need to use the `rasterizeShape` operation, just like we did with `blit`.
+
+In this example we will also scale our images with time, to show how the color changes when the face flips.
+
+There's also a `rasterizeStroke` operation to draw lines and a `rasterizeContour` operation to draw only the shape
+contours (note that not all shapes support this, some transformations can make the contour computation impossible).
+
+```scala
+val frontfaceColor = Color(255, 0, 0)
+val backfaceColor = Color(0, 255, 0)
+val contourColor = Color(255, 255, 255)
+
+def application(t: Double, canvas: Canvas): Unit = {
+ val scale = math.sin(t)
+ canvas.rasterizeShape(triangle.scale(scale, 1.0), Some(frontfaceColor), Some(backfaceColor))(32, 32)
+ canvas.rasterizeShape(square.scale(scale, 1.0), Some(frontfaceColor), Some(backfaceColor))(64, 32)
+ canvas.rasterizeShape(octagon.scale(scale, 1.0), Some(frontfaceColor), Some(backfaceColor))(32, 64)
+ canvas.rasterizeShape(circle.scale(scale, 1.0), Some(frontfaceColor), Some(backfaceColor))(64, 64)
+
+ canvas.rasterizeContour(triangle.scale(scale, 1.0), contourColor)(32, 32)
+ canvas.rasterizeContour(square.scale(scale, 1.0), contourColor)(64, 32)
+ canvas.rasterizeContour(octagon.scale(scale, 1.0), contourColor)(32, 64)
+ // Can't compute the contour of a circle scaled on only one dimension
+ //canvas.rasterizeContour(circle.scale(scale, 1.0), contourColor)(64, 64)
+}
+```
+
+### Putting it all together
+
+```scala
+val canvasSettings = Canvas.Settings(width = 128, height = 128, scale = Some(4), clearColor = Color(0, 0, 0))
+
+AppLoop
+ .statefulRenderLoop((t: Double) => (canvas: Canvas) => {
+ canvas.clear()
+ application(t, canvas)
+ canvas.redraw()
+ t + 0.01
+ }
+ )
+ .configure(canvasSettings, LoopFrequency.hz60, 0)
+ .run()
+```
diff --git a/examples/release/10-audio-playback.md b/examples/release/11-audio-playback.md
similarity index 98%
rename from examples/release/10-audio-playback.md
rename to examples/release/11-audio-playback.md
index a7a9bebe..e9d32100 100644
--- a/examples/release/10-audio-playback.md
+++ b/examples/release/11-audio-playback.md
@@ -1,4 +1,4 @@
-# 10. Audio playback
+# 11. Audio playback
Besides graphics and input, Minart also supports loading and playing back audio.
@@ -10,7 +10,7 @@ Here we will see how to generate audio waves and play a simple audio clip.
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.audio.*
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/release/11-loading-sounds.md b/examples/release/12-loading-sounds.md
similarity index 92%
rename from examples/release/11-loading-sounds.md
rename to examples/release/12-loading-sounds.md
index d70440ad..31744b80 100644
--- a/examples/release/11-loading-sounds.md
+++ b/examples/release/12-loading-sounds.md
@@ -1,8 +1,8 @@
-# 11. Loading sounds
+# 12. Loading sounds
Just like we did with images, we can also load audio clips from files.
-Minart supports multiple audio formats (RTTL AIFF, WAV and QOA).
+Minart supports multiple audio formats (RTTL, AIFF, WAV and QOA).
Here's a small example to play a clip from a file
@@ -17,7 +17,7 @@ This package also has an `Sound` object with helpers to call the loaders.
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.1"
+//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.audio.*
import eu.joaocosta.minart.audio.sound.*
diff --git a/examples/snapshot/01-introduction.md b/examples/snapshot/01-introduction.md
index d52ebaa0..ed51b467 100644
--- a/examples/snapshot/01-introduction.md
+++ b/examples/snapshot/01-introduction.md
@@ -24,7 +24,7 @@ The simplest way to use Minart is to simply include the `minart` library, which
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
```
As for the imports, the `eu.joaocosta.minart.backend.defaults` package contains the givens with the backend-specific (JVM/JS/Native) logic.
diff --git a/examples/snapshot/02-portable-applications.md b/examples/snapshot/02-portable-applications.md
index 19cfa1a3..0015c9c4 100644
--- a/examples/snapshot/02-portable-applications.md
+++ b/examples/snapshot/02-portable-applications.md
@@ -38,7 +38,7 @@ Note, however, that we now also import `eu.joaocosta.minart.runtime.*`, which pr
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/snapshot/03-animation.md b/examples/snapshot/03-animation.md
index a722ce8e..32941e90 100644
--- a/examples/snapshot/03-animation.md
+++ b/examples/snapshot/03-animation.md
@@ -12,7 +12,7 @@ As before, let's import the backend, graphics and runtime.
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/snapshot/04-pointer-input.md b/examples/snapshot/04-pointer-input.md
index bc042901..11e89079 100644
--- a/examples/snapshot/04-pointer-input.md
+++ b/examples/snapshot/04-pointer-input.md
@@ -14,7 +14,7 @@ We also need to import the input package. We need this to read data from input d
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/snapshot/05-stateful-applications.md b/examples/snapshot/05-stateful-applications.md
index 6ab40d73..f9d5cb4c 100644
--- a/examples/snapshot/05-stateful-applications.md
+++ b/examples/snapshot/05-stateful-applications.md
@@ -14,7 +14,7 @@ The dependencies will be the same as before. We also include Scala's `Random` he
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import scala.util.Random
diff --git a/examples/snapshot/06-surfaces.md b/examples/snapshot/06-surfaces.md
index 1bd7d9e3..4d7da9bc 100644
--- a/examples/snapshot/06-surfaces.md
+++ b/examples/snapshot/06-surfaces.md
@@ -17,7 +17,7 @@ For this example, we just need to use the graphics and runtime
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/snapshot/07-canvas-settings.md b/examples/snapshot/07-canvas-settings.md
index 5eb14142..ff2443dd 100644
--- a/examples/snapshot/07-canvas-settings.md
+++ b/examples/snapshot/07-canvas-settings.md
@@ -12,7 +12,7 @@ Here's a quick example on how to do that. In this example application, we will c
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/snapshot/08-loading-images.md b/examples/snapshot/08-loading-images.md
index eabbf3a5..cfca1845 100644
--- a/examples/snapshot/08-loading-images.md
+++ b/examples/snapshot/08-loading-images.md
@@ -2,7 +2,7 @@
So far we always created our surfaces manually. This is fine for small demos and procedural graphics, but often it can be useful to load an image from an external file.
-Minart has support for some image file formats (PPM, BMP and QOI). Here we will see how to load them.
+Minart has support for some image file formats (PBM/PPM, PDI, BMP and QOI). Here we will see how to load them.
## A simple image viewer
@@ -15,7 +15,7 @@ This package also has an `Image` object with helpers to call the loaders.
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/snapshot/09-surface-views.md b/examples/snapshot/09-surface-views.md
index 18782272..b39654a3 100644
--- a/examples/snapshot/09-surface-views.md
+++ b/examples/snapshot/09-surface-views.md
@@ -13,7 +13,7 @@ This tutorial will show how to use those
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/snapshot/10-vector-shapes.md b/examples/snapshot/10-vector-shapes.md
index 3dbeb29a..5a3c3c59 100644
--- a/examples/snapshot/10-vector-shapes.md
+++ b/examples/snapshot/10-vector-shapes.md
@@ -10,7 +10,7 @@ The relevant methods are in the `eu.joaocosta.minart.geometry` package
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
import eu.joaocosta.minart.graphics.*
diff --git a/examples/snapshot/11-audio-playback.md b/examples/snapshot/11-audio-playback.md
index b5ca2d65..9bc196a5 100644
--- a/examples/snapshot/11-audio-playback.md
+++ b/examples/snapshot/11-audio-playback.md
@@ -10,7 +10,7 @@ Here we will see how to generate audio waves and play a simple audio clip.
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.audio.*
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/snapshot/12-loading-sounds.md b/examples/snapshot/12-loading-sounds.md
index 8cd1a49f..85a1d2be 100644
--- a/examples/snapshot/12-loading-sounds.md
+++ b/examples/snapshot/12-loading-sounds.md
@@ -2,7 +2,7 @@
Just like we did with images, we can also load audio clips from files.
-Minart supports multiple audio formats (RTTL AIFF, WAV and QOA).
+Minart supports multiple audio formats (RTTL, AIFF, WAV and QOA).
Here's a small example to play a clip from a file
@@ -17,7 +17,7 @@ This package also has an `Sound` object with helpers to call the loaders.
```scala
//> using scala "3.3.3"
-//> using dep "eu.joaocosta::minart::0.6.2-SNAPSHOT"
+//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.audio.*
import eu.joaocosta.minart.audio.sound.*
From 8e8d41643af7e9c5b5b9c3389881d0e92a38dedd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Costa?=
Date: Sun, 3 Nov 2024 14:54:00 +0000
Subject: [PATCH 3/7] Update g8 template for 0.6.2
---
src/main/g8/$if(!sbt_project.truthy)$project.scala$endif$ | 2 +-
src/main/g8/$if(sbt_project.truthy)$build.sbt$endif$ | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/g8/$if(!sbt_project.truthy)$project.scala$endif$ b/src/main/g8/$if(!sbt_project.truthy)$project.scala$endif$
index 64ae0d5a..85c88cf3 100644
--- a/src/main/g8/$if(!sbt_project.truthy)$project.scala$endif$
+++ b/src/main/g8/$if(!sbt_project.truthy)$project.scala$endif$
@@ -1,3 +1,3 @@
//> using scala $scala_version$
-//> using dep eu.joaocosta::minart::0.6.1
+//> using dep eu.joaocosta::minart::0.6.2
diff --git a/src/main/g8/$if(sbt_project.truthy)$build.sbt$endif$ b/src/main/g8/$if(sbt_project.truthy)$build.sbt$endif$
index 99d30003..61fd9c12 100644
--- a/src/main/g8/$if(sbt_project.truthy)$build.sbt$endif$
+++ b/src/main/g8/$if(sbt_project.truthy)$build.sbt$endif$
@@ -13,7 +13,7 @@ lazy val root =
.settings(
Seq(
libraryDependencies ++= List(
- "eu.joaocosta" %%% "minart" % "0.6.1"
+ "eu.joaocosta" %%% "minart" % "0.6.2"
)
)
)
From 87e5d7a15548f51070d874e24a6d2a49508a1871 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Costa?=
Date: Sun, 3 Nov 2024 14:55:53 +0000
Subject: [PATCH 4/7] Update scala to 3.3.4 on examples and templates
---
examples/release/01-introduction.md | 2 +-
examples/release/02-portable-applications.md | 2 +-
examples/release/03-animation.md | 2 +-
examples/release/04-pointer-input.md | 2 +-
examples/release/05-stateful-applications.md | 2 +-
examples/release/06-surfaces.md | 2 +-
examples/release/07-canvas-settings.md | 2 +-
examples/release/08-loading-images.md | 2 +-
examples/release/09-surface-views.md | 2 +-
examples/release/10-vector-shapes.md | 2 +-
examples/release/11-audio-playback.md | 2 +-
examples/release/12-loading-sounds.md | 2 +-
examples/snapshot/01-introduction.md | 2 +-
examples/snapshot/02-portable-applications.md | 2 +-
examples/snapshot/03-animation.md | 2 +-
examples/snapshot/04-pointer-input.md | 2 +-
examples/snapshot/05-stateful-applications.md | 2 +-
examples/snapshot/06-surfaces.md | 2 +-
examples/snapshot/07-canvas-settings.md | 2 +-
examples/snapshot/08-loading-images.md | 2 +-
examples/snapshot/09-surface-views.md | 2 +-
examples/snapshot/10-vector-shapes.md | 2 +-
examples/snapshot/11-audio-playback.md | 2 +-
examples/snapshot/12-loading-sounds.md | 2 +-
src/main/g8/default.properties | 2 +-
25 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/examples/release/01-introduction.md b/examples/release/01-introduction.md
index 53de073c..f613297b 100644
--- a/examples/release/01-introduction.md
+++ b/examples/release/01-introduction.md
@@ -23,7 +23,7 @@ scala-cli 01-introduction.md
The simplest way to use Minart is to simply include the `minart` library, which packages all modules.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
```
diff --git a/examples/release/02-portable-applications.md b/examples/release/02-portable-applications.md
index bd9a87ae..d3badf5b 100644
--- a/examples/release/02-portable-applications.md
+++ b/examples/release/02-portable-applications.md
@@ -37,7 +37,7 @@ We start with the similar imports to the previous example.
Note, however, that we now also import `eu.joaocosta.minart.runtime.*`, which provides a platform agnostic runtime that we can use.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/release/03-animation.md b/examples/release/03-animation.md
index da008a97..6b5301f7 100644
--- a/examples/release/03-animation.md
+++ b/examples/release/03-animation.md
@@ -11,7 +11,7 @@ This time, we'll write an animated fire, updating at 60 frames per second!
As before, let's import the backend, graphics and runtime.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/release/04-pointer-input.md b/examples/release/04-pointer-input.md
index 37224c01..a3c98ad6 100644
--- a/examples/release/04-pointer-input.md
+++ b/examples/release/04-pointer-input.md
@@ -13,7 +13,7 @@ As before, let's import the backend, graphics and runtime.
We also need to import the input package. We need this to read data from input devices, such as keyboard and mouse.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/release/05-stateful-applications.md b/examples/release/05-stateful-applications.md
index 08301bdf..5276f7d8 100644
--- a/examples/release/05-stateful-applications.md
+++ b/examples/release/05-stateful-applications.md
@@ -13,7 +13,7 @@ In this example, we will show how to write applications that manipulate a state
The dependencies will be the same as before. We also include Scala's `Random` here just to make the game more interesting.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import scala.util.Random
diff --git a/examples/release/06-surfaces.md b/examples/release/06-surfaces.md
index b65509e3..983e16bb 100644
--- a/examples/release/06-surfaces.md
+++ b/examples/release/06-surfaces.md
@@ -16,7 +16,7 @@ A `Surface` is something with a `getPixel` operation (`MutableSurface`s also pro
For this example, we just need to use the graphics and runtime
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
diff --git a/examples/release/07-canvas-settings.md b/examples/release/07-canvas-settings.md
index 8b9e63de..1f050255 100644
--- a/examples/release/07-canvas-settings.md
+++ b/examples/release/07-canvas-settings.md
@@ -11,7 +11,7 @@ Here's a quick example on how to do that. In this example application, we will c
### Dependencies and imports
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/release/08-loading-images.md b/examples/release/08-loading-images.md
index a3ed7178..15555ffc 100644
--- a/examples/release/08-loading-images.md
+++ b/examples/release/08-loading-images.md
@@ -14,7 +14,7 @@ This package also has an `Image` object with helpers to call the loaders.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/release/09-surface-views.md b/examples/release/09-surface-views.md
index 3eda9aaf..d97a7480 100644
--- a/examples/release/09-surface-views.md
+++ b/examples/release/09-surface-views.md
@@ -12,7 +12,7 @@ This tutorial will show how to use those
### Dependencies and imports
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/release/10-vector-shapes.md b/examples/release/10-vector-shapes.md
index e51bc6bc..961f4518 100644
--- a/examples/release/10-vector-shapes.md
+++ b/examples/release/10-vector-shapes.md
@@ -9,7 +9,7 @@ Besides surfaces, Minart also allows you to render some basic vector shapes.
The relevant methods are in the `eu.joaocosta.minart.geometry` package
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/release/11-audio-playback.md b/examples/release/11-audio-playback.md
index e9d32100..6aa82ce4 100644
--- a/examples/release/11-audio-playback.md
+++ b/examples/release/11-audio-playback.md
@@ -9,7 +9,7 @@ Here we will see how to generate audio waves and play a simple audio clip.
### Dependencies and imports
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.audio.*
diff --git a/examples/release/12-loading-sounds.md b/examples/release/12-loading-sounds.md
index 31744b80..a9417a5a 100644
--- a/examples/release/12-loading-sounds.md
+++ b/examples/release/12-loading-sounds.md
@@ -16,7 +16,7 @@ This package also has an `Sound` object with helpers to call the loaders.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.2"
import eu.joaocosta.minart.audio.*
diff --git a/examples/snapshot/01-introduction.md b/examples/snapshot/01-introduction.md
index ed51b467..3069277e 100644
--- a/examples/snapshot/01-introduction.md
+++ b/examples/snapshot/01-introduction.md
@@ -23,7 +23,7 @@ scala-cli 01-introduction.md
The simplest way to use Minart is to simply include the `minart` library, which packages all modules.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
```
diff --git a/examples/snapshot/02-portable-applications.md b/examples/snapshot/02-portable-applications.md
index 0015c9c4..65e6d35f 100644
--- a/examples/snapshot/02-portable-applications.md
+++ b/examples/snapshot/02-portable-applications.md
@@ -37,7 +37,7 @@ We start with the similar imports to the previous example.
Note, however, that we now also import `eu.joaocosta.minart.runtime.*`, which provides a platform agnostic runtime that we can use.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/snapshot/03-animation.md b/examples/snapshot/03-animation.md
index 32941e90..cab67c5d 100644
--- a/examples/snapshot/03-animation.md
+++ b/examples/snapshot/03-animation.md
@@ -11,7 +11,7 @@ This time, we'll write an animated fire, updating at 60 frames per second!
As before, let's import the backend, graphics and runtime.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/snapshot/04-pointer-input.md b/examples/snapshot/04-pointer-input.md
index 11e89079..1484f590 100644
--- a/examples/snapshot/04-pointer-input.md
+++ b/examples/snapshot/04-pointer-input.md
@@ -13,7 +13,7 @@ As before, let's import the backend, graphics and runtime.
We also need to import the input package. We need this to read data from input devices, such as keyboard and mouse.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/snapshot/05-stateful-applications.md b/examples/snapshot/05-stateful-applications.md
index f9d5cb4c..9afb2a2c 100644
--- a/examples/snapshot/05-stateful-applications.md
+++ b/examples/snapshot/05-stateful-applications.md
@@ -13,7 +13,7 @@ In this example, we will show how to write applications that manipulate a state
The dependencies will be the same as before. We also include Scala's `Random` here just to make the game more interesting.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import scala.util.Random
diff --git a/examples/snapshot/06-surfaces.md b/examples/snapshot/06-surfaces.md
index 4d7da9bc..7503b29a 100644
--- a/examples/snapshot/06-surfaces.md
+++ b/examples/snapshot/06-surfaces.md
@@ -16,7 +16,7 @@ A `Surface` is something with a `getPixel` operation (`MutableSurface`s also pro
For this example, we just need to use the graphics and runtime
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
diff --git a/examples/snapshot/07-canvas-settings.md b/examples/snapshot/07-canvas-settings.md
index ff2443dd..9fbc1f34 100644
--- a/examples/snapshot/07-canvas-settings.md
+++ b/examples/snapshot/07-canvas-settings.md
@@ -11,7 +11,7 @@ Here's a quick example on how to do that. In this example application, we will c
### Dependencies and imports
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/snapshot/08-loading-images.md b/examples/snapshot/08-loading-images.md
index cfca1845..beb79898 100644
--- a/examples/snapshot/08-loading-images.md
+++ b/examples/snapshot/08-loading-images.md
@@ -14,7 +14,7 @@ This package also has an `Image` object with helpers to call the loaders.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/snapshot/09-surface-views.md b/examples/snapshot/09-surface-views.md
index b39654a3..4b1cef43 100644
--- a/examples/snapshot/09-surface-views.md
+++ b/examples/snapshot/09-surface-views.md
@@ -12,7 +12,7 @@ This tutorial will show how to use those
### Dependencies and imports
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/snapshot/10-vector-shapes.md b/examples/snapshot/10-vector-shapes.md
index 5a3c3c59..c2cfa682 100644
--- a/examples/snapshot/10-vector-shapes.md
+++ b/examples/snapshot/10-vector-shapes.md
@@ -9,7 +9,7 @@ Besides surfaces, Minart also allows you to render some basic vector shapes.
The relevant methods are in the `eu.joaocosta.minart.geometry` package
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.backend.defaults.given
diff --git a/examples/snapshot/11-audio-playback.md b/examples/snapshot/11-audio-playback.md
index 9bc196a5..d1d951bf 100644
--- a/examples/snapshot/11-audio-playback.md
+++ b/examples/snapshot/11-audio-playback.md
@@ -9,7 +9,7 @@ Here we will see how to generate audio waves and play a simple audio clip.
### Dependencies and imports
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.audio.*
diff --git a/examples/snapshot/12-loading-sounds.md b/examples/snapshot/12-loading-sounds.md
index 85a1d2be..10f71087 100644
--- a/examples/snapshot/12-loading-sounds.md
+++ b/examples/snapshot/12-loading-sounds.md
@@ -16,7 +16,7 @@ This package also has an `Sound` object with helpers to call the loaders.
```scala
-//> using scala "3.3.3"
+//> using scala "3.3.4"
//> using dep "eu.joaocosta::minart::0.6.3-SNAPSHOT"
import eu.joaocosta.minart.audio.*
diff --git a/src/main/g8/default.properties b/src/main/g8/default.properties
index 5a1408ec..a717cc1f 100644
--- a/src/main/g8/default.properties
+++ b/src/main/g8/default.properties
@@ -2,5 +2,5 @@ name = Minart Project
organization = com.github.myself
package = $organization$.project
version = 1.0
-scala_version = 3.3.3
+scala_version = 3.3.4
sbt_project = no
From 13749bc2ca870f543c27fde17d226010f55d2b90 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Costa?=
Date: Sun, 3 Nov 2024 15:10:50 +0000
Subject: [PATCH 5/7] Update sidebar
---
docs/sidebar.yml | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/docs/sidebar.yml b/docs/sidebar.yml
index f2c9dbb6..d39adc60 100644
--- a/docs/sidebar.yml
+++ b/docs/sidebar.yml
@@ -30,7 +30,9 @@ subsection:
page: ../../examples/release/08-loading-images.md
- title: "9. Surface Views"
page: ../../examples/release/09-surface-views.md
- - title: "10. Audio Playback"
- page: ../../examples/release/10-audio-playback.md
- - title: "11. Loading Sounds"
- page: ../../examples/release/11-loading-sounds.md
+ - title: "10. Vector Shapes"
+ page: ../../examples/release/10-vector-shapes.md
+ - title: "11. Audio Playback"
+ page: ../../examples/release/11-audio-playback.md
+ - title: "12. Loading Sounds"
+ page: ../../examples/release/12-loading-sounds.md
From e73866e8cd7ed69a9a3526b9462766ab9c052ffc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Costa?=
Date: Sun, 3 Nov 2024 15:16:20 +0000
Subject: [PATCH 6/7] Set version to 0.6.2
---
version.sbt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version.sbt b/version.sbt
index 1dbf4ae0..49ac3aa3 100644
--- a/version.sbt
+++ b/version.sbt
@@ -1 +1 @@
-ThisBuild / version := "0.6.2-SNAPSHOT"
+ThisBuild / version := "0.6.2"
From 322ba1153d61393bc08c149fd5110f36ad8abfa4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Costa?=
Date: Sun, 3 Nov 2024 15:43:03 +0000
Subject: [PATCH 7/7] Setting version to 0.6.3-SNAPSHOT
---
version.sbt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version.sbt b/version.sbt
index 49ac3aa3..b4017733 100644
--- a/version.sbt
+++ b/version.sbt
@@ -1 +1 @@
-ThisBuild / version := "0.6.2"
+ThisBuild / version := "0.6.3-SNAPSHOT"