1 |
1e438fc7
|
Leszek Koltunski
|
package org.distorted.library;
|
2 |
|
|
|
3 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
4 |
e1e275c1
|
Leszek Koltunski
|
/**
|
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 |
1e438fc7
|
Leszek Koltunski
|
public enum EffectTypes
|
11 |
|
|
{
|
12 |
e1e275c1
|
Leszek Koltunski
|
/**
|
13 |
|
|
* Matrix effects - i.e. effect 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 |
|
|
* Vertex Effects - i.e. those that get executed in the Vertex shader. Generally various distortions
|
18 |
|
|
* of the vertices.
|
19 |
|
|
*/
|
20 |
|
|
VERTEX ( 0x2 ),
|
21 |
|
|
/**
|
22 |
|
|
* Fragment Effects - executed in the Fragment shader. Changes of color, hue, transparency levels, etc.
|
23 |
|
|
*/
|
24 |
|
|
FRAGMENT ( 0x4 ),
|
25 |
|
|
/**
|
26 |
|
|
* effects that did not belong to anywhere else - currently saving the contents of underlying Surface
|
27 |
|
|
* to a PNG or a MP4 file.
|
28 |
|
|
*/
|
29 |
|
|
OTHER ( 0x8 );
|
30 |
1e438fc7
|
Leszek Koltunski
|
|
31 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
32 |
|
|
|
33 |
|
|
final static int LENGTH = values().length; // The number of effect types.
|
34 |
|
|
final static int MASK= (1<<LENGTH)-1; // Needed when we do bitwise operations on Effect Types.
|
35 |
|
|
|
36 |
e1e275c1
|
Leszek Koltunski
|
final int type;
|
37 |
1e438fc7
|
Leszek Koltunski
|
|
38 |
|
|
EffectTypes(int type)
|
39 |
|
|
{
|
40 |
|
|
this.type = type;
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
44 |
d07f2950
|
Leszek Koltunski
|
// called from EffectQueue
|
45 |
1e438fc7
|
Leszek Koltunski
|
|
46 |
|
|
static void reset(int[] maxtable)
|
47 |
|
|
{
|
48 |
|
|
maxtable[0] = 5; // By default, there can be a maximum 5 MATRIX effects acting on a single
|
49 |
|
|
// DistortedObject at any given time. This can be changed with a call to
|
50 |
d07f2950
|
Leszek Koltunski
|
// EffectQueueMatrix.setMax(int)
|
51 |
1e438fc7
|
Leszek Koltunski
|
|
52 |
|
|
maxtable[1] = 5; // Max 5 VERTEX Effects
|
53 |
|
|
maxtable[2] = 5; // Max 5 FRAGMENT Effects
|
54 |
|
|
maxtable[3] = 5; // Max 5 OTHER Effects
|
55 |
|
|
}
|
56 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
57 |
|
|
}
|