SFML community forums

General => Feature requests => Topic started by: MrDoomMaster on January 25, 2008, 11:22:36 pm

Title: Suggestions for architecture improvements
Post by: MrDoomMaster on January 25, 2008, 11:22:36 pm
For the platform implementation classes, is there any reason why you're not using CRTP? The virtual functions seem unnecessary.

The name sf::RenderWindow::Display() seems a bit weird to me, how about something like FlipBuffers() or SwapBuffers()?

The latter suggestion isn't as important as the first. I'd appreciate any feedback. Thank you!

::EDIT::

I have more suggestions after having looked through the source a bit more:

- Provide the user the ability to specify depth and stencil bit depths, preferably through the VideoMode object. Currently these values are hard-coded.
Title: Suggestions for architecture improvements
Post by: Laurent on January 26, 2008, 04:57:34 am
Quote
For the platform implementation classes, is there any reason why you're not using CRTP? The virtual functions seem unnecessary.

Are you talking about sf::WindowImpl ? It's the only class using virtual functions to implement system-specific code.

Quote
The name sf::RenderWindow::Display() seems a bit weird to me, how about something like FlipBuffers() or SwapBuffers()?

To me, FlipBuffers() is the weird one. Why would a beginner have to know that there are internally two buffers, and that to display its drawing on screen he has to flip them, and so call a FlipBuffers() function ?
When you want to display, call Display(). Simple. I think FlipBuffers() is only meaningful for us, low-level graphics programmers.

Quote
- Provide the user the ability to specify depth and stencil bit depths, preferably through the VideoMode object. Currently these values are hard-coded.

Yep, that will be part of a more generic configuration option when creating windows.
Title: Suggestions for architecture improvements
Post by: MrDoomMaster on January 28, 2008, 06:22:07 pm
Yes, I am talking about sf::WindowImpl. Was there a reason to use virtual functions instead of CRTP?

I do agree with your statement on the Display() function. I tend to think of backbuffers as 'swappable', however this may not always be the case. Now that I understand your intended meaning behind the function name, I have no problem with it :)

Thank you for your feedback. You have a great library! I was looking for an alternative to SDL for a long time.

Keep up the great work.
Title: Suggestions for architecture improvements
Post by: Laurent on January 29, 2008, 02:31:19 am
Quote
Yes, I am talking about sf::WindowImpl. Was there a reason to use virtual functions instead of CRTP?

I decided to use a base class in this case, mainly to gather all the common code. So.. yes, maybe CRTP could do the job as well :)

Thanks for the hint.