DirectDraw Surface Problem

Started by
12 comments, last by Rixter 22 years, 8 months ago
2 Anonymous

>Now I just get a screen with the default window color

You didn't expect something to show up before you actually draw it, did you? Also, make sure you intercept WM_ERASEBKGND, WM_NCPAINT, WM_NCCALCSIZE and never allow them to DefWndProc. Otherwise, the system redraws your window each time you flip.

BTW, I personally keep my draw-flip loop in a separate thread,
apart from the MessageLoop.

Edited by - Friday13 on August 13, 2001 3:44:53 AM
Advertisement
Anonymous was me. Anyway, I intercepted the 3 messages, but I still get the grey screen with the hour glass. I placed a sound file to play each time it does the flip routine and the sound never plays which leads me to believe it never makes it to the flip routine.

Invader X
http://www.invadersrealm.com
Invader X

Nice to meet you.

Like I said, try to Clear2 at least (let alone drawing something)so you can see if any change happens to the back buffer at all. Besides, i''m not sure how this construction:

if PeekMessage(...) Translate ELSE flip

should work. Maybe you''re getting some constant flow of incoming messages so you never get to ELSE clause. Or, maybe you''re getting no messages and, since you don''t draw anything, it''s flipping so fast you don''t even notice, but you can''t say ''cos you didn''t make changes to the surfaces.
Thanks. It works now.

You were right that it was set up to have a constant flow of messages. When I double checked it again I noticed that I was using PM_NOREMOVE which left the messages in the queue so they were always being read again. I switched to PM_REMOVE and it works.

Thanks again =)

This topic is closed to new replies.

Advertisement