1 |
da9b3f07
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2016 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Distorted. //
|
5 |
|
|
// //
|
6 |
|
|
// Distorted is free software: you can redistribute it and/or modify //
|
7 |
|
|
// it under the terms of the GNU General Public License as published by //
|
8 |
|
|
// the Free Software Foundation, either version 2 of the License, or //
|
9 |
|
|
// (at your option) any later version. //
|
10 |
|
|
// //
|
11 |
|
|
// Distorted is distributed in the hope that it will be useful, //
|
12 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14 |
|
|
// GNU General Public License for more details. //
|
15 |
|
|
// //
|
16 |
|
|
// You should have received a copy of the GNU General Public License //
|
17 |
|
|
// along with Distorted. If not, see <http://www.gnu.org/licenses/>. //
|
18 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
|
20 |
|
|
package org.distorted.library.effect;
|
21 |
|
|
|
22 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
23 |
|
|
|
24 |
|
|
/**
|
25 |
|
|
* Types of Effects one can add to the DistortedEffects queues.
|
26 |
|
|
* <p>
|
27 |
|
|
* Each effect type goes to an independent queue; the queues get executed one-by-one
|
28 |
|
|
* and are each a class descendant from EffectQueue.
|
29 |
|
|
*/
|
30 |
|
|
|
31 |
|
|
public enum EffectType
|
32 |
|
|
{
|
33 |
|
|
/**
|
34 |
|
|
* Effects that change the ModelView matrix: Rotations, Moves, Shears, Scales.
|
35 |
|
|
*/
|
36 |
|
|
MATRIX,
|
37 |
|
|
/**
|
38 |
|
|
* Effects that get executed in the Vertex shader: various distortions of the vertices.
|
39 |
|
|
*/
|
40 |
|
|
VERTEX,
|
41 |
|
|
/**
|
42 |
|
|
* Effects executed in the Fragment shader: changes of color, hue, transparency levels, etc.
|
43 |
|
|
*/
|
44 |
|
|
FRAGMENT,
|
45 |
|
|
/**
|
46 |
|
|
* Postprocessing effects done to the texture the first stage fragment shader created
|
47 |
|
|
*/
|
48 |
|
|
POSTPROCESS;
|
49 |
|
|
|
50 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
51 |
faa3ff56
|
Leszek Koltunski
|
/**
|
52 |
|
|
* Number of effect types.
|
53 |
|
|
* Only for use by the library itself.
|
54 |
|
|
*
|
55 |
|
|
* @y.exclude
|
56 |
|
|
*/
|
57 |
|
|
public static final int LENGTH = values().length;
|
58 |
|
|
/**
|
59 |
|
|
* Needed when we do bitwise operations on Effect Types.
|
60 |
|
|
* Only for use by the library itself.
|
61 |
|
|
*
|
62 |
|
|
* @y.exclude
|
63 |
|
|
*/
|
64 |
|
|
public static final int MASK= (1<<LENGTH)-1;
|
65 |
da9b3f07
|
Leszek Koltunski
|
|
66 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
67 |
faa3ff56
|
Leszek Koltunski
|
/**
|
68 |
|
|
* Only for use by the library itself.
|
69 |
|
|
*
|
70 |
|
|
* @y.exclude
|
71 |
|
|
*/
|
72 |
da9b3f07
|
Leszek Koltunski
|
public static void reset(int[] maxtable)
|
73 |
|
|
{
|
74 |
|
|
maxtable[0] =10; // By default, there can be a maximum 10 MATRIX effects in a single
|
75 |
|
|
// EffectQueueMatrix at any given time. This can be changed with a call
|
76 |
|
|
// to EffectQueueMatrix.setMax(int)
|
77 |
|
|
maxtable[1] = 5; // Max 5 VERTEX Effects
|
78 |
|
|
maxtable[2] = 5; // Max 5 FRAGMENT Effects
|
79 |
|
|
maxtable[3] = 5; // Max 5 POSTPROCESSING Effects
|
80 |
|
|
}
|
81 |
|
|
}
|