Thanks for those critical points.

One thing more, I need to call buffer.position(0) after each call to
bulk put method, right?

On May 3, 1:19 am, Mario Zechner <[email protected]> wrote:
> Do not call glBufferSubData, use glBufferData instead. The former is
> dog slow on most mobile GPUs for various reasons (pipeline stall if
> that buffer is currently in use etc.).
>
> Also, do not use Buffer.put(int index, float value) if you can instead
> use the bulk put operations. For direct Buffers that's one JNI call
> per float which is way to costly. Note however that bulk puts are slow
> up until Android 2.3 as well. 
> Seehttp://www.badlogicgames.com/wiki/index.php/Direct_Bulk_FloatBuffer.p...
>
> On 2 Mai, 23:50, elix <[email protected]> wrote:
>
>
>
>
>
>
>
> > Thanks adam.
>
> > I asked this topic in stackoverflow and it is solved. Simply; update
> > the coordinate data within the buffer object by using put(index,
> > value) method and then call glbuffersubdata() method.
> > Here is detailed 
> > answers:http://stackoverflow.com/questions/5849566/how-to-change-the-content-...
>
> > On May 2, 8:21 pm, Adam Hammer <[email protected]> wrote:
>
> > > Just use get and put on the buffer with your data.memory layout can
> > > vary but typically is xyzxyzxyz which would be the 9 floats that
> > > define your 3 vertices.
>
> > > Adam
>
> > > On May 1, 12:27 pm, emre onal <[email protected]> wrote:
>
> > > > I have some triangle polygons and drawing them in a traditional way:
> > > > (android-java code)
>
> > > > gl.glDrawArrays(GL10.GL_TRIANGLES, i, j);
>
> > > > I want to update the vertex coordinates of the triangles. All of the
> > > > tutorials I've found use an initial vertex data then only apply
> > > > transformations to them. I need to change each vertex coordinate
> > > > independently.
>
> > > > I change the content of the array which is used to create the related
> > > > vertexbuffer but it doesn't make any change on the screen. Rebuilding 
> > > > the
> > > > vertexbuffer on eachframe doesn't seem to be right way I guess.
>
> > > > Can you point out any example source code at least, if you know any?
>
> > > > --
>
> > > > Emre

-- 
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