Revision 6979a0e0
Added by Leszek Koltunski almost 5 years ago
| src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldRenderer.java | ||
|---|---|---|
| 135 | 135 |
mScreen.detachAll(); |
| 136 | 136 |
mScreen.attach(mTexture, mEffects, mMesh); |
| 137 | 137 |
|
| 138 |
DistortedLibrary.setMax(EffectType.VERTEX ,13); |
|
| 139 |
DistortedLibrary.setMax(EffectType.FRAGMENT, 9); |
|
| 140 |
|
|
| 141 | 138 |
VertexEffectScale.enable(); |
| 142 | 139 |
VertexEffectDistort.enable(); |
| 143 | 140 |
VertexEffectSink.enable(); |
| src/main/java/org/distorted/examples/deferredjob/DeferredJobRenderer.java | ||
|---|---|---|
| 132 | 132 |
mScreen.detachAll(); |
| 133 | 133 |
mScreen.attach(mTexture,mEffects,mMesh); |
| 134 | 134 |
|
| 135 |
DistortedLibrary.setMax(EffectType.VERTEX, 11); |
|
| 136 | 135 |
VertexEffectRotate.enable(); |
| 137 | 136 |
|
| 138 | 137 |
DistortedLibrary.onSurfaceCreated(mView.getContext(),this); |
| src/main/java/org/distorted/examples/earth/EarthRenderer.java | ||
|---|---|---|
| 69 | 69 |
private static final int LEVEL = 40; |
| 70 | 70 |
private static final float FOV = 30.0f; |
| 71 | 71 |
private static final float NEAR = 0.1f; |
| 72 |
private static final int MAX_EFF = 20; |
|
| 73 | 72 |
private static final float SCALE = 1.10f; |
| 74 | 73 |
|
| 75 | 74 |
private GLSurfaceView mView; |
| ... | ... | |
| 267 | 266 |
{
|
| 268 | 267 |
is.close(); |
| 269 | 268 |
} |
| 270 |
catch(IOException e) { }
|
|
| 269 |
catch(IOException ignored) { }
|
|
| 271 | 270 |
} |
| 272 | 271 |
|
| 273 | 272 |
mTexture.setTexture(bitmap); |
| ... | ... | |
| 278 | 277 |
Effect.enableEffects(EffectType.FRAGMENT); |
| 279 | 278 |
Effect.enableEffects(EffectType.VERTEX); |
| 280 | 279 |
|
| 281 |
DistortedLibrary.setMax(EffectType.VERTEX , MAX_EFF); |
|
| 282 |
DistortedLibrary.setMax(EffectType.FRAGMENT, MAX_EFF); |
|
| 283 |
|
|
| 284 | 280 |
DistortedLibrary.onSurfaceCreated(mView.getContext(), this); |
| 285 | 281 |
} |
| 286 | 282 |
|
| src/main/java/org/distorted/examples/generic/GenericRenderer.java | ||
|---|---|---|
| 315 | 315 |
mCenterTexture.setTexture(bitmapC); |
| 316 | 316 |
mRegionTexture.setTexture(bitmapR); |
| 317 | 317 |
|
| 318 |
DistortedLibrary.setMax(EffectType.VERTEX ,10); |
|
| 319 |
DistortedLibrary.setMax(EffectType.FRAGMENT,10); |
|
| 320 |
|
|
| 321 | 318 |
Effect.enableEffects(EffectType.VERTEX); |
| 322 | 319 |
Effect.enableEffects(EffectType.FRAGMENT); |
| 323 | 320 |
Effect.enableEffects(EffectType.POSTPROCESS); |
| src/main/java/org/distorted/examples/girl/GirlRenderer.java | ||
|---|---|---|
| 205 | 205 |
mScreen.detachAll(); |
| 206 | 206 |
mScreen.attach(mTexture,mEffects,mMesh); |
| 207 | 207 |
|
| 208 |
DistortedLibrary.setMax(EffectType.VERTEX ,6); |
|
| 209 |
|
|
| 210 | 208 |
VertexEffectScale.enable(); |
| 211 | 209 |
VertexEffectDistort.enable(); |
| 212 | 210 |
VertexEffectSink.enable(); |
| src/main/java/org/distorted/examples/listener/ListenerRenderer.java | ||
|---|---|---|
| 28 | 28 |
|
| 29 | 29 |
import org.distorted.examples.R; |
| 30 | 30 |
|
| 31 |
import org.distorted.library.effect.EffectType; |
|
| 32 | 31 |
import org.distorted.library.effect.MatrixEffectScale; |
| 33 | 32 |
import org.distorted.library.effect.VertexEffectDistort; |
| 34 | 33 |
import org.distorted.library.main.DistortedLibrary; |
| ... | ... | |
| 46 | 45 |
import android.opengl.GLSurfaceView; |
| 47 | 46 |
|
| 48 | 47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 49 |
// Show how to use the setMax, notifyWhenFinished / effectFinished APIs
|
|
| 48 |
// Show how to use the notifyWhenFinished / effectFinished APIs |
|
| 50 | 49 |
|
| 51 | 50 |
class ListenerRenderer implements GLSurfaceView.Renderer, EffectListener, DistortedLibrary.ExceptionListener |
| 52 | 51 |
{
|
| ... | ... | |
| 162 | 161 |
{
|
| 163 | 162 |
is.close(); |
| 164 | 163 |
} |
| 165 |
catch(IOException e) { }
|
|
| 164 |
catch(IOException ignored) { }
|
|
| 166 | 165 |
} |
| 167 | 166 |
|
| 168 | 167 |
mBmpRatio = (float)bitmap.getHeight()/bitmap.getWidth(); |
| ... | ... | |
| 173 | 172 |
mScreen.detachAll(); |
| 174 | 173 |
mScreen.attach(mTexture,mEffects,mMesh); |
| 175 | 174 |
|
| 176 |
// Normally we can only hold no more than 5 (see EffectType.reset()) Vertex |
|
| 177 |
// effects at any given time. Here we want 12, so we need to increase the default. |
|
| 178 |
// We need to call this before we call onCreate; best done here. |
|
| 179 |
// After onCreate we can also call this but only to decrease this value! |
|
| 180 |
// |
|
| 181 |
// One more than we have bubbles at any given time because it can sometimes |
|
| 182 |
// happen that the old bubble is not yet removed when we add a new one. |
|
| 183 |
DistortedLibrary.setMax(EffectType.VERTEX,NUM_CONCURRENT_BUBBLES+1); |
|
| 184 | 175 |
VertexEffectDistort.enable(); |
| 185 | 176 |
|
| 186 | 177 |
DistortedLibrary.onSurfaceCreated(mView.getContext(), this); |
| src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java | ||
|---|---|---|
| 131 | 131 |
if( mTexture==null ) mTexture = new DistortedTexture(); |
| 132 | 132 |
|
| 133 | 133 |
VertexEffectDisappear.enable(); |
| 134 |
|
|
| 135 | 134 |
VertexEffectRotate.enable(); |
| 136 | 135 |
VertexEffectDeform.enable(); |
| 137 | 136 |
|
| 138 |
DistortedLibrary.setMax(EffectType.VERTEX, 16); |
|
| 139 |
|
|
| 140 | 137 |
DistortedLibrary.onSurfaceCreated(mView.getContext(), this); |
| 141 | 138 |
} |
| 142 | 139 |
|
| src/main/java/org/distorted/examples/meshjoin/MeshJoinRenderer.java | ||
|---|---|---|
| 129 | 129 |
mScreen.detachAll(); |
| 130 | 130 |
mScreen.attach(mTexture,mEffects,mMesh); |
| 131 | 131 |
|
| 132 |
DistortedLibrary.setMax(EffectType.VERTEX, 11); |
|
| 133 | 132 |
VertexEffectSink.enable(); |
| 134 | 133 |
|
| 135 | 134 |
DistortedLibrary.onSurfaceCreated(mView.getContext(), this); |
| src/main/java/org/distorted/examples/singlemesh/SingleMeshRenderer.java | ||
|---|---|---|
| 182 | 182 |
mScreen.detachAll(); |
| 183 | 183 |
mScreen.attach(mTexture,mEffects,mMesh); |
| 184 | 184 |
|
| 185 |
DistortedLibrary.setMax(EffectType.VERTEX, 15); |
|
| 186 | 185 |
VertexEffectRotate.enable(); |
| 187 | 186 |
|
| 188 | 187 |
DistortedLibrary.onSurfaceCreated(mView.getContext(), this); |
Also available in: Unified diff
Remove all the calls to DistortedLibrary.setMax() (except for app 'Check', which explictly checks this API)