Thursday, January 10, 2013

Re: [android-developers] OpenGL 1.0 or 1.1?

I guess the BasicGLSurfaceView sample pretty much shows the correct way to allocate memory for OpenGL:

mTriangleVertices = ByteBuffer.allocateDirect(mTriangleVerticesData.length
         * FLOAT_SIZE_BYTES).order(ByteOrder.nativeOrder()).asFloatBuffer();

I wouldn't mind seeing something a little cleaner than that.





On Tuesday, January 8, 2013 12:51:21 PM UTC-6, a1 wrote:


W dniu wtorek, 8 stycznia 2013 18:39:38 UTC+1 użytkownik bob napisał:
Well, I was getting this error:

... called a GL11 Pointer method with an indirect Buffer


As a long shot, I was hoping maybe OpenGL 1.0 would just let me use indirect Buffers.  Then maybe I wouldn't have to change as much code.

You should really google first for this error. It has nothing to do with GL spec version, you've used java nio buffer allocated with Buffer.allocate instead Buffer.allocateDirect. Later allocate chunk of memory on native heap and former simply allocate java array. Problem is that chunk of memory allocated on VM heap may be moved around, that's why you need direct buffer for GL calls. I do remember that on 1.5 or maybe 1.1 GL call didn't check buffer type and there was a lot of errors when apps used indirect buffers with GL.

--
Bart

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment