Skip to content

Releases: FinochioM/S2D

0.3.0

Choose a tag to compare

@FinochioM FinochioM released this 22 Jun 16:35

This release was entirely focused on adding Audio support for S2D.
The audio system uses miniaudio scala bindings as the backend.

  • Added the audio package. (s2d.audio)
  • Sound.scala file for one-shot sounds like SFX
  • Music.scala file for long looping tracks.
  • pitch and volume controls.
  • playback controls.

Tested formats: MP3 & WAV.

Full Changelog: 0.2.2...0.3.0

0.2.2

Choose a tag to compare

@FinochioM FinochioM released this 12 Jun 17:19

This release fixes design issues, some internal functions were exposed to the public API.

Textures.update and Textures.updateRec previously required the user to pass a raw Ptr[Byte]. Both functions now accept a plain Array[Byte].

Several internal functions in Drawing (useProgram, getProjectionPtr, getCustomProjLoc, getCustomColorLoc, getCustomTexLoc) were public despite being implementation details shared between internal renderers. These are now private[s2d] and no longer visible to users.

Full Changelog: 0.2.1...0.2.2

0.2.1

Choose a tag to compare

@FinochioM FinochioM released this 08 Jun 23:26

This release fixed a bug on the Shaders.scala file.

Before shaders exposed the Ptr[Byte] and it was the user's job to use a Zone block to handle them.

Zone {
  val t = stackalloc[Float]()
  !t = elapsed
  Shaders.setShaderValue(shader, timeLoc, t.asInstanceOf[Ptr[Byte]], 0x1406)
}

Now the user just calls the setShaderValue function and passes its parameters just as like any other function.

Shaders.setShaderValue(shader, timeLoc, elapsed)

Full Changelog: 0.2.0...0.2.1

0.2.0

Choose a tag to compare

@FinochioM FinochioM released this 08 Jun 18:31

v0.2.0

Text rendering is now available in S2D via stb_truetype.

Load a font from any .ttf file and draw text:

val font = Font.load("assets/font.ttf", 32.0f).getOrElse {}
Text.draw("test", 100, 100, font, Color.White)
Text.measure("test", font) // returns Vector2
Font.unload(font)

Full Changelog: 0.1.9...0.2.0

0.1.9

Choose a tag to compare

@FinochioM FinochioM released this 08 Jun 13:13

v0.1.9

Color.scala was changed from a case class to an opaque type.


Full Changelog: 0.1.8...0.1.9

0.1.8

Choose a tag to compare

@FinochioM FinochioM released this 03 Jun 23:59

v_0.1.8-SNAPSHOT:

  • fixed a bug on Timing.scala file where FPS were spiking to INT.MAXSIZE
  • added waitForTargetFPS and setTargetFPS functions on Timing.scala.
  • implemented a batch renderer in BasicRenderer. every shape using default-shader gets accumulated into one single vertex buffer.
  • removed all the per-draw allocations (scala array and arraybuffer). replaced it with pre-allocations, using a scratch buffer.
  • removed every "Zone" block from renderers. no more stack allocations.
  • removed all "for" loops from the code. replaced them with while loops for better performance.
  • glVertexAttribPointer and glEnableVertexAttribArray called once on initialize instead of per-draw. saves state on VAO.
  • glUseProgram now uses a state tracking logic. removed logic that was unnecesarily switching programs for every call.
  • glGetUniformLocation now uses a cache logic for custom shaders (beginShader).
  • projection matrix gets computed once per frame and stored in a pre-allocated pointer. it is now shared across all renderers.
  • beginCamera/endCamera had a bug when using custom shaders. fixed this and now camera correctly sends data to projection matrix.
  • removed hardcoded "36" segments value from circle rendering. now radius is automatically calculated.
  • removed every try/catch block inside texture renderer.
  • added 2 new functions to Vector2 (withX and withY). the goal is to be able to create a modified copy without allocating intermediate values.

Full Changelog: 0.1.7...0.1.8

0.1.7

