Sorry.  I need to be clear that the Float.SIZE usage I mentioned was
in my code not the Android OpenGL code.

On Jan 15, 10:00 am, shaun <[email protected]> wrote:
> Be aware that Android 2.0.1 and 2.1 both return bits instead of bytes
> for Float.SIZE.  The expected return value is 4, but 32 is returned
> for some reason!
>
> This was used in a couple of places where allocation was involved and
> fatal errors ensued.  Just so happens the errors were in OpenGL part
> of the code.
>
> On Jan 15, 1:14 am, markusn82 <[email protected]> wrote:
>
>
>
> > Thanks for all the replies guys.
>
> > Philip, I've already taken most of your points into consideration
> > during my development (though there were a few things new to me like
> > using Bitmap.recycle).
>
> > Jeremy, what kind of VBO issues were encountered. My game uses VBO
> > heavily so I'd like to know if I can work around the issues before
> > switching all my VBOs over to standard vertex arrays.
>
> > Also, have any of you tried using Perfecto Mobile or Device Anywhere?
> > Have you guys had success with either of them for testing on the Droid/
> > Nexus One?
>
> > On Jan 14, 6:34 pm, Philip <[email protected]> wrote:
>
> > > My experience so far:
> > > - Create your textures in power of two and make sure you scale and
> > > clip them to the right ratio when you draw.
> > > - Don't stick to RBGA_8888 when you can do ALPHA_8 (text rendering)
> > > - Do whatever you can do in OnSurfaceCreated before you get called in
> > > OnSurfaceDraw
> > > - Avoid the GL11 context cast. Some things won't work e.g glColor4ub
> > > will compile but not work.
> > > - Balance your calls of enable and disable for each component draw
> > > your call into your scene graph.
> > > - Pre-allocate your nio buffers
> > > - Use DrawElements but for the simplest shapes of one vertice
> > > - Test on as many devices as you can. Just don't settle for the
> > > emulator e.g. non power of twos work on emulator but not on the phone.
> > > - If you can then use the on demand drawing.
> > > - Use the trick of putting a wait in the onTouchEvent call for 20ms
> > > and a notify in your onDraw to reduce the deluge of motion events you
> > > have to process. You can bypass onTouchEven and use a lower call to
> > > save some cycles as well.
> > > - Use texture atlas as much as you can e.g. to draw score and text or
> > > animations
> > > - Disable the fancy rendering options (DITHER_TEST etc...) Unless you
> > > crave a realistic rendering on textures.
> > > - If you draw in 2D, then disable the DEPTH_TEST
> > > - Don't forget the Bitmap.recycle() call when you are done binding
> > > your textures.
> > > - Avoid Object creation destruction (PointF Rect) in your rendering
> > > routines. GC calls will slow down your frame rate.
> > > - Preload your textures extensively. don't wait until you draw at the
> > > last minute to bind your textures. The lag is noticable if you do so
> > > it's better at app start up time.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to