windowed mode and dx7

Started by
4 comments, last by logicpill 23 years, 4 months ago
my app runs in windowed mode, and i blit one bitmap ... everything works, but then i create one dialog and when i open it it works as it should, but when i move it, there is a black trail where it previously was, if i move dialog all around i completely override bitmap, when i close dialog, bitmap refreshes, what must i do that i refresh bitmap everytime i move dialog...WM_MOVE in dialog procedure doesnt work, thanks
Advertisement

Try redrawing by responding to the WM_PAINT message.
"You say I''m a bitch like it''s a *bad* thing..."[email=alanetcetc@hotmail.com]Mail[/email] Site
You need to create a clipper using the D3D interface, and assign it, using SetClipper, to the surface you''re blt''ing.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Why use d3d if i use just directdraw...there is something with WM_PAINT, can anyone be more precise and explain a little bit more, i know that WM_PAINT is activated everytime monitor refreshes, but will WM_PAINT run even if i use modal dialog..can anyone explain a little please
From what I understand, WM_PAINT is sent whenever part of your application needs to redraw part of the screen. So if you move the dialog, Windows should send a message that you need to redraw the part of the screen that was uncovered. Or, you could just ignore the part of the message that tells you what area to redraw and just redraw the entire screen. This leads me to a question: Would it be better to divide the screen up into areas and only redraw those areas when there is a change in that area? For example, divide the screen into 4 sections. Then, when you get the WM_PAINT message, test to see what areas need to be repainted, and only redraw those areas? I just started Windows programming so I am not really sure if this is the best way. Hope this helps!

"I kinda think, therefore, I kinda... am?"
The Black Void comes from the messagebox overlapping memory space of the bitmap. When you move it, it just zeros out whatever was behind it because windows doesn''t store this.

Whenever a WM_PAINT is recieved a PART of the client area (inside) of the windows needs to be updated. WIndows itself will clip parts of the image(somewhat slow) so if you want to change the image at this point, you will have to use invalidate rectangle to redraw the entire differently. If you just want to refresh it though, then you can recieve information on the invalid rectangle and just redraw that part of it(do your own clipping this way) and its quicker than falling back on windows.

Sorry, cant remember what the function is to find the invalid rectangle.

This topic is closed to new replies.

Advertisement