Revision 7e53a35f
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/library/main/InternalBuffer.java | ||
---|---|---|
36 | 36 |
*/ |
37 | 37 |
public class InternalBuffer extends InternalObject |
38 | 38 |
{ |
39 |
public final int[] mIndex; |
|
40 |
|
|
39 |
private final int[] mIndex; |
|
41 | 40 |
private int mTarget, mSize, mUsage; |
42 | 41 |
private Buffer mBuffer; |
43 | 42 |
|
... | ... | |
56 | 55 |
recreate(); |
57 | 56 |
} |
58 | 57 |
|
58 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
59 |
|
|
60 |
public int getIndex() |
|
61 |
{ |
|
62 |
return mIndex[0]; |
|
63 |
} |
|
64 |
|
|
59 | 65 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
60 | 66 |
// must be called from a thread holding OpenGL Context. |
61 | 67 |
|
62 |
public void createImmediately(int size, float[] buffer)
|
|
68 |
public int createImmediately(int size, float[] buffer)
|
|
63 | 69 |
{ |
64 | 70 |
if( mIndex[0]<0 ) |
65 | 71 |
{ |
... | ... | |
83 | 89 |
|
84 | 90 |
markWasCreatedImmediately(); |
85 | 91 |
} |
92 |
|
|
93 |
return mIndex[0]; |
|
86 | 94 |
} |
87 | 95 |
|
88 | 96 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Bugfixes in MeshBase:
1) improper buffer was being invalidated after apply and setTextureMap (TFO rather than VBO!)
2) setTextureMap would only work if all components were being set