SFML community forums

Help => Graphics => Topic started by: gsaurus on March 13, 2010, 12:56:47 pm

Title: Graphics\Rect.hpp - package location
Post by: gsaurus on March 13, 2010, 12:56:47 pm
I think Rect should be part of the System package instead. It's an utility like Vector2/3 (and like other shapes and geometric concepts that I guess will come on SFML2, independent of the drawing stuff).

I'm using a model-view-controller approach, I use Rect on my model but I would like to keep model not linking to sfml-graphics  :wink:
Title: Graphics\Rect.hpp - package location
Post by: Laurent on March 13, 2010, 04:39:12 pm
You don't have to link to sfml-graphics, sf::Rect is a template so its code is entirely included (nothing is compiled in sfml-graphics) :D
Title: Graphics\Rect.hpp - package location
Post by: gsaurus on March 13, 2010, 07:33:34 pm
oh, I forgot that  :lol:
I still think it makes more sense under System folder, but in practice it's irrelevant  :wink:
Title: Graphics\Rect.hpp - package location
Post by: Laurent on March 13, 2010, 07:41:04 pm
Quote
I still think it makes more sense under System folder

I'm not sure, it's really related to the graphics module. In my opinion Vector2 would also be better in the graphics module, but it is too close to Vector3 which is used in the audio module, so I chose to gather them in the same module.
Title: Graphics\Rect.hpp - package location
Post by: gsaurus on March 13, 2010, 08:35:38 pm
Well, it's related to Graphics on SFML, but users can use it for several purposes. Shapes and vectors are math concepts independent from display concepts, it's all about geometry.
For SFML and probably most applications using it, it isn't needed outside graphics stuff. But I use vector2 and 3 for everything on my logics that needs vectors, and may use other shapes (polygons will be of great use) in case you make them independent from drawable.
I understand that it's not the main purpose of them, but since it's there, and since they don't rely on graphics, they can be used outside for the most varied purposes.
Title: Graphics\Rect.hpp - package location
Post by: Laurent on March 13, 2010, 08:53:50 pm
I understand your point of view. I'll think about it later, I have some modifications to make to Rect and Vector classes anyway ;)
Title: Graphics\Rect.hpp - package location
Post by: Tank on March 16, 2010, 10:07:06 am
Btw, is sf::Rect going to be modified to include Width/Height instead of Right/Bottom? (discussion happened weeks before)
Title: Graphics\Rect.hpp - package location
Post by: Laurent on March 16, 2010, 12:19:04 pm
I still don't know. This is an option that I'll consider.