-
Notifications
You must be signed in to change notification settings - Fork 0
/
GlslangError.java
53 lines (47 loc) · 1.66 KB
/
GlslangError.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.destranix.glslang;
public enum GlslangError {
GlslangErrorNone(Main.GLSLANG_ERROR_NONE),
GlslangErrorInvalidLength(Main.GLSLANG_ERROR_INVALID_LENGTH),
GlslangErrorArrayIndexOutOfBounds(Main.GLSLANG_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS),
GlslangErrorNotYetImplemented(Main.GLSLANG_ERROR_NOT_YET_IMPLEMENTED),
GlslangErrorInvalidArgument(Main.GLSLANG_ERROR_INVALID_ARGUMENT);
private final int value;
private GlslangError(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static GlslangError valueByStr(String str) {
switch (str) {
case "GlslangErrorNone":
return GlslangErrorNone;
case "GlslangErrorInvalidLength":
return GlslangErrorInvalidLength;
case "GlslangErrorArrayIndexOutOfBounds":
return GlslangErrorArrayIndexOutOfBounds;
case "GlslangErrorNotYetImplemented":
return GlslangErrorNotYetImplemented;
case "GlslangErrorInvalidArgument":
return GlslangErrorInvalidArgument;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static GlslangError valueByConstant(int constant) {
switch (constant) {
case Main.GLSLANG_ERROR_NONE:
return GlslangErrorNone;
case Main.GLSLANG_ERROR_INVALID_LENGTH:
return GlslangErrorInvalidLength;
case Main.GLSLANG_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS:
return GlslangErrorArrayIndexOutOfBounds;
case Main.GLSLANG_ERROR_NOT_YET_IMPLEMENTED:
return GlslangErrorNotYetImplemented;
case Main.GLSLANG_ERROR_INVALID_ARGUMENT:
return GlslangErrorInvalidArgument;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}