Archived

This topic is now archived and is closed to further replies.

Low FPS!!

This topic is 5704 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
quote:
Original post by benjamin bunny
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.



What do you mean ? Direct Draw is 'accelerated' on any graphicscard, but OpenGL is only accelerated on '3D' graphics cards ? I'm sorry to say it's basically bullshit. DirectDraw or Direct3D has no edge over OpenGL whatsoever. You're actually implying D3D/DirectDraw has some kind of 'edge' over OpenGL when it's not simply true...


2D!Now

[edited by - llyod on May 3, 2002 10:21:48 PM]

Share this post


Link to post
Share on other sites
Wrong. What benjamin bunny said is perfectly true.
There are many older cards which offer hardware accelerated DirectDraw, but do not support OpenGL (an example is the Trident 3dImage 975 which was originally in my PII 300). Because these cards do not support OpenGL, all OpenGL operations must be performed in software. This is far slower than 2d with DirectDraw.

Share this post


Link to post
Share on other sites
Don''t try to start a flame war where none exists. What he said is pretty much accurate, since older video cards (i.e. ones with no 3D support) often have DirectDraw support, but no OpenGL ICD (or MCD, even). So on these cards, an OpenGL program will be pure software, since there is literally no way for it to access the video card.

Share this post


Link to post
Share on other sites

I''m not at all trying to start a flamewar, I''m just being disappointed with the implication that somehow D3D/DD is ''better'' than OpenGL, when this is actually not true in most circumstances - I agree I was wrong on this particular fact, but I strongly disagree that you''ll choose one API over the other over this insignificant issue.




2D!Now

Share this post


Link to post
Share on other sites
quote:
Original post by llyod
I'm not at all trying to start a flamewar, I'm just being disappointed with the implication that somehow D3D/DD is 'better' than OpenGL,

I'm surprised that you think that benjamin bunny or myself would imply that D3D/DD is better than OpenGL, given that we are both known OpenGL advocates. Unless you were refering to andrew programmer's post?
quote:
Original post by llyod
I strongly disagree that you'll choose one API over the other over this insignificant issue.

True, but in this particular case, unless he wants to upgrade his video card (which I'd recommend regardless), DDraw looks like the only choice. I can't imagine trying to learn graphics/game programming when even a simple app won't run at a bearable framerate.

Share this post


Link to post
Share on other sites
llyod, DirectDraw is a *2D* ONLY api. it is accelerated on nearly all video cards that are supported under windows. even those that support the minium (ie video blits and direct access to vram). it is FAR better then opengl on a *2D* ONLY video card that cant accelerate 3D graphics. opengl is a *3D* graphics api, and thus requires a 3D sccelerator to be of any use in realtime games. D3D is in the same boat as opengl, where software rendering on a 2D only card is worthless. openGL/D3D are meant to be used on 3D accelerators. DirectDraw is for ANY video card, and is useful for 2d games, or custom 3d software rasterizers.

if opengl is not supported by your card, then you will pick the api that is. i really think some ppl need to learn that you should use the right tool for the job, and what works for you. the FACT that opengl/D3D is utterly useless on any 2d only video card is pretty significent when you dont have a 3d card. many older cards (voodoo2) have crap opengl drivers, and work much better with direct3d.

i would never allow someone to painfully code a opengl app for a 2d game using a non accelerated card. its utter madness.
in fact i would NEVER use opengl for ANY per pixel direct vram access, just like i would not use D3D. i would use the gdi or directdraw (if i need fullscreen support).

there was no iplication that directdraw was better. and d3d was never even mentioned in this thread before you. please understand directdraw and direct3d are two entirly different apis. would you tell him to use opengl instead of directsound? of course not, opengl does not handle sound, only *3D* graphics. its a *3D* graphics api after all. this dont make it worse at what it does. directx is a combination of apis. d3d and directdraw are just a part of it like directsound.

could someone please add to the faq (excuse me if its not there) the differences of opengl and directx? its quite stupid when ppl blindly think that opengl can do everything that directx does. even worse is when they start comparing opengl to directx. you cant do that. only thing opengl can be compared to is direct3d since that is the 3d api portion of directx.

the only reason i went so far with this post is because he as a link to a 2d game development forum, and i find it quiet said he dont know the difference between direct3d and directdraw.

Share this post


Link to post
Share on other sites
llyod:

I never once mentioned D3D, but I'm thinking about learning D3D and evangelising about it just to piss you off .

____________________________________________________________
www.elf-stone.com

[edited by - benjamin bunny on May 3, 2002 11:36:53 PM]

[edited by - benjamin bunny on May 3, 2002 12:04:22 AM]

Share this post


Link to post
Share on other sites