-
Notifications
You must be signed in to change notification settings - Fork 0
/
EShSource.java
41 lines (35 loc) · 991 Bytes
/
EShSource.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
package com.destranix.glslang;
public enum EShSource {
EShSourceNone(Main.E_SH_SOURCE_NONE), EShSourceGlsl(Main.E_SH_SOURCE_GLSL), EShSourceHlsl(Main.E_SH_SOURCE_HLSL);
private final int value;
private EShSource(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static EShSource valueByStr(String str) {
switch (str) {
case "EShSourceNone":
return EShSourceNone;
case "EShSourceGlsl":
return EShSourceGlsl;
case "EShSourceHlsl":
return EShSourceHlsl;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static EShSource valueByConstant(int constant) {
switch (constant) {
case Main.E_SH_SOURCE_NONE:
return EShSourceNone;
case Main.E_SH_SOURCE_GLSL:
return EShSourceGlsl;
case Main.E_SH_SOURCE_HLSL:
return EShSourceHlsl;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}