cg0601 wrote:I have used the direct buffers before, just like you suggest, but I had trouble in putting the updates back into the buffer. I know I can do a put(index, float) and will most likely adapt my program in using it.
cg0601 wrote:The sample program did not create any new objects, nor did it cause any GC happening.
cg0601 wrote:Coming back to the use of direct buffers and using "put" to change the values:
When I tried it first, I saw all kind of lines being drawn, which made no sense to me. Using "wrap" fixed this, but wrap is no option. I tried putting "synchronized" around the code, but it did not fix it either.
I realize now, that if to avoid these spikes, I need to do the copy from the float array into the buffer during the call to my "onDraw(gl)" call.
If I want to have a waving flag, I will need to update all vertices in most cases, so I wonder it it might be faster, if I do something like this:
Or should I do individual "puts" for all float values in the array?
Users browsing this forum: No registered users and 5 guests