Low FPS!!

Started by
16 comments, last by branhield 21 years, 11 months ago
how come i get lower FPS in my application that loads 3 bitmaps and move them around on the screen than i do in games like Age of Empires or whatever...
Advertisement

There can be lots of resaons why you get low fps.

If you use simple GDI then results ain''t too good, but with DirectX you should get quite high fps. And it shouldn''t depend on how big are the pictures when you only have 3.

I guess there is something else wrong in the app or FPS counter is just faulty.
Toomas008 said, there are a load of reasons why you could be getting a low fps. I am assuming you are using OpenGL to display your bitmaps, since you posted this in the OpenGL forum...(textured quads/pixmaps?)

Here are a few possibilities I can think of...

1. Dodgy FPS counter: using GDI text for your frame counter is slow. Use bitmap or texture fonts. Also, you should really be using QueryPerformanceCounter() for your timer. Do not under any circumstances use the windows timer (the one which sends WM_TIMER messages) it is as slow as hell.

2. Bad Renderloop structure: If your OpenGL rendering code is in your WM_PAINT handler, and you are using InvalidateRect() or some similar method to force redraws, you will always have a crap frame rate. The windows message queue is slow - keep your rendering loop outside it.

3. Unnecessary state changes: are you changing OpenGL state more than you have to? Some state changes are slower than others, but ideally you want to minimize them as much as possible, perhaps by sorting your objects in a suitable manner.

4. Doing something stupid: It could just be that you are doing something silly somewhere in your code - like reloading your bitmaps from the file every frame. Given that you are only drawing three bitmaps and still getting a terrible frame rate, I would imagine that something like this is going on. You really want to have as little code as possible being called between frames.

[edited by - Sandman on May 3, 2002 7:37:54 AM]


Or, your GL is simply not hardware accelerated...

2D!Now
well its not hardware accelerated, im on a 166mhz 32 mbram...but still..im able to play age of empires and that kinda games at way higer fps rates than i run my simple application at..
What''s your videocard ?
dont think i have one..lol..nah but something like 4mb maybe..dont know name
OpenGL does not works fine with 2D graphics. Use DirectDraw, the same API used in Age Of Empires

[edited by - andrew programmer on May 3, 2002 2:29:06 PM]
Andrew Programmer;)
To elaborate, Direct Draw will be accelerated on almost any 2D card. OpenGL can will only be accelerated if you have a 3D card, otherwise it''ll revert to software, which is slow as hell. You can use it for 2D, but you''ll need a 3D card.

____________________________________________________________
www.elf-stone.com

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

alright thx guys

This topic is closed to new replies.

Advertisement