CSFML icon indicating copy to clipboard operation
CSFML copied to clipboard

Use inheritance to implement wrapper struct types

Open ChrisThrasher opened this issue 1 year ago • 2 comments

We can save code and remove the ugly This parameter if we instead inherit from sf:: types.

Here's an example: https://github.com/SFML/CSFML/compare/master...simplify_sf_buffer

ChrisThrasher avatar Dec 29 '23 06:12 ChrisThrasher

Does this really work, i.e. is that type not part of the public C interface?

eXpl0it3r avatar Dec 29 '23 17:12 eXpl0it3r

The C interface doesn’t know anything about how the type is defined. That’s why we’re allowed to do this.

ChrisThrasher avatar Dec 29 '23 17:12 ChrisThrasher