1 |
d333eb6b
|
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 |
432442f9
|
Leszek Koltunski
|
package org.distorted.library.program;
|
21 |
6a06a912
|
Leszek Koltunski
|
|
22 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
23 |
|
|
/**
|
24 |
432442f9
|
Leszek Koltunski
|
* Thrown by {@link org.distorted.library.Distorted#onCreate(android.content.Context)}
|
25 |
6a06a912
|
Leszek Koltunski
|
* if compilation of the fragment shader fails because of too many uniforms there, i.e. because
|
26 |
|
|
* we have set {@link org.distorted.library.Distorted#setMaxFragment(int)} to too high value.
|
27 |
|
|
*/
|
28 |
|
|
|
29 |
|
|
@SuppressWarnings("serial")
|
30 |
|
|
public class FragmentUniformsException extends Exception
|
31 |
|
|
{
|
32 |
|
|
private int max=0;
|
33 |
|
|
|
34 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
35 |
|
|
/**
|
36 |
|
|
* Default empty constructor
|
37 |
|
|
*/
|
38 |
|
|
public FragmentUniformsException()
|
39 |
|
|
{
|
40 |
|
|
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
44 |
|
|
/**
|
45 |
|
|
* Constructor with a message describing why compilation failed.
|
46 |
|
|
*
|
47 |
|
|
* @param detailMessage Message describing why compilation failed
|
48 |
|
|
*/
|
49 |
|
|
public FragmentUniformsException(String detailMessage)
|
50 |
|
|
{
|
51 |
|
|
super(detailMessage);
|
52 |
|
|
}
|
53 |
|
|
|
54 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
55 |
|
|
/**
|
56 |
|
|
* Constructor necessary to make Chained Exceptions working.
|
57 |
|
|
*
|
58 |
|
|
* @param throwable The parent Throwable.
|
59 |
|
|
*/
|
60 |
|
|
public FragmentUniformsException(Throwable throwable)
|
61 |
|
|
{
|
62 |
|
|
super(throwable);
|
63 |
|
|
}
|
64 |
|
|
|
65 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
66 |
|
|
/**
|
67 |
|
|
* Constructor necessary to make Chained Exceptions working.
|
68 |
|
|
*
|
69 |
|
|
* @param detailMessage Message describing why compilation failed
|
70 |
|
|
* @param throwable The parent Throwable.
|
71 |
|
|
*/
|
72 |
|
|
public FragmentUniformsException(String detailMessage, Throwable throwable)
|
73 |
|
|
{
|
74 |
|
|
super(detailMessage, throwable);
|
75 |
|
|
}
|
76 |
|
|
|
77 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
78 |
|
|
/**
|
79 |
|
|
* Constructor with a message describing why compilation failed and integer holding the maximum
|
80 |
|
|
* number of uniforms in Fragment Shader supported by current hardware.
|
81 |
|
|
*
|
82 |
|
|
* @param detailMessage Message describing why compilation failed
|
83 |
|
|
* @param m maximum number of uniforms in Fragment Shader supported by current hardware.
|
84 |
|
|
*/
|
85 |
|
|
public FragmentUniformsException(String detailMessage, int m)
|
86 |
|
|
{
|
87 |
|
|
super(detailMessage);
|
88 |
|
|
max = m;
|
89 |
|
|
}
|
90 |
|
|
|
91 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
92 |
|
|
/**
|
93 |
|
|
* Gets the maximum number of uniforms in fragment shader supported by current hardware.
|
94 |
|
|
*
|
95 |
|
|
* @return Maximum number of uniforms in fragment shader supported by current hardware.
|
96 |
|
|
*/
|
97 |
|
|
public int getMax()
|
98 |
|
|
{
|
99 |
|
|
return max;
|
100 |
|
|
}
|
101 |
|
|
|
102 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
103 |
|
|
}
|