diff --git a/core/js/src/main/scala/eu/joaocosta/minart/backend/HtmlCanvas.scala b/backend/js/src/main/scala/eu/joaocosta/minart/backend/HtmlCanvas.scala similarity index 100% rename from core/js/src/main/scala/eu/joaocosta/minart/backend/HtmlCanvas.scala rename to backend/js/src/main/scala/eu/joaocosta/minart/backend/HtmlCanvas.scala diff --git a/core/js/src/main/scala/eu/joaocosta/minart/backend/ImageDataSurface.scala b/backend/js/src/main/scala/eu/joaocosta/minart/backend/ImageDataSurface.scala similarity index 100% rename from core/js/src/main/scala/eu/joaocosta/minart/backend/ImageDataSurface.scala rename to backend/js/src/main/scala/eu/joaocosta/minart/backend/ImageDataSurface.scala diff --git a/core/js/src/main/scala/eu/joaocosta/minart/backend/JsKeyMapping.scala b/backend/js/src/main/scala/eu/joaocosta/minart/backend/JsKeyMapping.scala similarity index 100% rename from core/js/src/main/scala/eu/joaocosta/minart/backend/JsKeyMapping.scala rename to backend/js/src/main/scala/eu/joaocosta/minart/backend/JsKeyMapping.scala diff --git a/core/js/src/main/scala/eu/joaocosta/minart/backend/JsLoopRunner.scala b/backend/js/src/main/scala/eu/joaocosta/minart/backend/JsLoopRunner.scala similarity index 100% rename from core/js/src/main/scala/eu/joaocosta/minart/backend/JsLoopRunner.scala rename to backend/js/src/main/scala/eu/joaocosta/minart/backend/JsLoopRunner.scala diff --git a/core/js/src/main/scala/eu/joaocosta/minart/backend/JsResource.scala b/backend/js/src/main/scala/eu/joaocosta/minart/backend/JsResource.scala similarity index 100% rename from core/js/src/main/scala/eu/joaocosta/minart/backend/JsResource.scala rename to backend/js/src/main/scala/eu/joaocosta/minart/backend/JsResource.scala diff --git a/core/js/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala b/backend/js/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala similarity index 100% rename from core/js/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala rename to backend/js/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala diff --git a/core/js/src/test/scala/eu/joaocosta/minart/backend/JsRenderLoopSpec.scala b/backend/js/src/test/scala/eu/joaocosta/minart/backend/JsRenderLoopSpec.scala similarity index 100% rename from core/js/src/test/scala/eu/joaocosta/minart/backend/JsRenderLoopSpec.scala rename to backend/js/src/test/scala/eu/joaocosta/minart/backend/JsRenderLoopSpec.scala diff --git a/core/jvm/src/main/scala/eu/joaocosta/minart/backend/AwtCanvas.scala b/backend/jvm/src/main/scala/eu/joaocosta/minart/backend/AwtCanvas.scala similarity index 100% rename from core/jvm/src/main/scala/eu/joaocosta/minart/backend/AwtCanvas.scala rename to backend/jvm/src/main/scala/eu/joaocosta/minart/backend/AwtCanvas.scala diff --git a/core/jvm/src/main/scala/eu/joaocosta/minart/backend/AwtKeyMapping.scala b/backend/jvm/src/main/scala/eu/joaocosta/minart/backend/AwtKeyMapping.scala similarity index 100% rename from core/jvm/src/main/scala/eu/joaocosta/minart/backend/AwtKeyMapping.scala rename to backend/jvm/src/main/scala/eu/joaocosta/minart/backend/AwtKeyMapping.scala diff --git a/core/jvm/src/main/scala/eu/joaocosta/minart/backend/BufferedImageSurface.scala b/backend/jvm/src/main/scala/eu/joaocosta/minart/backend/BufferedImageSurface.scala similarity index 100% rename from core/jvm/src/main/scala/eu/joaocosta/minart/backend/BufferedImageSurface.scala rename to backend/jvm/src/main/scala/eu/joaocosta/minart/backend/BufferedImageSurface.scala diff --git a/core/jvm/src/main/scala/eu/joaocosta/minart/backend/JavaLoopRunner.scala b/backend/jvm/src/main/scala/eu/joaocosta/minart/backend/JavaLoopRunner.scala similarity index 100% rename from core/jvm/src/main/scala/eu/joaocosta/minart/backend/JavaLoopRunner.scala rename to backend/jvm/src/main/scala/eu/joaocosta/minart/backend/JavaLoopRunner.scala diff --git a/core/jvm/src/main/scala/eu/joaocosta/minart/backend/JavaResource.scala b/backend/jvm/src/main/scala/eu/joaocosta/minart/backend/JavaResource.scala similarity index 100% rename from core/jvm/src/main/scala/eu/joaocosta/minart/backend/JavaResource.scala rename to backend/jvm/src/main/scala/eu/joaocosta/minart/backend/JavaResource.scala diff --git a/core/jvm/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala b/backend/jvm/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala similarity index 100% rename from core/jvm/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala rename to backend/jvm/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala diff --git a/core/jvm/src/test/scala/eu/joaocosta/minart/backend/JavaRenderLoopSpec.scala b/backend/jvm/src/test/scala/eu/joaocosta/minart/backend/JavaRenderLoopSpec.scala similarity index 100% rename from core/jvm/src/test/scala/eu/joaocosta/minart/backend/JavaRenderLoopSpec.scala rename to backend/jvm/src/test/scala/eu/joaocosta/minart/backend/JavaRenderLoopSpec.scala diff --git a/core/jvm/src/test/scala/eu/joaocosta/minart/graphics/BufferedImageSurfaceSpec.scala b/backend/jvm/src/test/scala/eu/joaocosta/minart/graphics/BufferedImageSurfaceSpec.scala similarity index 100% rename from core/jvm/src/test/scala/eu/joaocosta/minart/graphics/BufferedImageSurfaceSpec.scala rename to backend/jvm/src/test/scala/eu/joaocosta/minart/graphics/BufferedImageSurfaceSpec.scala diff --git a/core/native/src/main/scala/eu/joaocosta/minart/backend/NativeResource.scala b/backend/native/src/main/scala/eu/joaocosta/minart/backend/NativeResource.scala similarity index 100% rename from core/native/src/main/scala/eu/joaocosta/minart/backend/NativeResource.scala rename to backend/native/src/main/scala/eu/joaocosta/minart/backend/NativeResource.scala diff --git a/core/native/src/main/scala/eu/joaocosta/minart/backend/SdlCanvas.scala b/backend/native/src/main/scala/eu/joaocosta/minart/backend/SdlCanvas.scala similarity index 100% rename from core/native/src/main/scala/eu/joaocosta/minart/backend/SdlCanvas.scala rename to backend/native/src/main/scala/eu/joaocosta/minart/backend/SdlCanvas.scala diff --git a/core/native/src/main/scala/eu/joaocosta/minart/backend/SdlKeyMapping.scala b/backend/native/src/main/scala/eu/joaocosta/minart/backend/SdlKeyMapping.scala similarity index 100% rename from core/native/src/main/scala/eu/joaocosta/minart/backend/SdlKeyMapping.scala rename to backend/native/src/main/scala/eu/joaocosta/minart/backend/SdlKeyMapping.scala diff --git a/core/native/src/main/scala/eu/joaocosta/minart/backend/SdlLoopRunner.scala b/backend/native/src/main/scala/eu/joaocosta/minart/backend/SdlLoopRunner.scala similarity index 100% rename from core/native/src/main/scala/eu/joaocosta/minart/backend/SdlLoopRunner.scala rename to backend/native/src/main/scala/eu/joaocosta/minart/backend/SdlLoopRunner.scala diff --git a/core/native/src/main/scala/eu/joaocosta/minart/backend/SdlSurface.scala b/backend/native/src/main/scala/eu/joaocosta/minart/backend/SdlSurface.scala similarity index 100% rename from core/native/src/main/scala/eu/joaocosta/minart/backend/SdlSurface.scala rename to backend/native/src/main/scala/eu/joaocosta/minart/backend/SdlSurface.scala diff --git a/core/native/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala b/backend/native/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala similarity index 100% rename from core/native/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala rename to backend/native/src/main/scala/eu/joaocosta/minart/backend/defaults/package.scala diff --git a/core/native/src/main/scala/sdl2/Extras.scala b/backend/native/src/main/scala/sdl2/Extras.scala similarity index 100% rename from core/native/src/main/scala/sdl2/Extras.scala rename to backend/native/src/main/scala/sdl2/Extras.scala diff --git a/core/native/src/main/scala/sdl2/SDL.scala b/backend/native/src/main/scala/sdl2/SDL.scala similarity index 100% rename from core/native/src/main/scala/sdl2/SDL.scala rename to backend/native/src/main/scala/sdl2/SDL.scala diff --git a/core/native/src/test/scala/eu/joaocosta/minart/backend/SdlRenderLoopSpec.scala b/backend/native/src/test/scala/eu/joaocosta/minart/backend/SdlRenderLoopSpec.scala similarity index 100% rename from core/native/src/test/scala/eu/joaocosta/minart/backend/SdlRenderLoopSpec.scala rename to backend/native/src/test/scala/eu/joaocosta/minart/backend/SdlRenderLoopSpec.scala diff --git a/core/native/src/test/scala/eu/joaocosta/minart/graphics/SdlSurfaceSpec.scala b/backend/native/src/test/scala/eu/joaocosta/minart/graphics/SdlSurfaceSpec.scala similarity index 100% rename from core/native/src/test/scala/eu/joaocosta/minart/graphics/SdlSurfaceSpec.scala rename to backend/native/src/test/scala/eu/joaocosta/minart/graphics/SdlSurfaceSpec.scala diff --git a/core/shared/src/main/scala/eu/joaocosta/minart/backend/PpmCanvas.scala b/backend/shared/src/main/scala/eu/joaocosta/minart/backend/PpmCanvas.scala similarity index 100% rename from core/shared/src/main/scala/eu/joaocosta/minart/backend/PpmCanvas.scala rename to backend/shared/src/main/scala/eu/joaocosta/minart/backend/PpmCanvas.scala diff --git a/backend/shared/src/test/scala/eu/joaocosta/minart/graphics/MutableSurfaceTests.scala b/backend/shared/src/test/scala/eu/joaocosta/minart/graphics/MutableSurfaceTests.scala new file mode 100644 index 00000000..d72baef7 --- /dev/null +++ b/backend/shared/src/test/scala/eu/joaocosta/minart/graphics/MutableSurfaceTests.scala @@ -0,0 +1,46 @@ +package eu.joaocosta.minart.graphics + +import verify._ + +import eu.joaocosta.minart.backend._ +import eu.joaocosta.minart.runtime._ + +trait MutableSurfaceTests extends BasicTestSuite { + + def surface: Surface.MutableSurface + + test("Return the correct number of pixels") { + val pixels = surface.getPixels() + assert(pixels.size == surface.height) + assert(pixels.forall(_.size == surface.width)) + } + + test("Write and read pixels in certain positions") { + surface.putPixel(0, 0, Color(1, 2, 3)) + surface.putPixel(0, 1, Color(3, 2, 1)) + surface.putPixel(1, 0, Color(2, 1, 3)) + assert(surface.getPixel(0, 0) == Some(Color(1, 2, 3))) + assert(surface.getPixel(0, 1) == Some(Color(3, 2, 1))) + assert(surface.getPixel(1, 0) == Some(Color(2, 1, 3))) + assert(surface.getPixels()(0)(0) == Color(1, 2, 3)) + assert(surface.getPixels()(1)(0) == Color(3, 2, 1)) + assert(surface.getPixels()(0)(1) == Color(2, 1, 3)) + } + + test("Don't blow up when invalid positions are provided") { + surface.putPixel(-1, -1, Color(1, 2, 3)) + surface.putPixel(surface.width, 0, Color(1, 2, 3)) + surface.putPixel(0, surface.height, Color(1, 2, 3)) + + assert(surface.getPixel(-1, -1) == None) + assert(surface.getPixel(surface.width, 0) == None) + assert(surface.getPixel(0, surface.height) == None) + } + + test("Fill the surface with a single color") { + surface.fill(Color(1, 2, 3)) + assert(surface.getPixels().flatten.forall(_ == Color(1, 2, 3))) + surface.fill(Color(3, 2, 1)) + assert(surface.getPixels().flatten.forall(_ == Color(3, 2, 1))) + } +} diff --git a/core/shared/src/test/scala/eu/joaocosta/minart/graphics/RenderLoopTests.scala b/backend/shared/src/test/scala/eu/joaocosta/minart/graphics/RenderLoopTests.scala similarity index 100% rename from core/shared/src/test/scala/eu/joaocosta/minart/graphics/RenderLoopTests.scala rename to backend/shared/src/test/scala/eu/joaocosta/minart/graphics/RenderLoopTests.scala diff --git a/build.sbt b/build.sbt index 2c56b765..f9ab6f36 100644 --- a/build.sbt +++ b/build.sbt @@ -101,6 +101,16 @@ lazy val core = .jsSettings(jsSettings) .nativeSettings(nativeSettings) +lazy val backend = + crossProject(JVMPlatform, JSPlatform, NativePlatform) + .dependsOn(core) + .settings(sharedSettings) + .settings(name := "minart-backend") + .settings(testSettings) + .settings(publishSettings) + .jsSettings(jsSettings) + .nativeSettings(nativeSettings) + lazy val pure = crossProject(JVMPlatform, JSPlatform, NativePlatform) .dependsOn(core) @@ -132,6 +142,7 @@ def example(project: sbtcrossproject.CrossProject.Builder, exampleName: String) project .in(file(s"examples/${exampleName}")) .dependsOn(core) + .dependsOn(backend) .settings(sharedSettings) .settings(name := s"minart-examples-${exampleName}") .settings(noTestSettings) diff --git a/core/shared/src/main/scala/eu/joaocosta/minart/backend/default/DefaultBackend.scala b/core/shared/src/main/scala/eu/joaocosta/minart/backend/default/DefaultBackend.scala index 3f2968a4..8f0d3900 100644 --- a/core/shared/src/main/scala/eu/joaocosta/minart/backend/default/DefaultBackend.scala +++ b/core/shared/src/main/scala/eu/joaocosta/minart/backend/default/DefaultBackend.scala @@ -1,9 +1,14 @@ package eu.joaocosta.minart.backend.defaults +import scala.annotation.implicitNotFound + /** Typeclass to fetch an implicit default backend (e.g. Canvas or RenderLoop) for a cetain platform. * This is used to power the `Backend.apply()` implementations. * Ideally, an end user of the library should not need to implement this. */ +@implicitNotFound( + "Default backend not found.\nIf you want to use the default backends import eu.joaocosta.minart.backend.defaults._ and add the minart-backend dependency." +) trait DefaultBackend[-A, +B] { def defaultValue(params: A): B def defaultValue()(implicit ev: Any <:< A): B = defaultValue(ev(())) diff --git a/core/shared/src/main/scala/eu/joaocosta/minart/graphics/Canvas.scala b/core/shared/src/main/scala/eu/joaocosta/minart/graphics/Canvas.scala index d7b41b4d..c8855406 100644 --- a/core/shared/src/main/scala/eu/joaocosta/minart/graphics/Canvas.scala +++ b/core/shared/src/main/scala/eu/joaocosta/minart/graphics/Canvas.scala @@ -1,5 +1,6 @@ package eu.joaocosta.minart.graphics +import eu.joaocosta.minart.backend.defaults._ import eu.joaocosta.minart.input._ /** Window with a canvas that can be painted. @@ -78,7 +79,7 @@ object Canvas { * * @return [[Canvas]] using the default backend for the target platform */ - def create(settings: Canvas.Settings): Canvas = + def create(settings: Canvas.Settings)(implicit backend: DefaultBackend[Any, LowLevelCanvas]): Canvas = CanvasManager().init(settings) /** A system resource used by the Canvas. diff --git a/core/shared/src/main/scala/eu/joaocosta/minart/graphics/CanvasManager.scala b/core/shared/src/main/scala/eu/joaocosta/minart/graphics/CanvasManager.scala index cabb08de..a10ca300 100644 --- a/core/shared/src/main/scala/eu/joaocosta/minart/graphics/CanvasManager.scala +++ b/core/shared/src/main/scala/eu/joaocosta/minart/graphics/CanvasManager.scala @@ -1,5 +1,7 @@ package eu.joaocosta.minart.graphics +import eu.joaocosta.minart.backend.defaults._ + /** Abstraction that provides an `init` operation to create a new canvas. * * This is helpful to deal with the fact that creating a new canvas is a @@ -28,6 +30,6 @@ object CanvasManager { * * @return [[CanvasManager]] using the default backend for the target platform */ - def apply(): CanvasManager = + def apply()(implicit backend: DefaultBackend[Any, LowLevelCanvas]): CanvasManager = CanvasManager(() => LowLevelCanvas.create()) } diff --git a/core/shared/src/main/scala/eu/joaocosta/minart/graphics/LowLevelCanvas.scala b/core/shared/src/main/scala/eu/joaocosta/minart/graphics/LowLevelCanvas.scala index 6f55def9..9df59b87 100644 --- a/core/shared/src/main/scala/eu/joaocosta/minart/graphics/LowLevelCanvas.scala +++ b/core/shared/src/main/scala/eu/joaocosta/minart/graphics/LowLevelCanvas.scala @@ -49,8 +49,8 @@ object LowLevelCanvas { * * @return [[LowLevelCanvas]] using the default backend for the target platform */ - def create(): LowLevelCanvas = - DefaultBackend[Any, LowLevelCanvas].defaultValue() + def create()(implicit backend: DefaultBackend[Any, LowLevelCanvas]): LowLevelCanvas = + backend.defaultValue() /** Internal data structure containing canvas settings and precomputed values. */ diff --git a/core/shared/src/main/scala/eu/joaocosta/minart/graphics/RenderLoop.scala b/core/shared/src/main/scala/eu/joaocosta/minart/graphics/RenderLoop.scala index 1cc19433..ed1bac4e 100644 --- a/core/shared/src/main/scala/eu/joaocosta/minart/graphics/RenderLoop.scala +++ b/core/shared/src/main/scala/eu/joaocosta/minart/graphics/RenderLoop.scala @@ -1,5 +1,6 @@ package eu.joaocosta.minart.graphics +import eu.joaocosta.minart.backend.defaults._ import eu.joaocosta.minart.graphics.RenderLoop._ import eu.joaocosta.minart.runtime._ @@ -82,7 +83,10 @@ object RenderLoop { * * @param canvasSettings settings to use to build the canvas */ - def apply(canvasSettings: Canvas.Settings): Unit = apply(LoopRunner(), CanvasManager(), canvasSettings) + def apply( + canvasSettings: Canvas.Settings + )(implicit lr: DefaultBackend[Any, LoopRunner], cm: DefaultBackend[Any, LowLevelCanvas]): Unit = + apply(LoopRunner(), CanvasManager(), canvasSettings) def apply( runner: LoopRunner, canvasManager: CanvasManager, @@ -113,7 +117,10 @@ object RenderLoop { * @param canvasSettings settings to use to build the canvas * @param initalState initial render loop state */ - def apply(canvasSettings: Canvas.Settings, initialState: S): Unit = + def apply(canvasSettings: Canvas.Settings, initialState: S)(implicit + lr: DefaultBackend[Any, LoopRunner], + cm: DefaultBackend[Any, LowLevelCanvas] + ): Unit = apply(LoopRunner(), CanvasManager(), canvasSettings, initialState) /** Converts this render loop to a stateless render loop, with a predefined initial state. diff --git a/core/shared/src/main/scala/eu/joaocosta/minart/runtime/LoopRunner.scala b/core/shared/src/main/scala/eu/joaocosta/minart/runtime/LoopRunner.scala index 1dd96a8a..482bb0d4 100644 --- a/core/shared/src/main/scala/eu/joaocosta/minart/runtime/LoopRunner.scala +++ b/core/shared/src/main/scala/eu/joaocosta/minart/runtime/LoopRunner.scala @@ -36,6 +36,6 @@ trait LoopRunner { object LoopRunner { /** Get the default loop runner */ - def apply(): LoopRunner = - DefaultBackend[Any, LoopRunner].defaultValue() + def apply()(implicit backend: DefaultBackend[Any, LoopRunner]): LoopRunner = + backend.defaultValue() } diff --git a/core/shared/src/main/scala/eu/joaocosta/minart/runtime/Resource.scala b/core/shared/src/main/scala/eu/joaocosta/minart/runtime/Resource.scala index 6934513c..7219dd09 100644 --- a/core/shared/src/main/scala/eu/joaocosta/minart/runtime/Resource.scala +++ b/core/shared/src/main/scala/eu/joaocosta/minart/runtime/Resource.scala @@ -47,6 +47,6 @@ trait Resource { } object Resource { - def apply(resourcePath: String): Resource = - DefaultBackend[String, Resource].defaultValue(resourcePath) + def apply(resourcePath: String)(implicit backend: DefaultBackend[String, Resource]): Resource = + backend.defaultValue(resourcePath) } diff --git a/examples/blitting/shared/src/main/scala/eu/joaocosta/minart/examples/Blitting.scala b/examples/blitting/shared/src/main/scala/eu/joaocosta/minart/examples/Blitting.scala index 19212de7..3e3b91b1 100644 --- a/examples/blitting/shared/src/main/scala/eu/joaocosta/minart/examples/Blitting.scala +++ b/examples/blitting/shared/src/main/scala/eu/joaocosta/minart/examples/Blitting.scala @@ -1,5 +1,6 @@ package eu.joaocosta.minart.examples +import eu.joaocosta.minart.backend.defaults._ import eu.joaocosta.minart.graphics._ import eu.joaocosta.minart.runtime._ diff --git a/examples/colorsquare/shared/src/main/scala/eu/joaocosta/minart/examples/ColorSquare.scala b/examples/colorsquare/shared/src/main/scala/eu/joaocosta/minart/examples/ColorSquare.scala index f48ed329..93247a41 100644 --- a/examples/colorsquare/shared/src/main/scala/eu/joaocosta/minart/examples/ColorSquare.scala +++ b/examples/colorsquare/shared/src/main/scala/eu/joaocosta/minart/examples/ColorSquare.scala @@ -1,5 +1,6 @@ package eu.joaocosta.minart.examples +import eu.joaocosta.minart.backend.defaults._ import eu.joaocosta.minart.graphics._ object ColorSquare { diff --git a/examples/fire/shared/src/main/scala/eu/joaocosta/minart/examples/Fire.scala b/examples/fire/shared/src/main/scala/eu/joaocosta/minart/examples/Fire.scala index 0fefd68b..5730ec03 100644 --- a/examples/fire/shared/src/main/scala/eu/joaocosta/minart/examples/Fire.scala +++ b/examples/fire/shared/src/main/scala/eu/joaocosta/minart/examples/Fire.scala @@ -1,5 +1,6 @@ package eu.joaocosta.minart.examples +import eu.joaocosta.minart.backend.defaults._ import eu.joaocosta.minart.graphics._ import eu.joaocosta.minart.input._ import eu.joaocosta.minart.runtime._ diff --git a/examples/mousepointer/shared/src/main/scala/eu/joaocosta/minart/examples/MousePointer.scala b/examples/mousepointer/shared/src/main/scala/eu/joaocosta/minart/examples/MousePointer.scala index be6539f4..a75c374f 100644 --- a/examples/mousepointer/shared/src/main/scala/eu/joaocosta/minart/examples/MousePointer.scala +++ b/examples/mousepointer/shared/src/main/scala/eu/joaocosta/minart/examples/MousePointer.scala @@ -1,5 +1,6 @@ package eu.joaocosta.minart.examples +import eu.joaocosta.minart.backend.defaults._ import eu.joaocosta.minart.graphics._ import eu.joaocosta.minart.runtime._ diff --git a/examples/purecolorsquare/shared/src/main/scala/eu/joaocosta/minart/examples/PureColorSquare.scala b/examples/purecolorsquare/shared/src/main/scala/eu/joaocosta/minart/examples/PureColorSquare.scala index 1c02c8e9..467d8f57 100644 --- a/examples/purecolorsquare/shared/src/main/scala/eu/joaocosta/minart/examples/PureColorSquare.scala +++ b/examples/purecolorsquare/shared/src/main/scala/eu/joaocosta/minart/examples/PureColorSquare.scala @@ -1,5 +1,6 @@ package eu.joaocosta.minart.examples +import eu.joaocosta.minart.backend.defaults._ import eu.joaocosta.minart.graphics._ import eu.joaocosta.minart.graphics.pure._ import eu.joaocosta.minart.runtime._ diff --git a/examples/settings/shared/src/main/scala/eu/joaocosta/minart/examples/Settings.scala b/examples/settings/shared/src/main/scala/eu/joaocosta/minart/examples/Settings.scala index 8e00e275..72cec971 100644 --- a/examples/settings/shared/src/main/scala/eu/joaocosta/minart/examples/Settings.scala +++ b/examples/settings/shared/src/main/scala/eu/joaocosta/minart/examples/Settings.scala @@ -1,5 +1,6 @@ package eu.joaocosta.minart.examples +import eu.joaocosta.minart.backend.defaults._ import eu.joaocosta.minart.graphics._ import eu.joaocosta.minart.input.KeyboardInput.Key import eu.joaocosta.minart.runtime._ diff --git a/examples/snake/shared/src/main/scala/eu/joaocosta/minart/examples/Snake.scala b/examples/snake/shared/src/main/scala/eu/joaocosta/minart/examples/Snake.scala index 36efde4f..fd0649de 100644 --- a/examples/snake/shared/src/main/scala/eu/joaocosta/minart/examples/Snake.scala +++ b/examples/snake/shared/src/main/scala/eu/joaocosta/minart/examples/Snake.scala @@ -2,6 +2,7 @@ package eu.joaocosta.minart.examples import scala.util.Random +import eu.joaocosta.minart.backend.defaults._ import eu.joaocosta.minart.graphics._ import eu.joaocosta.minart.input._ import eu.joaocosta.minart.runtime._