Project

General

Profile

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

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

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.DistortedLibrary;
25

    
26
/**
27
 *  Thrown asynchronously by the library whenever shader compilation fails.
28
 *  If compilation of the Vertex Shader fails because of too many uniforms there, i.e. because
29
 *  we have set {@link DistortedLibrary#setMax(org.distorted.library.effect.EffectType, int)}
30
 *  to too high value.
31
 */
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
  }
(6-6/6)