Prime Members - Reputation: 769
Posted 21 July 2012 - 08:34 AM
I am going to avoid writing any DX code as this really occurs with anything rendered (even examples in SharpDX).
Lets take the minitri DX10 example in SharpDX with a standard FPS timer rendered in DX
Add a XAML text box to the grid
Add a MouseMove event to any window (grid, canvas, window etc) and capture the mouse position in this event(RenderImage is the 'DX Image' name, which is Canvas1 in SharpDX examples);
private void Mouse_Pos(object sender, System.Windows.Input.MouseEventArgs e)
MousePos.Text = e.GetPosition(RenderImage).ToString();
Now when I load the app, FPS almost doubles when I move the mouse and the image, mesh, animation etc speeds up :/ its like the program decides to double its speed, and actually manages to do it really nicely yet obviously too
If I change MousePos.Text to this.Title, so the windows title pane changes its text to the mouse position things run smoothly despite the mouse moving.
The same thing happens with labels, this only occurs IF the actual text is being rendered on the grid, now sure I could just directly have this rendered via directx text but for the sake of things why would rendering or the general speed of the app rapidly increase or am I just doing something awfully wrong? ;)
PS. This also occurs when you have a label / text box change its contents to whatever key is pressed, although it isnt as noticeable
Members - Reputation: 207
Posted 21 July 2012 - 09:17 AM
If you really want to know what is going on I'd recomned you profile your code with PIX.