Initial Video, Render, and Properties implementations.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
BadQuanta
2026-04-26 14:39:01 +00:00
parent 6d0de7e621
commit 85dbe33a77
17 changed files with 2461 additions and 50 deletions
+28
View File
@@ -0,0 +1,28 @@
#include <doctest/doctest.h>
#include <hdk/sdl/video/Surface.hpp>
TEST_CASE("Surface bindings are exercised") {
auto surface = hdk::sdl::Surface::Create(10, 10, SDL_PIXELFORMAT_RGBA8888);
REQUIRE(surface);
CHECK(surface->w == 10);
CHECK(surface->h == 10);
CHECK(surface->format == SDL_PIXELFORMAT_RGBA8888);
surface.Clear(1.0f, 0.0f, 0.0f, 1.0f);
Uint8 r, g, b, a;
CHECK(surface.ReadPixel(0, 0, &r, &g, &b, &a));
CHECK(r == 255);
CHECK(g == 0);
CHECK(b == 0);
CHECK(a == 255);
auto scaled = surface.Scale(20, 20, SDL_ScaleMode::SDL_SCALEMODE_LINEAR);
REQUIRE(scaled);
CHECK(scaled->w == 20);
CHECK(scaled->h == 20);
}