Rotation only works when mouse moves
I''m using C++ and DirectX to render a 3d pyramid. I''m using a rotation matrix to spin it on its y axis. The funny thing is it works for about the first second and then it stops, but it will keep spinning if I start to move the mouse. Maybe my rendering loop is conflicting with the message pump some how. Has anyone ever seen this before? Any help would be much appreciated. Thanks.
Andrew Clark
i had this prob when using direct3d with mfc, i put the render code in the OnPaint function, so the window only repaints when you move your mouse, now if your using the winapi you should put the render code in with the message pump so the render code gets called with every pass or set it up to be called with every pass in the loop when there is no message to be processed, no if your using mfc what i did was to create a timer and have your render code in the OnTimer function i wouldn''t the timer time too low or it will hold up you whole app i had mine set to be called every 80 milliseconds and it worked just fine.
i hope this helps
i hope this helps
It sounds like either a Paint issue (as mentioned above) or that you''re using GetMessage, which blocks until there is a message waiting.
Stay Casual,
Ken
Drunken Hyena
Stay Casual,
Ken
Drunken Hyena
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement