Revision 1942537e
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/DistortedEffectQueues.java | ||
---|---|---|
88 | 88 |
|
89 | 89 |
void drawPriv(long currTime, DistortedTexture tex, GridObject grid, DistortedFramebuffer df) |
90 | 90 |
{ |
91 |
DistortedFramebuffer.deleteAllMarked(); |
|
92 |
|
|
93 | 91 |
GLES20.glViewport(0, 0, df.mWidth, df.mHeight); |
94 | 92 |
|
95 | 93 |
float halfZ = tex.mHalfX*grid.zFactor; |
... | ... | |
132 | 130 |
mF = null; |
133 | 131 |
} |
134 | 132 |
|
133 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
134 |
|
|
135 |
static void release() |
|
136 |
{ |
|
137 |
mNextID = 0; |
|
138 |
} |
|
139 |
|
|
135 | 140 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
136 | 141 |
// PUBLIC API |
137 | 142 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
172 | 177 |
*/ |
173 | 178 |
public void draw(long currTime, DistortedTexture tex, GridObject grid) |
174 | 179 |
{ |
180 |
tex.createTexture(); |
|
175 | 181 |
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0); |
176 | 182 |
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, tex.mTextureDataH[0]); |
177 | 183 |
drawPriv(currTime, tex, grid, Distorted.mFramebuffer); |
184 |
DistortedFramebuffer.deleteAllMarked(); |
|
185 |
DistortedTexture.deleteAllMarked(); |
|
178 | 186 |
} |
179 | 187 |
|
180 | 188 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
186 | 194 |
*/ |
187 | 195 |
public void draw(long currTime, DistortedTexture tex, GridObject grid, DistortedFramebuffer df) |
188 | 196 |
{ |
197 |
tex.createTexture(); |
|
189 | 198 |
df.setAsOutput(); |
190 | 199 |
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, tex.mTextureDataH[0]); |
191 | 200 |
drawPriv(currTime, tex, grid, df); |
201 |
DistortedFramebuffer.deleteAllMarked(); |
|
202 |
DistortedTexture.deleteAllMarked(); |
|
192 | 203 |
} |
193 | 204 |
|
194 | 205 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Major restructuring with DistortedTexture. One now is able to create Textures anywhere, even from a thread which does not hold the OpenGL context. Same for DistortedFramebuffers.