SFML community forums

General => General discussions => Topic started by: lruc on August 11, 2008, 08:57:57 pm

Title: .hpp and floats
Post by: lruc 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.
Title: .hpp and floats
Post by: Daazku on August 11, 2008, 10:17:35 pm
hpp is common... Its the header for c++.....
Title: Re: .hpp and floats
Post by: quasius 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.
Title: .hpp and floats
Post by: Ankou 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.
Title: .hpp and floats
Post by: Kreeg on August 12, 2008, 12:04:20 am
OpenGL uses floats.