Revision d1e740c5
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/DistortedFramebuffer.java | ||
---|---|---|
194 | 194 |
} |
195 | 195 |
} |
196 | 196 |
|
197 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
198 |
// Set this as the Framebuffer to write to. |
|
199 |
|
|
200 |
void setAsOutput() |
|
201 |
{ |
|
202 |
if( texIds[0]==TEXTURE_NOT_CREATED_YET ) createFBO(); |
|
203 |
|
|
204 |
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, fboIds[0]); |
|
205 |
} |
|
206 |
|
|
207 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
208 |
// Set this as the Framebuffer to read from. |
|
209 |
|
|
210 |
void setAsInput() |
|
211 |
{ |
|
212 |
if( texIds[0]==TEXTURE_NOT_CREATED_YET ) createFBO(); |
|
213 |
|
|
214 |
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texIds[0]); |
|
215 |
} |
|
216 |
|
|
217 | 197 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
218 | 198 |
// PUBLIC API |
219 | 199 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
313 | 293 |
if( texIds[0]>0 ) markForDeletion(); |
314 | 294 |
} |
315 | 295 |
} |
296 |
|
|
297 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
298 |
/** |
|
299 |
* Set this as the Framebuffer to write to. |
|
300 |
*/ |
|
301 |
public void setAsOutput() |
|
302 |
{ |
|
303 |
if( texIds[0]==TEXTURE_NOT_CREATED_YET ) createFBO(); |
|
304 |
|
|
305 |
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, fboIds[0]); |
|
306 |
} |
|
307 |
|
|
308 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
309 |
/** |
|
310 |
* Set this as the Framebuffer to read from. |
|
311 |
*/ |
|
312 |
public void setAsInput() |
|
313 |
{ |
|
314 |
if( texIds[0]==TEXTURE_NOT_CREATED_YET ) createFBO(); |
|
315 |
|
|
316 |
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texIds[0]); |
|
317 |
} |
|
318 |
|
|
316 | 319 |
} |
Also available in: Unified diff
Move the 'Save' app to using a DistortedFramebuffer.