Project

General

Profile

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

library / src / main / java / org / distorted / library / program / FragmentUniformsException.java @ d23592bb

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2016 Leszek Koltunski  leszek@koltunski.pl                                          //
3
//                                                                                               //
4
// This file is part of Distorted.                                                               //
5
//                                                                                               //
6
// This library is free software; you can redistribute it and/or                                 //
7
// modify it under the terms of the GNU Lesser General Public                                    //
8
// License as published by the Free Software Foundation; either                                  //
9
// version 2.1 of the License, or (at your option) any later version.                            //
10
//                                                                                               //
11
// This library 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 GNU                             //
14
// Lesser General Public License for more details.                                               //
15
//                                                                                               //
16
// You should have received a copy of the GNU Lesser General Public                              //
17
// License along with this library; if not, write to the Free Software                           //
18
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA                //
19
///////////////////////////////////////////////////////////////////////////////////////////////////
20

    
21
package org.distorted.library.program;
22

    
23
///////////////////////////////////////////////////////////////////////////////////////////////////
24

    
25
import org.distorted.library.main.DistortedLibrary;
26

    
27
/**
28
 *  Thrown asynchronously by the library whenever shader compilation fails.
29
 *  If compilation of the fragment shader fails because of too many uniforms there, i.e. because
30
 *  we have set {@link DistortedLibrary#setMax(org.distorted.library.effect.EffectType, int)}
31
 *  to too high value.
32
 */
33

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

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

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

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

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

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