Jump to content
  • Advertisement

Archived

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

PowerBoyAlfa

DD Windowed Freezes App

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

I will try to give you as much solid information on this problem as I can without writing my entire program code here. I have an app that switches between windowed Direct Draw mode and exclusive full screen mode. If I start the program in full screen mode, the program works great. But if I start the program in windowed mode, every thing works until I try to blit to the backbuffer or primary surface. This seems strange to me, because the code is essentially the same as full screen mode except for the primary surface allocation and blitting. The funny thing is it will blit once through the loop then freeze, so I get an accurate blit to the backbuffer and an accurate blit from the backbuffer to the front buffer, then the next time through the loop it freezes. I have checked my clipping rects and they are fine, otherwise it would freeze on the first pass. I was wondering has this happened to anybody else before. Image is 800X600 16bpp (custom format) Fullscreen is set to 800X600 16bpp BackBuffer in windowed mode is set to 800X600 fullscreen mode:
  1. Initialize Direct Draw object
  2. Set cooperative level to exclusive
  3. Create Primary Surface with complex/flip/primary/videomemory flags
  4. Attach Back Buffer with backbuffer count of 1
  5. Blit image to backbuffer
  6. Use the primary->flip() to display image
Windowed Mode:
  1. Initialize Direct Draw object
  2. Set cooperative mode to normal
  3. Create Primary Surface with primary/videomemory flags no size caps
  4. Create Back Buffer with offscreen/videomemory flags plus size caps
  5. Create clipper
  6. Set clipper window handle
  7. Use primary->SetClipper(clipper)
  8. Get Screen coords of client window
  9. Blit Image to back buffer
  10. Blit back buffer to primary using client coords
if I leave out steps 9 and 10, there is no freezing. If I Leave out step 9, it freezes after the first loop (and of course nothing is displayed). If I do everything in the list, It displays in the window perfectly the first time through the loop then freezes. I was just curious if this has happend to anybody else so they could tell me what they discovered. I must have one tiny mistake somewhere that I am not catching, which makes me want to rip my hair out because I don''t want to rewrite the whole thing to figure out what I did wrong!

Share this post


Link to post
Share on other sites
Advertisement

  • 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!