toaruos icon indicating copy to clipboard operation
toaruos copied to clipboard

Fixup the graphics library API

Open klange opened this issue 2 years ago • 3 comments

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_fullscreengfx_init_fullscreen()
    • alpha_blendgfx_alpha_blend, etc.
    • flipgfx_context_flip
    • draw_*gfx_draw_*
  • Use longer macro names, GFX()GFX_CTX_PIXEL(), SPRITE()GFX_SPRITE_PIXEL(), etc.
  • Rename sprite_tgfx_sprite_t

klange avatar Aug 17 '21 01:08 klange

The published SDL package for 2.x references flip and some init_graphics_... functions, so it will need to be updated.

klange avatar Aug 17 '21 06:08 klange

If this is still open, Can i start looking into it? @klange

akshataj96 avatar Jun 10 '23 00:06 akshataj96

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.

klange avatar Jun 10 '23 02:06 klange