the vglTriangleLine() function which draws the pixels takes the very most time.
and i tried to make example code:
Code:
#include <time.h>
#include <iostream>
using namespace std;
#define USE_FIXINT // comment this out if you want float instead of fixpoints
#ifdef USE_FIXINT
typedef __int32 fixint;
#else
typedef float fixint;
#endif
int main()
{
int clo = clock();
fixint x = 10, y = 2;
for (int i = 0; i < 100000000; i++)
{
x *= y;
}
cout << (clock() - clo) << endl;
cin.get();
return 0;
}
i tested this on my x86 machine. using fixpoints: 360 ms, using floats: 12500 ms. i haven't tested it on my x64 machine yet, tho.
edit: i asked a friend, he said that my other machine propably has a FPU (floating processing unit) which can process floats faster than i can process fixed ints. can this be true?