Every shape was its own SDL_RenderGeometry call, and Kasaival draws about 4,500 a frame. SDL merges them into few GPU draws, but its validation, vertex copy and command upkeep per call dominated frames on phones. Shapes that share a texture and blend mode now queue and go to SDL as one call. Anything that draws otherwise, switches the target or clip, changes or frees a queued texture, or reads the frame flushes the queue first. Each shape is still checked as SDL checks a call, so a bad one drops alone.
3.0 KiB
Changelog
[Unreleased]
-
Game2D/Sdlqueues shapes and pictures that share a texture and blend mode and sends each run to SDL as one geometry call: Kasaival's frames went from about 4,500 SDL calls to a few dozen. -
Game2D/Sdlno longer spins waiting for the target frame rate when vsync already presents at that rate. -
Game2D/Sdlruns on Android under SDL2's activity (PLATFORM_ANDROID):InitWindow(0, 0)fills the display, pictures decode as PNG in Ziran and text draws with FreeType. -
Game2D/Sdldraws its text with FreeType on Windows and Android (sdl_text_freetype), in the system's sans-serif face or the font fileGAME2D_FONTnames, so a static Windows build needs no Pango or Cairo. -
Game2D/Sdlbuilds for the browser (PLATFORM_WEBwith Emscripten's SDL2 port and Ziran'sweb/ziran_web.js): PNG pictures decode in Ziran, text draws on the page's canvas (sdl_text_web), the browser paces frames, and WebAudio starts with the first key or button press. The desktop text moved tosdl_text_pango.mallocandmemcpytakesize_t, so wasm32 builds no longer trap on their first allocation. A page linked with--use-preload-pluginsreads the pictures the browser decoded beforemain, so large sprite sets load without blocking the page. -
Game2D/Sdldraws its text with Pango and Cairo itself (sdl_text) instead of importing Kryon's Cairo window raster, so a game that paints Kryon widgets through its ownRaster*calls links without duplicate symbols, and games no longer carry Kryon's window raster. -
Game2D/Sdlreads gamepads (IsGamepadAvailable,IsGamepadButtonDown,IsGamepadButtonPressed,GetGamepadAxisMovement), toggles a fullscreen that scales the game at its own size, sets the window icon and its resizable state (SetWindowState), and loads pictures (LoadImage, PNG bytes withLoadImageFromMemory,GenImageColor) and music from bytes (LoadMusicStreamFromMemory). -
Game2D/SdlreplacesRaylibandRaylibNull: games open an SDL2 window drawn by SDL's renderer, with the same window, drawing, texture, render-target, text, input, timing and audio calls, on Kryon's picture decoding and text and Ziran's core audio.SetFixedFrameTimesteps headless runs deterministically. Games that ship Ogg Vorbis or MP3 importstd/audio_decode_vorbisorstd/audio_decode_mp3and link that codec. -
Use Kryon's public widget modules in shared controls so export-enforced native and portable consumers build cleanly.
-
Built on Kryon b9aed758, the Kryon the CSS style package installs into.
-
Preserve the surrounding game theme when nested controls finish drawing.
-
Swipe steering exposes accepted-step and tap events separately from retained direction.
-
A floating touch stick steers in any direction and shows a high-contrast anchor, finger and heading while held.
-
Games can share title, pause, settings and movement-control navigation across native and portable hosts.
-
A reusable swipe/direction-pad chooser supports continuous touch steering and changing controls during a paused game.