Revision 342a6773
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/library/main/InternalBuffer.java | ||
---|---|---|
20 | 20 |
package org.distorted.library.main; |
21 | 21 |
|
22 | 22 |
import android.opengl.GLES30; |
23 |
import java.nio.Buffer; |
|
24 | 23 |
import java.nio.ByteBuffer; |
25 | 24 |
import java.nio.ByteOrder; |
26 | 25 |
import java.nio.FloatBuffer; |
... | ... | |
38 | 37 |
{ |
39 | 38 |
private final int[] mIndex; |
40 | 39 |
private int mTarget, mSize, mUsage; |
41 |
private Buffer mBuffer; |
|
40 |
private FloatBuffer mBuffer;
|
|
42 | 41 |
|
43 | 42 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
44 | 43 |
|
... | ... | |
86 | 85 |
return mIndex[0]; |
87 | 86 |
} |
88 | 87 |
|
88 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
89 |
// buffer non-null!! |
|
90 |
|
|
91 |
public void update(float[] buffer) |
|
92 |
{ |
|
93 |
mBuffer.put(buffer).position(0); |
|
94 |
|
|
95 |
GLES30.glBindBuffer( mTarget, mIndex[0]); |
|
96 |
GLES30.glBufferData( mTarget, mSize, mBuffer, mUsage); |
|
97 |
GLES30.glBindBuffer( mTarget, 0); |
|
98 |
} |
|
99 |
|
|
89 | 100 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
90 | 101 |
|
91 | 102 |
public void invalidate() |
src/main/java/org/distorted/library/mesh/MeshBase.java | ||
---|---|---|
305 | 305 |
mVertAttribs[vertex*VERT_ATTRIBS + NOR_ATTRIB + 1 ] = norY; |
306 | 306 |
mVertAttribs[vertex*VERT_ATTRIBS + NOR_ATTRIB + 2 ] = norZ; |
307 | 307 |
} |
308 |
|
|
309 |
mVBO.update(mVertAttribs); |
|
308 | 310 |
} |
309 | 311 |
|
310 | 312 |
GLES30.glUnmapBuffer(GLES30.GL_TRANSFORM_FEEDBACK); |
Also available in: Unified diff
1 more fix for MeshBase.apply(VertexEffect). This still does not (fully) work though.