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

Author Topic: .hpp and floats  (Read 6730 times)

0 Members and 1 Guest are viewing this topic.

lruc

  • Newbie
  • *
  • Posts: 6
    • View Profile
.hpp and floats
« on: August 11, 2008, 08:57:57 pm »
Why does sfml use the extension .hpp? I have never before before seen that used. Also, not that I know a lot about floating-point math, but why does it use floats? It seems kind've standard in C++ to use doubles.

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
.hpp and floats
« Reply #1 on: August 11, 2008, 10:17:35 pm »
hpp is common... Its the header for c++.....
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Re: .hpp and floats
« Reply #2 on: August 11, 2008, 10:25:25 pm »
Quote from: "lruc"
Why does sfml use the extension .hpp? I have never before before seen that used. Also, not that I know a lot about floating-point math, but why does it use floats? It seems kind've standard in C++ to use doubles.


.h or .hpp are both C++ headers.  Double-precision math is much slower computationally and only take 4 bytes instead of 8.  Also graphics APIs are setup to deal with floats, not doubles.  Furthermore, double precision is rarely needed in graphics anyway.

Ankou

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
.hpp and floats
« Reply #3 on: August 11, 2008, 11:46:12 pm »
most people use .h(I think), but sfml is not the only lib which uses .hpp. Another (very popular) example would be boost.
However it doesn't matter which extension they have.

I think Float matters for vram, OpenGL and DirectX both use floats, so it wouldn't make sense that sfml takes doubles and then converts them.

Kreeg

  • Full Member
  • ***
  • Posts: 115
    • View Profile
.hpp and floats
« Reply #4 on: August 12, 2008, 12:04:20 am »
OpenGL uses floats.
Attention (va) aux (sur) messages (mon) subliminaux, (blog) camarade !