Revision 0c827acc
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/DistortedTexture.java | ||
---|---|---|
53 | 53 |
|
54 | 54 |
private Bitmap mBmp= null; |
55 | 55 |
private int[] mTextureDataH; |
56 |
private boolean mBitmapSet; |
|
57 | 56 |
|
58 | 57 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
59 | 58 |
// We have to flip vertically every single Bitmap that we get fed with. |
... | ... | |
114 | 113 |
GLES30.glDeleteTextures(1, mTextureDataH, 0); |
115 | 114 |
|
116 | 115 |
mTextureDataH[0] = 0; |
117 |
mBitmapSet= false;
|
|
116 |
mID = 0;
|
|
118 | 117 |
} |
119 | 118 |
|
120 | 119 |
mMarked = false; |
... | ... | |
131 | 130 |
|
132 | 131 |
boolean setAsInput() |
133 | 132 |
{ |
134 |
if( mBitmapSet )
|
|
133 |
if( mID!=0 )
|
|
135 | 134 |
{ |
136 | 135 |
GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, mTextureDataH[0]); |
137 | 136 |
return true; |
... | ... | |
197 | 196 |
mTextureDataH = new int[1]; |
198 | 197 |
mTextureDataH[0]= 0; |
199 | 198 |
mBmp = null; |
200 |
mBitmapSet = false; |
|
201 | 199 |
mID = 0; |
202 | 200 |
mMarked = false; |
203 | 201 |
|
... | ... | |
228 | 226 |
|
229 | 227 |
public void setTexture(Bitmap bmp) |
230 | 228 |
{ |
231 |
mBitmapSet = true; |
|
232 |
mBmp = bmp; |
|
233 |
mID = bmp.hashCode(); |
|
229 |
mBmp= bmp; |
|
230 |
mID = bmp.hashCode(); |
|
234 | 231 |
|
235 | 232 |
//android.util.Log.e("Texture", "setting new bitmap "+mID); |
236 | 233 |
} |
Also available in: Unified diff
Minor