Jump to content
  • Advertisement

Archived

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

Astral

One fullscreen blit in 800x600x32 -> 20 fps :(

This topic is 6712 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

Hiya, i am programming a 2d game using direct draw that always has the same background image. Its running in 800x600x32 so that all my (planned) effects work right and the pic / sprites look like they should. As my next frame to be shown ist rendered in a backbuffer located in vid mem and my bitmap image surface is also located in vid mem, i am doing a full screen blit from the bitmap surface to the backbuffer using the BltFast function. As i understand it this is a vid mem to vid mem transfer and it should be quiet fast. But ..it isnt. Even when having everything else that belongs to the game disabled so that this DrawBackground() is the only function in my gameloop i still get only about 28 fps. Anyone got an ideas what is wrong or how i can make it faster ? Please help me as i am stuck in the development process of my game unless i can at least get 50 better 85+ fps. cya Astral

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
what kind of hardware do you have?

Share this post


Link to post
Share on other sites
Its possible, but probably unlikely, that your video card does not support blitting in 32bit mode (but this would be very much rediculous nowadays)

Its also possible that you may have a memory leak somewhere. Try blitting an image that is not fullscreen size (700 x 500) and see if that blits faster. If it does, your image size is bigger then the screen size, and typically Direct X doesn''t like that...

Hope that helps....



Demetrios Georgeadis
Director/Programmer
Oniera Software Artists
www.oniera.com

Share this post


Link to post
Share on other sites
are you certain it''s all in video memory?
i''m sure you requested it to all be in video memory.. but....
the primary buffer only will take up 800 * 600 * 4 = 1,920,000 bytes, which is about 1.8 megs (the 4 is 4 bytes per pixel, 32 bits). add the backbuffer to that, and you''ve got about 3.6 megs.. and if the background image is the same size and color depth (which i''m assuming it is), that makes it about 5.5 megs.. do you have that much video memory? when you run out, the program won''t crash, it''ll just use system memory, and a system to video copy will take more time..

or maybe i''m wrong and it''s something else...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try setting the correct Height and Width of the bitmap. When I forgot that, my program slowed down from 70+ fps to 30 fps. Try it.

Share this post


Link to post
Share on other sites
hiya,

thanks for trying to help ! Unfortunately nothing you mentioned before seems to be the cause of my problem...ah well i dont know enough about the 32 bit capabilities of my card but that shouldnt be the problem. First of all blitting my image into / from a smaller rect doesnt cure anything. Then, yes i am sure that all buffers are located in video memory (well kind of) because my display adapter, namely a matrox mystique 220 with 8mb, really should have enough ram left. Ah btw i tried it on a machine from one of my friends. It has 100mhz more cpu power and a geforce gfx card (32 mb vid mem and he got 36 fps So its not my equipment ..it must have to do with the code.
Hase anyone ever programmed something in 2d with a background image that has to be blit-ed once per frame ?? Or probably there is another work arround. Please help !!

cya and thanks for every advise you can give
Astral

Share this post


Link to post
Share on other sites
Isn''there a tutorial with DX7 in Direct draw (Tutorial 5 or so, a checkboard as a background, with 3 rotating donuts in the foreground) which should help you out ?

Share this post


Link to post
Share on other sites
You really shouldn''t blow this kind of thing off and say "Oh well, I''ll just use 16bit...", because if it is making a GeoForce crawl, something isn''t right and it will likely become more prominent as you draw more to the screen.

So, can we see a few code snippets? That may well help...

-> Briar LoDeran <-

Share this post


Link to post
Share on other sites
Strange...
I use 1280x1024x32 mode, and i use Direct3D (with ZBuffer) and I get around 40fps, and when i switch to 16bpp I get over 60 fps... And my machine is not high end (P2-333, TNT-1 16MB).
Are you rely sure, that all your sufraces are in video memory (created with DDSCAPS_VIDEOMEMORY flag)??

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!