Jump to content
  • Advertisement

Archived

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

stranger4u

DirectDraw Blt slowing down windows?

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

Hi there, I''m using lpDDSFrontBuffer->Blt( &rcWindow, lpDDSBackBuffer, NULL, DDBLT_WAIT, NULL ); to blit the backbuffer into the frontbuffer of my windowed game. But that slows down windows. When I move the mouse cursor it''s jumping around. How is that possible? I just call the above Funktion in the main game loop. Do I call it too often?

Share this post


Link to post
Share on other sites
Advertisement
More information:

I rewrote my application to use ddutil.h for all the DirectDraw stuff. But the problem remains. Mouse is jumping, windows slows down. I still don''t understand why.

Share this post


Link to post
Share on other sites
Why do you need to blit the backbuffer to your front buffer? Why not just call

lpDDSFrontBuffer->Flip(NULL,DDFLIP_WAIT);

that flips the backbuffer to the front buffer (presuming you got your backbuffer as an attached surface of lpDDSFrontBuffer)

If you have any more problems post your code that you use for setting up directdraw.

=*=
If things seem bad, think that they can get a whole load worse, and they don''t seem so bad anymore

=*=

Share this post


Link to post
Share on other sites
Because he''s in window-ed mode, and you can''t do page-flipping in window-ed mode!!

I''m doing something that runs in window-ed mode, I''d be interested to find out if you find what is causing this problem. How many frame per second are you getting btw??

JJ.

Share this post


Link to post
Share on other sites
I can''t flip because I''m not using full screen mode. It''s just a window in which I''d like to draw. It works, but the slowdown is very weird.

The code I use is:

Display.Clear(0);
Display.Blt( 0, 0, SurfaceNormalBlocks, 0);
Display.Present();

Display is of the type CDisplay (from ddutil.h), SurfaceNormalBlocks contains just a bitmap that I want to display on the screen.

The code works fine, the bitmap gets drawn, but still the slowdown occurs.

Share this post


Link to post
Share on other sites
I think your app slows windows down because you did not include a framerate limit or do not render only on WM_PAINT.
At least I had this kind of problem.

Share this post


Link to post
Share on other sites
quote:
Original post by Jiim
Because he''s in window-ed mode, and you can''t do page-flipping in window-ed mode!!

I''m doing something that runs in window-ed mode, I''d be interested to find out if you find what is causing this problem. How many frame per second are you getting btw??

JJ.


I don''t know, I don''t calculate the fps. This is my first game anyways so right now I''m just trying get something on screen. And that works.. If I manage to get rid of the slowdown everything is alright. IF.

Share this post


Link to post
Share on other sites
quote:
Original post by Hippokrates
I think your app slows windows down because you did not include a framerate limit or do not render only on WM_PAINT.
At least I had this kind of problem.


That sounds interesting. No I don''t have a limit, I just Blit everytime the mainloop is running. So that''s causing the slowdown? Really interesting, will try to limit it. Thanks.

Share this post


Link to post
Share on other sites
I had a similar problem when my main loop wasn''t taking long enough and was able to solve the problem by inserting Sleep(0); at the end of my main loop which gives windows a chance to update the mouse.

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!