Project

General

Profile

« Previous | Next » 

Revision cacc63de

Added by Leszek Koltunski over 7 years ago

Fix Lint warnings, correct a lot of comments, adjust EffectListener interface.

View differences:

src/main/java/org/distorted/library/Distorted.java
37 37
public class Distorted 
38 38
  {
39 39
  /**
40
   * When creating an instance of a DistortedObject from another instance, do not clone anything.
40
   * When creating an instance of a DistortedTexture (or Tree) from another instance, do not clone anything.
41 41
   * Used in the copy constructor.
42 42
   */
43 43
  public static final int CLONE_NOTHING = 0x0;
44 44
  /**
45
   * When creating an instance of a DistortedObject from another instance, clone the Bitmap that's
46
   * backing up our DistortedObject. 
45
   * When creating an instance of a DistortedTexture from another instance, clone the Bitmap that's
46
   * backing up our DistortedTexture.
47 47
   * <p>
48
   * This way we can have two DistortedObjects, both backed up by the same Bitmap, to which we can 
48
   * This way we can have two DistortedTextures, both backed up by the same Bitmap, to which we can
49 49
   * apply different effects. Used in the copy constructor.
50 50
   */
51 51
  public static final int CLONE_BITMAP  = 0x1;
52 52
  /**
53
   * When creating an instance of a DistortedObject from another instance, clone the Matrix Effects.
53
   * When creating an instance of a DistortedEffects from another instance, clone the Matrix Effects.
54 54
   * <p>
55
   * This way we can have two different DistortedObjects with different Bitmaps behind them, both 
56
   * always displayed in exactly the same place on the screen. Applying any matrix-based effect to 
57
   * one of them automatically applies the effect to the other. Used in the copy constructor.
55
   * This way we can have two different DistortedEffects sharing the MATRIX queue.
58 56
   */
59 57
  public static final int CLONE_MATRIX = 0x2;
60 58
  /**
61
   * When creating an instance of a DistortedObject from another instance, clone the Vertex Effects.
59
   * When creating an instance of a DistortedEffects from another instance, clone the Vertex Effects.
62 60
   * <p>
63
   * This way we can have two different DistortedObjects with different Bitmaps behind them, both 
64
   * always with the same Vertex effects. Applying any vertex-based effect to one of them automatically 
65
   * applies the effect to the other. Used in the copy constructor.
61
   * This way we can have two different DistortedEffects sharing the VERTEX queue.
66 62
   */
67 63
  public static final int CLONE_VERTEX  = 0x4;
68 64
  /**
69
   * When creating an instance of a DistortedObject from another instance, clone the Fragment Effects.
65
   * When creating an instance of a DistortedEffects from another instance, clone the Fragment Effects.
70 66
   * <p>
71
   * This way we can have two different DistortedObjects with different Bitmaps behind them, both 
72
   * always with the same Fragment effects. Applying any fragment-based effect to one of them automatically 
73
   * applies the effect to the other. Used in the copy constructor.
67
   * This way we can have two different DistortedEffects sharing the FRAGMENT queue.
74 68
   */
75 69
  public static final int CLONE_FRAGMENT= 0x8;
76 70
  /**
77 71
   * When creating an instance of a DistortedTree from another instance, clone the children Nodes.
78 72
   * <p>
79
   * This is mainly useful for creating many similar sub-trees of Bitmaps and rendering then at different places
80
   * on the screen, with (optionally) different effects of the top-level root Bitmap.   
73
   * This is mainly useful for creating many similar sub-trees and rendering then at different places
74
   * on the screen with (optionally) different Effects.
81 75
   */
82 76
  public static final int CLONE_CHILDREN= 0x10;
83 77

  
......
391 385

  
392 386
///////////////////////////////////////////////////////////////////////////////////////////////////
393 387
/**
394
 * Sets the maximum number of Matrix effects that can be applied to a single DistortedObject at one time.
388
 * Sets the maximum number of Matrix effects that can be stored in a single EffectQueue at one time.
395 389
 * This can fail if:
396 390
 * <ul>
397 391
 * <li>the value of 'max' is outside permitted range (0 &le; max &le; Byte.MAX_VALUE)
398 392
 * <li>We try to increase the value of 'max' when it is too late to do so already. It needs to be called
399 393
 *     before the Vertex Shader gets compiled, i.e. before the call to {@link #onSurfaceCreated}. After this
400 394
 *     time only decreasing the value of 'max' is permitted.
401
 * <li>Furthermore, this needs to be called before any DistortedObject gets created.
395
 * <li>Furthermore, this needs to be called before any DistortedEffects gets created.
402 396
 * </ul>
403 397
 * 
404 398
 * @param max new maximum number of simultaneous Matrix Effects. Has to be a non-negative number not greater
......
412 406
  
413 407
///////////////////////////////////////////////////////////////////////////////////////////////////
414 408
/**
415
 * Sets the maximum number of Vertex effects that can be applied to a single DistortedObject at one time.
409
 * Sets the maximum number of Vertex effects that can be stored in a single EffectQueue at one time.
416 410
 * This can fail if:
417 411
 * <ul>
418 412
 * <li>the value of 'max' is outside permitted range (0 &le; max &le; Byte.MAX_VALUE)
419 413
 * <li>We try to increase the value of 'max' when it is too late to do so already. It needs to be called 
420 414
 *     before the Vertex Shader gets compiled, i.e. before the call to {@link #onSurfaceCreated}. After this
421 415
 *     time only decreasing the value of 'max' is permitted.
422
* <li>Furthermore, this needs to be called before any DistortedObject gets created.
416
* <li>Furthermore, this needs to be called before any DistortedEffects get created.
423 417
 * </ul>
424 418
 * 
425 419
 * @param max new maximum number of simultaneous Vertex Effects. Has to be a non-negative number not greater
......
433 427

  
434 428
///////////////////////////////////////////////////////////////////////////////////////////////////
435 429
/**
436
 * Sets the maximum number of Fragment effects that can be applied to a single DistortedObject at one time.
430
 * Sets the maximum number of Fragment effects that can be stored in a single EffectQueue at one time.
437 431
 * This can fail if:
438 432
 * <ul>
439 433
 * <li>the value of 'max' is outside permitted range (0 &le; max &le; Byte.MAX_VALUE)
440 434
 * <li>We try to increase the value of 'max' when it is too late to do so already. It needs to be called 
441 435
 *     before the Fragment Shader gets compiled, i.e. before the call to {@link #onSurfaceCreated}. After this
442 436
 *     time only decreasing the value of 'max' is permitted.
443
 * <li>Furthermore, this needs to be called before any DistortedObject gets created.
437
 * <li>Furthermore, this needs to be called before any DistortedEffects get created.
444 438
 * </ul>
445 439
 * 
446 440
 * @param max new maximum number of simultaneous Fragment Effects. Has to be a non-negative number not greater

Also available in: Unified diff