• Advertisement
Sign in to follow this  

Rendering Within Paint Message Giving Strange Results

This topic is 4712 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement