Sign in to follow this  
johnnyk

[.net] Updating an animation with a windows scroll bar

Recommended Posts

I have an app that renders a Direct X viewport in one dialog, and has a seperate dialog with an MFC scrollbar in it. When I drag this scrollbar, I want it to scrub the animation in the rendering window. However, when I'm dragging this bar, no other window besides the one containing the scrollbar are updated, and the animation won't update until I release it. Is there an easy way to change this behavior? Thanks! -John

Share this post


Link to post
Share on other sites
Sounds like you're listening to the wrong event.

You need to act on WM_VSCROLL/WM_HSCROLL with SB_THUMBTRACK. This will be sent during dragging the scrollbar.

If you already do that; how do you update the Direct view? Try calling UpdateWindow after InvalidateRect.

Share this post


Link to post
Share on other sites
Those are the ones I'm processing (with the OnHScroll function).

As for updating the Direct View, that's probably the problem. I'm using an engine that wants to own the main game loop, which is at odds with MFC which also wants to own the main loop. So I just call the engine loop from my derived CWinApp::InitInstance. So far I havent had any problems like that, but I'm guessing this might be one....

Anyway to use MFC without it having control of the main loop?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this