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

Author Topic: SFML Precision (C++)  (Read 3413 times)

0 Members and 1 Guest are viewing this topic.

__fastcall

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML Precision (C++)
« on: September 28, 2008, 12:07:30 am »
Is there any significant reason SFML uses floats instead of doubles?  I know that OpenGL API likes to use floats, but if doubles are as fast as floats, why not use doubles and pick up some extra precision?  :D

EDIT:
After searching the forums and reading this topic, I've concluded that a temporary solution would be to derive my own double-precision sprite class.  But the question remains, why use floats?

r1nux

  • Newbie
  • *
  • Posts: 9
    • View Profile
SFML Precision (C++)
« Reply #1 on: September 28, 2008, 01:11:31 am »
Does one really need this precision for sprite-placement-management and such?

And I guess that one argument against using doubles instead fo float is
the size where float takes up 4 bytes and doubles uses 8 bytes.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML Precision (C++)
« Reply #2 on: September 28, 2008, 10:03:45 am »
Doubles are (generally) slower, use more memory, will need conversions because GPUs only understand floats, and most of all, are completely useless in this context.

You'll never see any graphics API using doubles.
Laurent Gomila - SFML developer

 

anything