Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Graphics\Rect.hpp - package location  (Read 3995 times)

0 Members and 1 Guest are viewing this topic.

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Graphics\Rect.hpp - package location
« 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:
Pluma - Plug-in Management Framework

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Graphics\Rect.hpp - package location
« Reply #1 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
Laurent Gomila - SFML developer

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Graphics\Rect.hpp - package location
« Reply #2 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:
Pluma - Plug-in Management Framework

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Graphics\Rect.hpp - package location
« Reply #3 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.
Laurent Gomila - SFML developer

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Graphics\Rect.hpp - package location
« Reply #4 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.
Pluma - Plug-in Management Framework

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Graphics\Rect.hpp - package location
« Reply #5 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 ;)
Laurent Gomila - SFML developer

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Graphics\Rect.hpp - package location
« Reply #6 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)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Graphics\Rect.hpp - package location
« Reply #7 on: March 16, 2010, 12:19:04 pm »
I still don't know. This is an option that I'll consider.
Laurent Gomila - SFML developer