[squeak-dev] Re: Squeak VM on iPad/IPhone gets open/GL rendering
John M McIntosh
johnmci at smalltalkconsulting.com
Tue Sep 14 02:41:07 UTC 2010
I figured out we can't reasonably do open/GL arbitrary sized textures on the first gen iPhone or iPod Touch.
So I check for iOS 3.1.x and fall back to using the CALayer render, the wonders of polymorphism.
I also commented out some of the nifty eToys on the iPad features lurking in the VM, like rotate me to get a keyboard,
and also checked and confirmed that rotation of both types of renders with the view as a plain view or
embedded in a scrolling view worked as expected.
At this point I'm somewhat done the open/GL optimization.
The implementation is to:
Ccreate a texture and populate via glTexImage2D using apple's extension APPLE_texture_2D_limited_npot
at view surface creation time.
Then on a ioForceDisplayUpdate (implicit or explicit) we take the union of the rectangles observed
in ioShowDisplayOnWindow and then use the
glTexSubImage2D
to push the bytes one row at a time by calculating the offset into the bytes found in the Display special object,
the texture then is drawn to the screen. I note we create the full sized glTexImage2D only once at startup time.
An alternate choice was to use kEAGLDrawablePropertyRetainedBacking=YES and set the
glTexImage2D & glTexSubImage2D pair for each ioForceDisplayUpdate using the subrectangle.
But I found the Open/GL fps had a lot of jitter, so it seemed less animation friendly than creating the
glTexImage2D once and doing the glTexSubImage2D on each ioForceDisplayUpdate.
Someone mutters, GL_FRAMEBUFFER_OES but at this point someone can pay me to explore faster
alternatives.
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> Twitter: squeaker68882
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3829 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100913/5a991f57/smime.bin
More information about the Squeak-dev
mailing list
|