Bot releases are visible (Hide)
Happy new year 2023!
Published by littledivy over 2 years ago
deno_sdl2
0.5deno_sdl2 provides cross-platform bindings to sdl2, sdl2_ttf and sdl2_image.
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
Published by github-actions[bot] over 2 years ago
deno_sdl2
0.3.1Regenerated bindings/bindings.ts
to fetch binary from releases.
Published by github-actions[bot] over 2 years ago
deno_sdl2
0.3.0Published by github-actions[bot] about 3 years ago
deno_sdl2
0.2-alpha.1The new FFI migration improves performance and streamlines the release process. Frequent crashes while rendering several entities is also fixed.
Full Changelog: https://github.com/littledivy/deno_sdl2/compare/0.1-alpha.6...0.2-alpha.1
Published by github-actions[bot] about 3 years ago
Major changes:
Published by github-actions[bot] about 3 years ago
Published by github-actions[bot] about 3 years ago
Calling canvas.quit()
would still continue the event loop...saturating the task buffer causing a leak.
// png or jpeg
// for bitmap, use canvas.loadBitmap("player.bmp")
const surface = canvas.loadSurface("player.png");
const texture = canvas.createTextureFromSurface(surface);
Published by github-actions[bot] about 3 years ago
Published by github-actions[bot] about 3 years ago
Includes fixes for alpha.1
Deno.run
Published by github-actions[bot] about 3 years ago
Initial alpha release for deno_sdl2
for (integration) testing purposes.