Project

General

Profile

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

library / src / main / java / org / distorted / library / program / VertexUniformsException.java @ 72ef21f7

1 d333eb6b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2016 Leszek Koltunski                                                               //
3
//                                                                                               //
4 46b572b5 Leszek Koltunski
// This file is part of Distorted.                                                               //
5 d333eb6b Leszek Koltunski
//                                                                                               //
6 46b572b5 Leszek Koltunski
// Distorted is free software: you can redistribute it and/or modify                             //
7 d333eb6b Leszek Koltunski
// 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 46b572b5 Leszek Koltunski
// Distorted is distributed in the hope that it will be useful,                                  //
12 d333eb6b Leszek Koltunski
// 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 46b572b5 Leszek Koltunski
// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
18 d333eb6b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20 432442f9 Leszek Koltunski
package org.distorted.library.program;
21 6a06a912 Leszek Koltunski
22
///////////////////////////////////////////////////////////////////////////////////////////////////
23 fe82a979 Leszek Koltunski
24 7602a827 Leszek Koltunski
import org.distorted.library.main.DistortedLibrary;
25 fe82a979 Leszek Koltunski
26 6a06a912 Leszek Koltunski
/**
27 72ef21f7 Leszek Koltunski
 *  Thrown by {@link DistortedLibrary#onSurfaceCreated(android.content.Context, org.distorted.library.main.DistortedLibrary.ExceptionListener)}
28 6a06a912 Leszek Koltunski
 *  if compilation of the Vertex Shader fails because of too many uniforms there, i.e. because
29 46b572b5 Leszek Koltunski
 *  we have set {@link DistortedLibrary#setMax(org.distorted.library.effect.EffectType, int)}
30 6ba8be09 Leszek Koltunski
 *  to too high value.
31 6a06a912 Leszek Koltunski
 */
32
33
@SuppressWarnings("serial")
34
public class VertexUniformsException extends Exception 
35
  {
36
  private int max=0;
37
  
38
///////////////////////////////////////////////////////////////////////////////////////////////////
39
/**
40
 * Default empty constructor  
41
 */      
42
  public VertexUniformsException() 
43
    {
44
   
45
    }
46
47
///////////////////////////////////////////////////////////////////////////////////////////////////
48
/**
49
 * Constructor with a message describing why compilation failed.  
50
 *   
51
 * @param detailMessage Message describing why compilation failed
52
 */   
53
  public VertexUniformsException(String detailMessage) 
54
    {
55
    super(detailMessage);
56
    }
57
58
///////////////////////////////////////////////////////////////////////////////////////////////////
59
/**
60
 * Constructor necessary to make Chained Exceptions working.
61
 *  
62
 * @param throwable The parent Throwable.
63
 */ 
64
  public VertexUniformsException(Throwable throwable) 
65
    {
66
    super(throwable);
67
    }
68
69
///////////////////////////////////////////////////////////////////////////////////////////////////
70
/**
71
 * Constructor necessary to make Chained Exceptions working.
72
 *   
73
 * @param detailMessage Message describing why compilation failed
74
 * @param throwable The parent Throwable.
75
 */    
76
  public VertexUniformsException(String detailMessage, Throwable throwable) 
77
    {
78
    super(detailMessage, throwable);
79
    }
80
81
///////////////////////////////////////////////////////////////////////////////////////////////////
82
/**
83
 * Constructor with a message describing why compilation failed and integer holding the maximum
84
 * number of uniforms in Vertex Shader supported by current hardware.   
85
 *   
86
 * @param detailMessage Message describing why compilation failed
87
 * @param m maximum number of uniforms in Vertex Shader supported by current hardware.   
88
 */     
89
  public VertexUniformsException(String detailMessage, int m) 
90
    {
91
    super(detailMessage);
92
    max = m;
93
    }
94
95
///////////////////////////////////////////////////////////////////////////////////////////////////  
96
/**
97
 * Gets the maximum number of uniforms in Vertex Shader supported by current hardware.
98
 * 
99
 * @return Maximum number of uniforms in Vertex Shader supported by current hardware.   
100
 */
101
  public int getMax()
102
    {
103
    return max;  
104
    }
105
  
106
///////////////////////////////////////////////////////////////////////////////////////////////////  
107
  }