Project

General

Profile

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

library / src / main / java / org / distorted / library / program / VertexUniformsException.java @ fe82a979

1
///////////////////////////////////////////////////////////////////////////////////////////////////
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.program;
21

    
22
///////////////////////////////////////////////////////////////////////////////////////////////////
23

    
24
import org.distorted.library.main.Distorted;
25

    
26
/**
27
 *  Thrown by {@link Distorted#onCreate(android.content.Context)}
28
 *  if compilation of the Vertex Shader fails because of too many uniforms there, i.e. because
29
 *  we have set {@link Distorted#setMaxVertex(int)} to too high value.
30
 */
31

    
32
@SuppressWarnings("serial")
33
public class VertexUniformsException extends Exception 
34
  {
35
  private int max=0;
36
  
37
///////////////////////////////////////////////////////////////////////////////////////////////////
38
/**
39
 * Default empty constructor  
40
 */      
41
  public VertexUniformsException() 
42
    {
43
   
44
    }
45

    
46
///////////////////////////////////////////////////////////////////////////////////////////////////
47
/**
48
 * Constructor with a message describing why compilation failed.  
49
 *   
50
 * @param detailMessage Message describing why compilation failed
51
 */   
52
  public VertexUniformsException(String detailMessage) 
53
    {
54
    super(detailMessage);
55
    }
56

    
57
///////////////////////////////////////////////////////////////////////////////////////////////////
58
/**
59
 * Constructor necessary to make Chained Exceptions working.
60
 *  
61
 * @param throwable The parent Throwable.
62
 */ 
63
  public VertexUniformsException(Throwable throwable) 
64
    {
65
    super(throwable);
66
    }
67

    
68
///////////////////////////////////////////////////////////////////////////////////////////////////
69
/**
70
 * Constructor necessary to make Chained Exceptions working.
71
 *   
72
 * @param detailMessage Message describing why compilation failed
73
 * @param throwable The parent Throwable.
74
 */    
75
  public VertexUniformsException(String detailMessage, Throwable throwable) 
76
    {
77
    super(detailMessage, throwable);
78
    }
79

    
80
///////////////////////////////////////////////////////////////////////////////////////////////////
81
/**
82
 * Constructor with a message describing why compilation failed and integer holding the maximum
83
 * number of uniforms in Vertex Shader supported by current hardware.   
84
 *   
85
 * @param detailMessage Message describing why compilation failed
86
 * @param m maximum number of uniforms in Vertex Shader supported by current hardware.   
87
 */     
88
  public VertexUniformsException(String detailMessage, int m) 
89
    {
90
    super(detailMessage);
91
    max = m;
92
    }
93

    
94
///////////////////////////////////////////////////////////////////////////////////////////////////  
95
/**
96
 * Gets the maximum number of uniforms in Vertex Shader supported by current hardware.
97
 * 
98
 * @return Maximum number of uniforms in Vertex Shader supported by current hardware.   
99
 */
100
  public int getMax()
101
    {
102
    return max;  
103
    }
104
  
105
///////////////////////////////////////////////////////////////////////////////////////////////////  
106
  }
(6-6/6)