Project

General

Profile

Download (1.97 KB) Statistics
| Branch: | Revision:

library / src / main / java / org / distorted / library / EffectTypes.java @ c6e1c219

1
package org.distorted.library;
2

    
3
///////////////////////////////////////////////////////////////////////////////////////////////////
4
/**
5
 * Types of Effects one can apply to DistortedObjects.
6
 * <p>
7
 * Each effect type goes to an independent queue; the queues get executed one-by-one
8
 * and are each a class descendant from EffectQueue.
9
 */
10
public enum EffectTypes
11
  {
12
  /**
13
   * Effects that change the ModelView matrix: Rotations, Moves, Shears, Scales.
14
   */
15
  MATRIX   ( 0x1 ),   // we will need to perform bitwise operations on those - so keep the values 1,2,4,8...
16
  /**
17
   * Effects that get executed in the Vertex shader: various distortions of the vertices.
18
   */
19
  VERTEX   ( 0x2 ),
20
  /**
21
   * Effects executed in the Fragment shader: changes of color, hue, transparency levels, etc.
22
   */
23
  FRAGMENT ( 0x4 ),
24
  /**
25
   * Effects that did not belong to anywhere else - currently only saving the contents of underlying
26
   * Surface to a PNG or a MP4 file.
27
   */
28
  OTHER    ( 0x8 );
29

    
30
///////////////////////////////////////////////////////////////////////////////////////////////////
31

    
32
  final static int LENGTH = values().length;  // The number of effect types.
33
  final static int MASK= (1<<LENGTH)-1;       // Needed when we do bitwise operations on Effect Types.
34

    
35
  final int type;
36

    
37
  EffectTypes(int type)
38
    {
39
    this.type = type;
40
    }
41

    
42
///////////////////////////////////////////////////////////////////////////////////////////////////
43
// called from EffectQueue
44

    
45
  static void reset(int[] maxtable)
46
    {
47
    maxtable[0] = 5;  // By default, there can be a maximum 5 MATRIX effects acting on a single
48
                      // DistortedObject at any given time. This can be changed with a call to
49
                      // EffectQueueMatrix.setMax(int)
50

    
51
    maxtable[1] = 5;  // Max 5 VERTEX Effects
52
    maxtable[2] = 5;  // Max 5 FRAGMENT Effects
53
    maxtable[3] = 5;  // Max 5 OTHER Effects
54
    }
55
///////////////////////////////////////////////////////////////////////////////////////////////////
56
  }
(17-17/30)