A Picture’s worth 5MbPosted: November 8, 2012
What’s this then?
Another screen capture. This time I just went with the full size 1920×1080. What’s happening on this screen? Well, that tiger in the upper left is well known from PostScript days, and is the gold standard for testing graphics rendering systems. In this case, I’m using OpenVG on the Pi, from a Lua driven framework. No external support libraries, other than what’s on the box. In fact, I just took the hello_tiger sample, and did some munging to get it into the proper shape, and here it is. One thing of note, this image is actually rotating. It’s not blazingly fast, but it’s not blazingly fast on any platform. But, it’s decent. It’s way faster than what it would be using the CPU only on my “high powered” quad core desktop machine. This speed comes from the fact that the GPU on the Pi is doing all the work. You can tell because if you get a magnifying glass and examine the lowest right hand corner of the image, you’ll see that the CPU meter is not pegged. What amount of action is occuring there is actually coming from other parts of the system, not the display of the tiger. I guess that VideoCore GPU thing really does make a difference in terms of accelerating graphics. Go figure.
In the middle of the image, you see a window “snapper.lua”. This is the code that is doing the snapshot. Basically, I run the tiger app from one terminal, the one on the lower left. Then in the lower right, I run the ‘snapper.lua’ script. As can be seen in the OkKeyUp function, every time the user presses the “SysRQ” key (also ‘Print Screen’ on many keyboards), a snapshot is taken of the screen.
Below that, there’s a little bit of code that stitches an event loop together with a keyboard object. Yes, I now have a basic event loop, and a “Application” object as well. This makes it really brain dead simple to throw together apps like this without much effort.
One very interesting thing about being able to completely control your eventing model and messaging loops is that you can do whatever you want. Eventually, I’ll want to put together a quick and dirty “remote desktop” sort of deal, and I’ll need to be able to quickly grab the keyboard, mouse, and other interesting events, and throw them to some other process. That process will need to be able to handle them as if they happened locally. Well, when you construct your environment from scratch, you can easily bake that sort of thing in.
It’s nice to have such a system readily at hand. I can fiddle about with lots of different things, build apps, experiment with eventing models, throw up some graphics, and never once have to hit “compile” and wait. This makes for a very productive playground where lots of different ideas can be tried out quickly before being baked into more ‘serious’ coding environments.