I have a Windows Phone 7 Silverlight with XNA application.
I’m also using a service which uses javascript to render dynamic images to the screen.
On the PC, the javascript is fluid and smooth, I can jump between images and their transitions smoothly. However, I need to bring this functionality to the phone.
As of right now, I’ve managed to use the Web Browser control in Silverlight to load my HTML file and execute the script. The problem is that once the “dynamic” part of the application kicks in, the web control doesn’t update fast enough. Instead of smooth sliding animations that the PC version results in, I get stutter, similar to having a low FPS in a game.
So, I’m wondering: is there any way to increase the update rate of a web browser control?
Another thought that I’ve had (but have been unsuccessful at implementing) is to embed a web browser in the XNA page of the application and use XNA’s update rate, which is significantly higher (I’m guessing is the standard 60 fps). However, the Silverlight web broweser control doesn’t seem to have an update rendering function and the I can’t find a library to embed a web browser inside the XNA application itself.
Does anyone have any idea how I can get my dynamic HTML file with javascript to render fluidly and smoothly?
EDIT:
webBrowser.InvalidateArrange() using a Timer at 30 FPS seems to have sped up the browser refresh but it’s still jumpy. If I try to increase the FPS, the browser reverts back to being slow.
Using a Timer set at 17 milliseconds (60 FPS) I force the invalidation of the browser, which causes it to redraw. In addition to this, I eliminated frames where the browser did not need to be redrawn.