A host that owns its own window -- an embedded interpreter, which must not create one -- wants the six 2D function pointers without the window, the camera and the property registry that came with them. Until now the only options were to let libakgl own the window or to assign the vtable by hand. akgl_render_bind2d() installs the methods and nothing else, deliberately leaving self->sdl_renderer alone so a caller's own renderer survives it and a caller without one gets a backend that reports AKERR_NULLPOINTER rather than crashing. akgl_render_init2d() calls it once its window exists. tests/renderer.c is new and needs no display: the binding, frame start and end, both draw_texture paths and the draw_mesh stub against a software renderer under the dummy video driver. src/renderer.c goes from 10% line coverage to 56%. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
11 KiB
11 KiB