Skip to main content
GameDev.net gamedev.net
🔒 Locked

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

Started by johnnyk Nov 26, 2008 at 12:00 AM 1 replies 600+ views
Original Post
johnnyk
johnnyk
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
Endurion
Endurion
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.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
johnnyk
johnnyk
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?

Topic Locked

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

Sign in to reply to this topic.