Choose a tag to compare

@FinochioM FinochioM released this 29 Jun 21:12

v_0.1.7-SNAPSHOT:

  • created Shaders.scala file.
  • started adding shader functions to Shaders.scala.
  • fixed description on build.sbt file.
  • added Shaders.scala to the core package.
  • added shader functions to Shaders.scala.
  • moved all the shader functionality from GL to GLEWHelper.
  • shaders are working for 120 compatibility profile.
  • added BasicRenderer file.
  • added TextureRenderer file.
  • added math package with Matrix4 file inside.
  • updated Basics.scala to use GL 330 core instead of 120 comp.
  • updated Textures.scala to use GL 330 core instead of 120 comp.
  • fixed Shaders.scala, now it works with 330 core.
  • tested all the functions in Basics.scala and Textures.scala with 330 core.
  • fixed wrong formatting on readme file.
  • s2d-cli available on coursier --contrib.
  • updated Drawing and Window files to use CORE instead of COMPATIBILITY profile.
  • shapes and textures now use a default shader.
  • custom shaders are working for 330 core.
  • reorganized project, added backend package and put all the bindings inside.
  • added Input package.
  • added first implementation of Screen Space functions.
  • added examples folder.
  • started creating some examples as a way of documentation, taking from raylib.

Full Changelog: 0.1.6...0.1.7

0.1.6

Choose a tag to compare

@FinochioM FinochioM released this 19 Jun 01:51

v_0.1.6-SNAPSHOT:

  • started the migration of the textures package.
  • added all the different load textures functions to Textures.scala.
  • added unload function to Textures.scala, necessary to free textures.
  • added update and updateRec to Textures.scala.
  • added GLEW bindings to gl package.
  • updated Window.scala (create function) to use GLEW.
  • updated load functions in Textures.scala to use GLEWHelper.
  • added assets folder to sandbox project.
  • updated build.bat in sandbox project to link GLEW.
  • added CONTRIBUTING.md file. Used to explain how to contribute to the project with the correct binaries and libraries.
  • updated README.md file with new information about how to build and run the library.
  • updated README.md, specified where to download dll and binaries.
  • manually placed the glew32.dll and sdl2.dll files in the sandbox root folder. THIS SHOULD BE CHANGED.
  • updated LIBRARY_EXPANSION.txt file, added new goal for the scala migration about the current state of project setup.
  • created a small CLI application as the main project creation tool.
  • updated README.md file with the new project creation step by step.
  • changed from Scala-CLI to SBT as the main build system.

0.1.5-SNAPSHOT

Choose a tag to compare

@FinochioM FinochioM released this 16 Jun 16:13

v_0.1.5-SNAPSHOT:

  • changed load and loadRaw to use STB instead of SDL2_Image.
  • added unload function to Images.scala, necessary to free images.
  • added loadAnim, loadAnimFromMemory functions to Images.scala.
  • added loadFromMemory function to Images.scala.
  • added loadFromTexture funtion to Images.scala.
  • added loadFromScreen function to Images.scala.
  • added isValid function to Images.scala.
  • modified unload function (added exception).
  • added getChannelCount and getBytesPerPixel functions to Images.scala.
  • finished the migration of Images.scala.

v_0.1.4-SNAPSHOT:

  • Refactored the entire structure of the project
  • added stb bindings.

0.1.3-SNAPSHOT

Choose a tag to compare

@FinochioM FinochioM released this 15 Jun 20:55

v_0.1.3-SNAPSHOT:

  • Added new SDL_Image and SDL_ImageExtras files.
  • Updated project.scala file.

v_0.1.2-SNAPSHOT:

  • Finished core package migration (Cursor, Window & Drawing)
  • Finished shapes package migration (Setup & Basics)
  • Started textures package migration.
  • Updated readme information with scala native configurations.
  • Renamed gl/Extras.scala to gl/GLExtras.scala.
  • Added Code of Conduct file.
  • Switched from IntelliJ to Focus. Added build.bat to run with Wezterm.