Skip to main content
gamedev.net
🔒 Locked

MFC problems

Started by Zorbfish Aug 30, 2003 at 6:56 PM 2 replies 550+ views
Original Post
Zorbfish
Zorbfish
I read the integrating mfc article as well as searched these forums for this question (I found one unanswered topic that was exactly what I am about to ask) before resorting to posting. I'm not really having a problem with getting mfc and directx to play nice together so don't suggest the sdk samples. Also those examples only present how to do directx in a dialog and not in a document/view application. Bare with me this is a long post, and I tend to be wordy in my descriptions. I made some minor changes to the implementation in the article, like deriving from a ScrollView (so I can use scrolling) and not overriding the OnIdle function. I got my SDI application to work with a Direct3D view. The only problem is that when I resize the application window, the view's client area flickers (usually white triangles). This is painfully obivious when I tested it by drawing a small texture and only clearing the background to black. I have overidden the OnEraseBkgrd function as suggested in the article ignoring the base class' implementation. Also my reason for not overriding the OnIdle function as the author did is that when I did the screen would flicker contantly (unlike my current situation where it only occurs on resize). The only example I have found that may resolve my problem was an example in the DX7 SDK called Direct3D RM Viewer. When this application was resized the window would not render until it was done producing a black screen as the window was resizing. Is this the only solution? [edited by - Zorbfish on August 30, 2003 7:57:39 PM]
Hawkeye3
Hawkeye3
Overriding OnEraseBkgrd fixes that problem for me... perhaps it has something to do with the scroll view generating extra messages. For example, the scroll bars might be sending client-redraw messages during window resize.
Zorbfish
Zorbfish
That''s what I thought it might be, but wouldn''t the scrollbars be the only thing being redrawn not the whole client area? I''ll try using just a regular view and see what happens.
Zorbfish
Zorbfish
Well I finally found a few free hours to investigate and I do believe that you are right. Somewhere inside scrollview it must be calling a paint or erase background message. A normal view worked just fine. Would it be easier to just add events for scrolling in a view and avoid scrollview altogether?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.