Revision 2878c554
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java | ||
---|---|---|
56 | 56 |
private DistortedTexture mLeaf; |
57 | 57 |
private DistortedScreen mScreen; |
58 | 58 |
private int mScreenW, mScreenH; |
59 |
private int mPrevRendered, mCurrRendered; |
|
59 | 60 |
|
60 | 61 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
61 | 62 |
|
... | ... | |
63 | 64 |
{ |
64 | 65 |
mView = v; |
65 | 66 |
|
67 |
mPrevRendered = 0; |
|
68 |
mCurrRendered = 0; |
|
69 |
|
|
66 | 70 |
mLeaf = new DistortedTexture(LEAF_SIZE,LEAF_SIZE); |
67 | 71 |
MeshFlat mesh = new MeshFlat(1,1); |
68 | 72 |
DistortedEffects effects = new DistortedEffects(); |
... | ... | |
121 | 125 |
public void onDrawFrame(GL10 glUnused) |
122 | 126 |
{ |
123 | 127 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT); |
124 |
mScreen.render(System.currentTimeMillis()); |
|
128 |
mCurrRendered = mScreen.render(System.currentTimeMillis()); |
|
129 |
|
|
130 |
if( mCurrRendered!=mPrevRendered ) |
|
131 |
{ |
|
132 |
mPrevRendered = mCurrRendered; |
|
133 |
android.util.Log.d("Olympic", "rendered: "+mCurrRendered+" objects"); |
|
134 |
} |
|
125 | 135 |
} |
126 | 136 |
|
127 | 137 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java | ||
---|---|---|
374 | 374 |
if( objectID == gffaID ) |
375 | 375 |
{ |
376 | 376 |
mScreen.detach(mGFFAEffects); |
377 |
mGFFAEffects.abortAllEffects(); |
|
378 | 377 |
mGFFATexture.markForDeletion(); |
379 | 378 |
|
380 | 379 |
int screenW=mScreen.getWidth(); |
... | ... | |
400 | 399 |
else if( objectID==logoID ) |
401 | 400 |
{ |
402 | 401 |
mScreen.detach(mLogoEffects); |
403 |
mLogoEffects.abortAllEffects(); |
|
404 | 402 |
mLogoTexture.markForDeletion(); |
405 | 403 |
|
406 | 404 |
int crawlW = mCrawlTexture.getWidth(); |
... | ... | |
433 | 431 |
{ |
434 | 432 |
mScreen.detach(mBackground); |
435 | 433 |
mBackground.detach(mCrawlEffects); |
436 |
mCrawlEffects.abortAllEffects(); |
|
437 | 434 |
mCrawlTexture.markForDeletion(); |
438 | 435 |
mCrawlBackgroundEffects.abortAllEffects(); |
439 | 436 |
mCrawlBackgroundTexture.markForDeletion(); |
Also available in: Unified diff
- workaround for the issue with flashing in StarWars
- return number of objects rendered from OutputSurface.render() and use this in Olympic
- rework tree isomorphism so that it now works even if we don't render the whole tree (and also we don't have to reset() the Tree anymore!)
- current a buf with tree isomorphism: Leaf Nodes have the same NodeData only if they agree in Surface AND Effects!