toaruos
toaruos copied to clipboard
Fixup the graphics library API
The graphics library exports symbols without any prefix, leading to some problematically short names and a lack of uniformity. Functions like flip or rgb/rgba absolutely need some prefixing. The headers also include a number of problematic macros.
Thoughts:
- Prefix all the export symbols with
gfx_.init_graphics_fullscreen→gfx_init_fullscreen()alpha_blend→gfx_alpha_blend, etc.flip→gfx_context_flipdraw_*→gfx_draw_*
- Use longer macro names,
GFX()→GFX_CTX_PIXEL(),SPRITE()→GFX_SPRITE_PIXEL(), etc. - Rename
sprite_t→gfx_sprite_t
The published SDL package for 2.x references flip and some init_graphics_... functions, so it will need to be updated.
If this is still open, Can i start looking into it? @klange
This is not the sort of thing I would normally accept a pull request for, and it is not practical for an external contributor anyway - much of the work here will be making changes to parches for ported third-party software (SDL, etc.), as well as repackaging it and updating the CDN.