Code: Select all
public void calcFrameRate()
{
frames++;
int ticks = Environment.TickCount;
int elapsed = ticks - lastTickCount;
if (elapsed >= 1000)
{
framerate = frames;
frames = 0;
lastTickCount = ticks;
}
}
public int getFrameRate()
{
return(framerate);
}
One problem I have is that I get horrid visual tearing when flying past textured terrain meshes. That, and my performance TANKS when they're being rendered. They're very low poly [probably no more than 100 polygons], textured with a 1024x1024 TGA format UV map. The starfield doesn't seem to harm the framerate too much - it's around 2000 polygons, each with no texture and each surface's emissive texture set to white.
Bear with me if I've said anything that should be obvious to you guys - this is my first stab at making anything more complicated than an ASP.NET web app.