Skip to content

Releases: littledivy/deno_sdl2

0.6.0

02 Jan 13:20
b0381ee
Compare
Choose a tag to compare

deno_sdl2 0.6

Happy new year 2023!

  • Update to Deno 1.29.1

0.5.0

28 Mar 16:19
Compare
Choose a tag to compare

deno_sdl2 0.5

deno_sdl2 provides cross-platform bindings to sdl2, sdl2_ttf and sdl2_image.

get started

import { EventType, WindowBuilder } from "https://deno.land/x/sdl2/mod.ts";

const window = new WindowBuilder("Hello, Deno!", 640, 480).build();
const canvas = window.canvas();

for (const event of window.events()) {
  if (event.type == EventType.Quit) {
    break;
  } else if (event.type == EventType.Draw) {
    // Rainbow effect
    const r = Math.sin(Date.now() / 1000) * 127 + 128;
    const g = Math.sin(Date.now() / 1000 + 2) * 127 + 128;
    const b = Math.sin(Date.now() / 1000 + 4) * 127 + 128;
    canvas.setDrawColor(Math.floor(r), Math.floor(g), Math.floor(b), 255);
    canvas.clear();
    canvas.present();
  }
}
~> deno run --allow-ffi --unstable https://deno.land/x/sdl2/examples/hello.ts

0.3.1

06 Feb 17:35
Compare
Choose a tag to compare

deno_sdl2 0.3.1

Regenerated bindings/bindings.ts to fetch binary from releases.

0.3.0

06 Feb 14:46
Compare
Choose a tag to compare

deno_sdl2 0.3.0

What's Changed

  • Add star field example - #38
  • Add query_texture API - #39
  • add caviar example - #42
  • Add WGPU Texture support - #43
  • Fix binding types - #45
  • update to Deno 1.18.2 - #47

0.2-alpha.1

21 Oct 16:16
Compare
Choose a tag to compare

deno_sdl2 0.2-alpha.1

What's Changed

  • update example package import url by @QuentinGruber in #30
  • Add sprite example by @hashrock in #33
  • add dino deno example by @dhairy-online in #34
  • update dino example submodule by @dhairy-online in #35
  • chore: add more documentation by @dhairy-online in #36
  • BREAKING: use FFI by @littledivy in #37

The new FFI migration improves performance and streamlines the release process. Frequent crashes while rendering several entities is also fixed.

New Contributors

Full Changelog: 0.1-alpha.6...0.2-alpha.1

0.1-alpha.6

25 Aug 15:52
Compare
Choose a tag to compare

Major changes:

  • feat(renderFont): auto detect font width and height when None (#26)
  • chore: add documentation (#27)
  • async iterator based API (#28)

0.1-alpha.5

23 Aug 16:40
Compare
Choose a tag to compare
  • fix: don't use meta-address 0.0.0.0 (#19)
  • feat: use rodio instead of sdl2-mixer (#22)

0.1-alpha.4

23 Aug 04:46
Compare
Choose a tag to compare
  • fix: massive memory leak after quit (#14)

Calling canvas.quit() would still continue the event loop...saturating the task buffer causing a leak.

  • feat: load image surface (#16)
// png or jpeg
// for bitmap, use canvas.loadBitmap("player.bmp")
const surface = canvas.loadSurface("player.png");
const texture = canvas.createTextureFromSurface(surface);

0.1-alpha.3

22 Aug 14:19
dc05047
Compare
Choose a tag to compare
  • Fixes mpg123 builds on Linux and Darwin.
  • Drops support for MP3 on Windows. See issue #11

0.1-alpha.2

21 Aug 16:15
Compare
Choose a tag to compare

Includes fixes for alpha.1

  • Open O_CREATE|O_TRUNC asset in executable mode
  • s/deno_sdl/deno_sdl2
  • Correct asset names in Linux and Darwin
  • Download asset once
  • Fix executable name in Deno.run