Revision 4c1dd6e9
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/Distorted.java | ||
---|---|---|
382 | 382 |
return EffectQueue.getMax(EffectTypes.FRAGMENT.ordinal()); |
383 | 383 |
} |
384 | 384 |
|
385 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
386 |
/** |
|
387 |
* Returns the maximum number of Postprocess effects. |
|
388 |
* |
|
389 |
* @return The maximum number of Postprocess effects |
|
390 |
*/ |
|
391 |
public static int getMaxPostprocess() |
|
392 |
{ |
|
393 |
return EffectQueue.getMax(EffectTypes.POSTPROCESS.ordinal()); |
|
394 |
} |
|
395 |
|
|
385 | 396 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
386 | 397 |
/** |
387 | 398 |
* Sets the maximum number of Matrix effects that can be stored in a single EffectQueue at one time. |
... | ... | |
444 | 455 |
{ |
445 | 456 |
return EffectQueue.setMax(EffectTypes.FRAGMENT.ordinal(),max); |
446 | 457 |
} |
458 |
|
|
459 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
460 |
/** |
|
461 |
* Sets the maximum number of Postprocess effects that can be stored in a single EffectQueue at one time. |
|
462 |
* This can fail if: |
|
463 |
* <ul> |
|
464 |
* <li>the value of 'max' is outside permitted range (0 ≤ max ≤ Byte.MAX_VALUE) |
|
465 |
* <li>We try to increase the value of 'max' when it is too late to do so already. It needs to be called |
|
466 |
* before the Fragment Shader gets compiled, i.e. before the call to {@link #onSurfaceCreated}. After this |
|
467 |
* time only decreasing the value of 'max' is permitted. |
|
468 |
* <li>Furthermore, this needs to be called before any instances of the DistortedEffects class get created. |
|
469 |
* </ul> |
|
470 |
* |
|
471 |
* @param max new maximum number of simultaneous Postprocess Effects. Has to be a non-negative number not greater |
|
472 |
* than Byte.MAX_VALUE |
|
473 |
* @return <code>true</code> if operation was successful, <code>false</code> otherwise. |
|
474 |
*/ |
|
475 |
public static boolean setMaxPostprocess(int max) |
|
476 |
{ |
|
477 |
return EffectQueue.setMax(EffectTypes.POSTPROCESS.ordinal(),max); |
|
478 |
} |
|
447 | 479 |
} |
Also available in: Unified diff
Beginnings of support for postprocessing Effects.