Buffering Images

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 246
Joined: Tue Jun 30, 2009 11:15 pm

Buffering Images

Post by SirWobbyTheFirst » Sat Jan 28, 2012 10:57 pm

Greetings everyone.

I have decided to take a moment out of my usual crazy ideas and build something in Revolution thats based around visuals rather than code. Therefore I thought why not try my hand at writing somewhat of a window manager and have been making great strides with it, using a combination of groups and images, I have created a very sophisticated system and also created code to create, delete and make the windows react to changes such as being deactivated when another window is clicked or when the desktop is clicked.

However one particular thing I've noticed is that if I switch to the Pointer tool in Revolution (I haven't quite figured out how to do moving and resizing YET!) and then click on the group representing the window (All the images are contained inside a group which makes state changing and relayering really easy, I love it!) and move it around, it seems to cause clipping and flickering and I figured if the window contents get particularly complex that could be quite noticable to an end user.

Now I understand that when your dealing with direct 2D graphics and not buffering them clipping is bound to happen, however having seen the ability for the Graphics object in Java to buffer images, I was wondering if Revolution had any sort of way to do so.

I'm doing this mostly as a little side project to my usual work of background systems such as servers and what not however it's always handy to know a little bit more, I never know when this sort of solution may fit the bill. Additionally, once I have finalized my system, I'm more than happy to share it around so others can benefit from it, again you never know when something new might come in handy. :)

With Regards, Michael.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Buffering Images

Post by jacque » Sun Jan 29, 2012 7:17 pm

The problem is elegantly solved in the latest 5.0 version by using accelerated rendering, but if your sig is correct and you still use 4.0 then you don't have access to that. Check out the alwaysBuffer property of images instead. I think they are supposed to be buffered by default, but maybe something changed that in your stack.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 246
Joined: Tue Jun 30, 2009 11:15 pm

Re: Buffering Images

Post by SirWobbyTheFirst » Sun Jan 29, 2012 7:32 pm

Oh I'm intruiged now, how does accelerated rendering work Jacque? Does it tap into DirectX or OpenGL by chance or am I completely off. The only thing narking me about upgrading is the license system, apparently the personal license is for use by me only so I can't release my software for free which is what I do now and the commercial license is really expensive for someone like me additionally both licenses are supposed to have a screen pop up stating the application was produced using the personal or commercial license which I'm thinking would eventually get annoying for the end user.

I'm just a bit concerned really because I'd really like to upgrade as well especially for the graphics rendering side of things.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Buffering Images

Post by jacque » Sun Jan 29, 2012 8:26 pm

The commercial license has no popup, it only does what you tell it to, and you can produce professional software with it. In addition, you can provide your own splash screen for iOS (Android doesn't support splash screens.) You have complete control with the commercial license. You also don't need to purchase any platform you aren't using, which reduces costs.

Accelerated rendering is a really nice new feature. It can be set to none, software, openGL, or coreGraphics, depending on what the OS supports. The defaults are:

* Mac: CoreGraphics
* Windows/Linux: Software
* iOS: OpenGL
* Android: OpenGL

iOS also supports coregraphics, and all platforms support software rendering. You set a property on specific objects to tag them as "dynamic" or "static". Those marked as dynamic are redrawn very quickly using a special buffering process. This is good for games, scrolling fields, and other objects that need to move rapidly.

If objects don't move, then none of this applies. In fact, setting a non-moving object to "dynamic" will actually slow things down. But in your case, where you are moving a group of objects, it would help. You would set the group (but not each object in it) to dynamic and the whole group would be redrawn much faster using the rendering type you specify.

Accelerated rendering has made my apps extremely responsive, especially on mobile platforms.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 246
Joined: Tue Jun 30, 2009 11:15 pm

Re: Buffering Images

Post by SirWobbyTheFirst » Sun Jan 29, 2012 8:40 pm

Hmm, thanks for the info, I may have to have a look into the trial to see what its like then, any information on what the personal license's restrictions are cos it seems abit strange to pop up a splash screen telling the person who uses the software that they made it using the personal, unless they wake up the day after purchasing with a hangover (In which case no biggie). XD

Sorry if I'm being a bit annoying about this.

Post Reply