I am stunned by slow FPS

Started by
6 comments, last by Pipo DeClown 19 years, 8 months ago
I have just tried to draw four images into DirectDrawSurface and already get FPS of 30.
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
Advertisement
How big are the images? Are they stored in video memory? How are you creating the surface?

30 fps seems a bit slow for 4 images, even if they're screen-sized, but remember that your screen is 1 million pixels, and a typical graphics card fillrate is about 1 billion pixels/sec, so drawing a large image isn't exactly free.
A while ago NVidia stopped accelerating DirectDraw. I don't know whether they started again.
Even if I dont do the drawing to the direct draw surface but only do this:

pPointer = pSourceX->pElements.CreateLinkedListPointer ();
Color=Render.GetTriangleColor (
(this->pTrianglesList->operator [] (pPointer.Peek().TriangleNum)), Point2D ((Real)KeepPosX+0.5, (Real)(LineY+StartY)+0.5)
);
PixelsAmount = pPointer.Peek().PixelsAmount;
pPointer.Step();


RGBColor
RenderRedSimple::GetTriangleColor (Mesh3DCalcTriangle & Triangle, Point2D Pos)
{
RGBColor color;

color.Red = (BYTE)(Triangle.Vz*(double)0xff);
color.Green = 0;
color.Blue = 0;

return color;
}

4*80*135 times I get an FPS of 50.
I am suprised that this is the limitation of the cpu.
I thought it could do a lot more calculations
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
Don't blame the CPU for your mistakes.
Each time you're accessing the videomemory you're locking it up for everything else. The proper way of doing what you're doing is to lock the entire surface, and treat it as an array or a matrix while doing all the reading/writing to it in one go. Not locking/unlocking it for every pixel as you're doing.
And what's this linked-list business? What good is it supposed to do?
Where did you see I was locking here the surface?
I lock the surface only once for each screen I draw.
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
You should only lock the surfaces once per frame, nothing more, nothing less.
You also need to make sure your surfaces are in video memory. Then you should see a bit more than 30 FPS.
JRA GameDev Website//Bad Maniac
Quote:Original post by Bad Maniac
You should only lock the surfaces once per frame, nothing more, nothing less.
You also need to make sure your surfaces are in video memory. Then you should see a bit more than 30 FPS.

Second.

This topic is closed to new replies.

Advertisement