This commit is contained in:
2026-01-21 09:05:02 -06:00
parent 18ca9e14ba
commit f7be9c3344
30 changed files with 237 additions and 246 deletions

View File

@@ -2,7 +2,7 @@
var Surface = use('sdl3/surface');
// Test creating a surface
var surf = new Surface({width: 100, height: 100});
var surf = Surface({width: 100, height: 100});
log.console("Created surface:", surf.width, "x", surf.height);
log.console(surf)
@@ -26,12 +26,12 @@ var pixels = surf.pixels();
log.console("Got pixels array buffer, length:", pixels.byteLength);
// Test creating surface with custom format
var surf4 = new Surface({width: 64, height: 64, format: "rgb24"});
var surf4 = Surface({width: 64, height: 64, format: "rgb24"});
log.console("Created RGB24 surface:", surf4.width, "x", surf4.height, "format:", surf4.format);
// Test creating surface from pixels
var pixelData = new ArrayBuffer(32 * 32 * 4); // 32x32 RGBA
var surf5 = new Surface({width: 32, height: 32, pixels: pixelData});
var pixelData = ArrayBuffer(32 * 32 * 4); // 32x32 RGBA
var surf5 = Surface({width: 32, height: 32, pixels: pixelData});
log.console("Created surface from pixels:", surf5.width, "x", surf5.height);
log.console("Surface module test passed!");