Direct X vector question
Apr 4, 2012 at 9:09pm UTC
I recently got a new book on programming with direct x. While I was reading through the chapter about vectors, I found this line in the sample code, which creates a vector:
1 2
//Using constructor, D3DXVECTOR3 (FLOAT x, FLOAT y, FLOAT z)
D3DXVECTOR3 u(1.0f, 2.0f, 3.0f);
What I wanted to know is: What does the 'f' that goes with the values passed to the constructor mean?
(Forgive me if this is a noob question)
Thanks
Apr 4, 2012 at 9:16pm UTC
It's to signify the constant value as a Float rather than a double.
1 2 3 4
float a = 1.0; // truncation warning double to float
float b = 1.0f; // no warning
double c = 1.0; // no warning
Apr 5, 2012 at 7:04am UTC
Ah, ok thanks a lot.
Topic archived. No new replies allowed.