Hi All,
Right I'm having trouble optimizing a draw routine within the client area of an application that I'm writing (using the Win32 API). The problem is that I'm getting excessive updates when I resize the client area of my application. This results in some terrible screen flashing that is quite disconcerting. Basically what I want to do is update the client drawing area when the client area is bigger than its previous size. I only want the portion of the client area that is revealed drawn and nothing else. I can detect when the client area is smaller and thus no update occurs, however the flashing occurs when the client area gets larger. I know about functions InvalidateRect() and ValidateRect() as these functions add and remove rectangles. However I'm not sure how to use these in the context of my situation.
Any advices much appreciated,
netwalker.
Win32 Screen Updating...
Started by netwalker, Nov 13 2007 12:43 PM
4 replies to this topic
#1
Posted 13 November 2007 - 12:43 PM
#2
Posted 13 November 2007 - 01:27 PM
Are you using a NULL background brush (or implementing a dummy WM_ERASEBKGND)? Otherwise, when calling BeginPaint(), the WM_ERASEBKGND message will be sent and the default window handler (DefWindowProc) will start clearing the entire client area using the window background brush.
(And make sure your window class style doesn't include CS_HREDRAW and CS_VREDRAW)
(And make sure your window class style doesn't include CS_HREDRAW and CS_VREDRAW)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.
-
Currently working on: the 3D engine for Tomb Raider.
#3
Posted 13 November 2007 - 01:43 PM
.oisyn said:
Are you using a NULL background brush (or implementing a dummy WM_ERASEBKGND)?
.oisyn said:
(And make sure your window class style doesn't include CS_HREDRAW and CS_VREDRAW)
Many Thanks.
#4
Posted 13 November 2007 - 01:52 PM
Sorry there .oisyn I've just had look at the style bits documentation for the window class and now understand why the excessive drawing was happening and how to remove it. Now my application is working as I expect it too.
netwalker.
netwalker.
#5
Posted 13 November 2007 - 01:57 PM
netwalker said:
Yes, I'm now using a null brush and this has completely removed the flashing. Does this now mean that'll have to update the client background manually?
Quote
Can I do this through the WM_ERASEBKGND message or will I need to process some additional message(s)?.
Quote
Do these attributes matter now that I'm using a NULL brush?. Could you suggest others that I can look at?.
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.
-
Currently working on: the 3D engine for Tomb Raider.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












