Advertisement

DD Windowed Freezes App

Started by June 24, 2000 02:55 PM
-1 comments, last by PowerBoyAlfa 24 years, 5 months ago
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!

This topic is closed to new replies.

Advertisement