well if you have a cache of the window, you actually just call bitblt with the rect as from the mw_paint message, then return. one message, one blit, return. as fast as possible. that's what i do. window tearing? what's that?tony tony chopper wrote:if you get a wm_paint with a tiny invalidation rectangle, why would you prefer to repaint everything? If your source is a composite of lots of items, you can easily skip the items not hitting the invalidation rectangle.
"animate?"
yes, animate. like when things move on the screen without user interaction, like meters or knobs or whatnot.
oh but this is just your misconception. do you call invalidaterect? in which case you do grab a dc directly because you're just dispatching a message to yourself.tony tony chopper wrote:redrawing windows is pretty bad, better invalidate it (or part of it) and let Windows deal with the messaging, delaying repaint messages when the message buffer is too crowded. I never ever grab a DC to paint in it directly.
you might want to check that is what actually happens, and not just an immediate wm_paint message that is forced to occur and operate before invalidaterect() will return.tony tony chopper wrote:the message.. is the whole point. As well as the region merging, when you invalidate rectangles that intersect.
i think nobody processes games or video cycle-based either, they instead use frame sync and drive video based upon frames. the main loop wouldn't want to interact with the video loop if you don't want to be dropping frames or lagging your game logic during heavy video activity... is that why so many games have such problems? (of course.)tony tony chopper wrote:me too, and you don't refresh a game like you refresh a GUI.. You don't even process a game (cycle-based) like you process a normal app (msg-based, even though the msg loop is kind of a cycle).
you're saying we should force our guis to be delayed when something is happening in one or the other as well. do you think the window message dispatching is coated in magic pixie dust? open two child windows, lock the thread in one during a wm_paint and see if you can move the windows around and let them redraw as usual.
if so, maybe this is an improvement in vista/win7 that i haven't heard of yet.
when i say redraw as usual, i mean all three windows are still getting wm_paint and so on, and they're able to work as usual with all mouse messages.
in winxp - the main window will be dispatching the messages and the child windows will get them, and pass them onward down the chain. getmessage, translate, dispatch, etc. if a child window decides that instead of dispatching, it'll sleep(1000000), that should lock the entire host application.
are you using vstgui or did you write your own gui code? in a control in onMouse() call sleep(10000000) and see what happens. same deal because vstgui, my gui, everything works the same way. the messages are in a single thread.


