Rendering Within Paint Message Giving Strange Results

Started by
6 comments, last by Raeldor 18 years, 10 months ago
I have a windowed direct3d application, and I have a render call within the processing of my paint message. This is so that the window is redrawn after a menu has closed etc. It is giving strange results in that the camera angle changes (in fact what I think it happening is that windows is blitting an old copy of what the window had back over the top). I have tried the render call between a begin and end paint... then it gets really wierd, like it doesn't render at all. I also tried following the render with a call to validaterect which didn't do much at all. My application is not realtime, so I only want to make render calls when something changes. Has anyone seen this behaviour before? What is the correct way to call render in the paint message? Thanks Oh, and I am using win32 api.
Advertisement
Here is the source code for this problem since it's a little hard to explain...

http://www.valcian.com/test2.zip

If you select file, new and then click ok on the dialog. Then select rotate from the menu and rotate the grid a little, then select 'zoom' you should see the problem. If not, just select a 'rotate' again or use 'move' and eventually you will see when you select the menu item that the image reverts back and looks like it is not being rendered, or it is being overwritten.

Thanks for any help.
I'm not seeing this problem here that you describe, unless you mean that when your rotating sometines the grid jumps to another position not far away.
Is it jumping position and then going back to the position again when you click and drag the mouse on the window? Could be the same problem.
Quote:Original post by Raeldor
Is it jumping position and then going back to the position again when you click and drag the mouse on the window? Could be the same problem.


Yes, if you move it a little, it jumps, but if you move it back in that direction, it jumps back to original position.
Quote:Original post by Lenox
Quote:Original post by Raeldor
Is it jumping position and then going back to the position again when you click and drag the mouse on the window? Could be the same problem.


Yes, if you move it a little, it jumps, but if you move it back in that direction, it jumps back to original position.


Not sure if we are talking about the same thing. This seems to happen for me when I switch tools on the menu bar between move/zoom/rotate. It's not happening when I stay on the same tool. Also, I put the code onto my laptop to try it and I do not see the problem there, which is a little strange.

Let me FRAPS the problem, lol. A little extreme, but at least then you can see it.
Damn, can't FRAPS it :(

It seems to happen when I make the present call to the device. After I have executed a mouse drag to do a move and then select the zoom tool which then because then menu is pulled up, the paint event fires and the render gets called again. it's during that render called when the device->present is being called that the wrong picture/camera angle is being drawn.

Moved to another thread now I have narrowed down the problem.

This topic is closed to new replies.

Advertisement