logoalt Hacker News

win311fwglast Friday at 4:12 PM1 replyview on HN

You're right to call out that the SDLRenderer name was a poor choice. SDL is an implementation detail that should be completely hidden from the user of the API. That it may or may not use SDL under the hood is irrelevant to the user of the API. If the user wanted to use SDL, they would do so directly. The whole point of this kind of abstraction, of course, is to decouple of the dependence on something like SDL. Point taken.

Aside from my failure in dealing with the hardest problem in computer science, how would you improve the intent of the API? It is clearly improved over the original version, but we would do well to iterate towards something even better.


Replies

mort96last Friday at 4:14 PM

I think the most obvious improvement would be: just make it a free function which returns a surface, text rendering is slow and allocation is fast

show 1 reply