Experimental v77c now up! [MONKEY NEWS]

Monkey Forums/Monkey Programming/Experimental v77c now up! [MONKEY NEWS]

marksibly(Posted 2014) [#1]
Hi,

Experimental v77c is now up!

This version adds the ability to set update rate to 0 to get a 'free running' app.

This basically means your app's OnUpdate and OnRender methods will be called at an update rate determined by the target - hopefully 60hz!

In many cases (eg: android, ios, psm, winrt), this means 'vsynced 60hz'.

On desktop-ish targets (desktop, xna, html5), this will depend on the refresh rate of the monitor/compositor and whether vsync is enabled or not.

On Flash, this means 60hz using the standard update rate mechanism.

Note that with update rate 0, you get exactly one update per render - ie: updates don't 'catch-up' to renders the way they do with update rate>0.

I've also added some simple 'displaymode' handling functions for the desktop and xna targets. See bouncyaliens for a 'toggle fullscreen' demo. There's also SetSwapInterval in there (desktop target only).


Fixed PSM ButtonsDown bug.

Added OnResize method to App.

Moved DeviceWidth/DeviceHeight from graphics to app module.

Added DisplayMode class to app; DisplayModes, DesktopMode, SetDeviceWindow, SetSwapInterval functions to app module.

Added update rate '0'. This is 'go nuts' mode - app just runs as fast as possible and you get exactly one update per render.

glfwSwapBuffers moved from mojo graphics code to target.

Souped up html5 target template - moved resize handling code to html.

Fixed XNA PlayMusic paused flag bug.

Fixed transcc debug mode array indexing bug in js/as translators.




ziggy(Posted 2014) [#2]
That's great!! XD


Sammy(Posted 2014) [#3]
Excellent, off to have a play/mess with the new features now! :D


marksibly(Posted 2014) [#4]
Oops, forgot to add update rate 0 to Ouya - will wait a while to see what else I've broken before uploading next version...


marksibly(Posted 2014) [#5]
Actually, that version also has a fairly interesting feature in it that I'd forgotten about - build dirs are 'munged' with version info extracted from VERSIONS.TXT.

eg: bouncyaliens.monkey builds to 'bouncyaliens.buildv77c' - I didn't really mean to release it as it's kind of experimental, but what do people think?

It's meant to solve the 'delete .build dir' problem in a way that doesn't risk destroying any user customization to builds. On the downside, it consumes a bit of extra space and you'll have to manually 'port' build customizations to new releases, but on the whole I think it's an improvement.


ziggy(Posted 2014) [#6]
I think it's a very sensible way to do it. I like it.


dragon(Posted 2014) [#7]
mark,
was official support for psm reactivated?
because psm is now avalable in many countries

here was also a touch bug in PSM


marksibly(Posted 2014) [#8]
> was official support for psm reactivated?

Yes, PSM is back...at least until they take it away again.

> here was also a touch bug in PSM

If you mean this one:

http://www.monkeycoder.co.nz/Community/posts.php?topic=4193

I was unable to reproduce the problem - seemed to work fine on both simulator and an actual device.

Did you try it on a device? It's quite possible the simulator doesn't give 'perfect' results and may be affected by host machine speed etc.


Gerry Quinn(Posted 2014) [#9]
Update and build changes seem like nice practical solutions. Update(0) may well fix problems, and if not, the option does no harm. And the build change is really simple, it fixes a problem that leaves beginner users baffled and disconcerted, while if it causes a problem the reason will be obvious and easy to fix.

(If you want, you can just delete the new version build and rename the old one. Then recompile. If it runs, you are done, if it crashes you make the changes you would have had to make anyway.)


dopeyrulz(Posted 2014) [#10]
Thanks for all the desktop stuff - looks like I can get rid of my custom stuff to allow Window/Fullscreen which will be terrific! (always great to have this stuff in the base!). The only other suggestion I could make would be Show/Hide (minimise) window (see http://monkeycoder.co.nz/Community/posts.php?topic=4777 ).

Think the munged directory thing is a good idea - easy for beginners and might be great for Advanced users who swap between different releases without losing any custom changes they have made. Users can tidy up themselves in this day and age.

My testing of the Desktop changes appear to make the Fullscreen mode (SetUpdateRate = 0 or 60) smoother regardless of SetSwapInterval =1 or 0. Window mode doesn't appear to make much difference as far as settings go either but overall it only occasionally jumps vs previously it would tear reasonably badly (on the built-in Intel gfx chip on my desktop).


dopeyrulz(Posted 2014) [#11]
Also thanks for checking out the Xbox DPad stuff (Windows only?) - works well for my single controller!


computercoder(Posted 2014) [#12]
Very cool! Thanks for the updates Mark! I look forward to making use of these updates :)


Leginus(Posted 2014) [#13]
Excellent once again. Thanks for your efforts Mark!


Sammy(Posted 2014) [#14]
A little confused here :

Note that with update rate 0, you get exactly one update per render - ie: updates don't 'catch-up' to renders the way they do with update rate>0


Does this mean that this is the equivalent of just putting your OnUpdate() within your OnRender() call?


Rixarn(Posted 2014) [#15]
I think so, Sammy. Putting update stuff in the OnRender() method was not nice, and for some cases it was the only way to go (such as when loading stuff and displaying a loading bar at the same time). Very nice update :)


Tibit(Posted 2014) [#16]
bouncyaliens.monkey builds to 'bouncyaliens.buildv77c'

Atm I like the sound of this.


Sammy(Posted 2014) [#17]
Thanks for confirming Rixarn. It now looks possible to do some alternative gameloop timing schemes using this new feature.. interesting.


dawlane(Posted 2014) [#18]
Hi Mark.
Just got round to downloading 77c. But it looks like the code gremlins have been at the app.monkey file and changed SaveState function to Return a type of Void.
Otherwise looking good so far.


Carlo(Posted 2014) [#19]
i test a resize html5
but in my example
www.dracoders.com
i resize a setting (image ecc ) with deviceWidth and Device Height and i change a position image and graphics

insert a option for resize or a solution monkey pro 75d


MikeHart(Posted 2014) [#20]
CARLO, with DeviceWidth and DeviceHeight you can only retrieve the canvas dimensions, not set them.


Carlo(Posted 2014) [#21]
ok but i create a (resize dimension) for auto adapting resolution
in 77c my code not work


MikeHart(Posted 2014) [#22]
Guess you need to post a bug report in the bug forum with your code, so Marc can look into this.


Carlo(Posted 2014) [#23]
the problem is a
Souped up html5 target template - moved resize handling code to html.

i thinks for a 2 options:

1- moved resize handling code to html.
2- not resize