add new files
This commit is contained in:
parent
4e90a93d68
commit
8038516a66
65 changed files with 7996 additions and 0 deletions
227
java/src/game/window/Bind.java
Normal file
227
java/src/game/window/Bind.java
Normal file
|
@ -0,0 +1,227 @@
|
|||
package game.window;
|
||||
|
||||
import game.Game;
|
||||
import game.color.TextColor;
|
||||
import game.gui.element.Element;
|
||||
import game.properties.IStringSerializable;
|
||||
import game.util.Util;
|
||||
import game.vars.CVar;
|
||||
import game.vars.CVarCategory;
|
||||
|
||||
public enum Bind implements IStringSerializable, CVar {
|
||||
FORWARD("forward", "Vorwärts", Keysym.W),
|
||||
LEFT("left", "Nach links", Keysym.A),
|
||||
BACKWARD("backward", "Rückwärts", Keysym.S),
|
||||
RIGHT("right", "Nach rechts", Keysym.D),
|
||||
UP("up", "Aufwärts, Springen", Keysym.SPACE),
|
||||
DOWN("down", "Abwärts, Langsam", Keysym.LEFT_CONTROL),
|
||||
FAST("fast", "Schneller", Keysym.LEFT_SHIFT),
|
||||
INVENTORY("inventory", "Inventar", Keysym.E),
|
||||
PRIMARY("primary", "Primäre Aktion", Button.MOUSE_LEFT),
|
||||
SECONDARY("secondary", "Sekundäre Aktion", Button.MOUSE_RIGHT),
|
||||
TERTIARY("tertiary", "Tertiäre Aktion", Button.MOUSE_MIDDLE),
|
||||
QUARTERNARY("quarternary", "Quartäre Aktion", Keysym.R),
|
||||
THROW("throw", "Weg werfen", Keysym.Q),
|
||||
SELECT1("select1", "Auswahl #1", Keysym.N1),
|
||||
SELECT2("select2", "Auswahl #2", Keysym.N2),
|
||||
SELECT3("select3", "Auswahl #3", Keysym.N3),
|
||||
SELECT4("select4", "Auswahl #4", Keysym.N4),
|
||||
SELECT5("select5", "Auswahl #5", Keysym.N5),
|
||||
SELECT6("select6", "Auswahl #6", Keysym.N6),
|
||||
SELECT7("select7", "Auswahl #7", Keysym.N7),
|
||||
SELECT8("select8", "Auswahl #8", Keysym.N8),
|
||||
SELECT9("select9", "Auswahl #9", Keysym.N9),
|
||||
COMMAND("command", "Befehl / Chat", Keysym.C),
|
||||
INFO("info", "Infos einblenden", Keysym.TAB),
|
||||
PERSPECTIVE("perspective", "Perspektive ändern", Keysym.F5),
|
||||
ZOOM("zoom", "Kamera zoomen", Keysym.Y),
|
||||
MENU("menu", "Menü", Keysym.ESCAPE),
|
||||
SCREENSHOT("screenshot", "Bildschirmfoto", Keysym.F10),
|
||||
SHOW("overlay", "Perf.-Anzeige", Keysym.F2),
|
||||
FULLSCREEN("fullscreen", "Vollbild", Keysym.F12),
|
||||
CHEAT("cheat", "Schummeln / Debug", Keysym.F3);
|
||||
|
||||
private static boolean windowActive;
|
||||
private static boolean inputEnabled;
|
||||
private static boolean mouseEnabled;
|
||||
private static Bind waitingFor;
|
||||
private static Keysym keyRelease;
|
||||
|
||||
private final String id;
|
||||
private final String name;
|
||||
private final Input defInput;
|
||||
|
||||
private Input input;
|
||||
private boolean pressed;
|
||||
private boolean active;
|
||||
|
||||
public static void updateBinds() {
|
||||
for(Bind bind : values()) {
|
||||
bind.update();
|
||||
}
|
||||
mouseEnabled = true;
|
||||
for(Wheel wheel : Wheel.values()) {
|
||||
wheel.reset();
|
||||
}
|
||||
}
|
||||
|
||||
public static void disableMouse() {
|
||||
mouseEnabled = false;
|
||||
}
|
||||
|
||||
public static boolean isInputEnabled() {
|
||||
return inputEnabled;
|
||||
}
|
||||
|
||||
public static void disableInput(Bind wait) {
|
||||
inputEnabled = false;
|
||||
waitingFor = wait;
|
||||
}
|
||||
|
||||
public static void disableInput(Keysym release) {
|
||||
inputEnabled = false;
|
||||
keyRelease = release;
|
||||
}
|
||||
|
||||
public static Bind getWaiting() {
|
||||
return waitingFor;
|
||||
}
|
||||
|
||||
public static void unsetWaiting() {
|
||||
waitingFor = null;
|
||||
}
|
||||
|
||||
public static void enableInput() {
|
||||
if(waitingFor == null && (keyRelease == null || !keyRelease.read()))
|
||||
inputEnabled = true;
|
||||
}
|
||||
|
||||
public static void setBind(Input input, boolean release) {
|
||||
if(waitingFor != null) {
|
||||
if(release) {
|
||||
if(input == keyRelease) {
|
||||
waitingFor.input = input;
|
||||
waitingFor = null;
|
||||
keyRelease = null;
|
||||
Game.getGame().setDirty();
|
||||
if(Game.getGame().open != null)
|
||||
Game.getGame().open.reformat();
|
||||
}
|
||||
}
|
||||
else if(keyRelease == null) {
|
||||
if(input instanceof Keysym) {
|
||||
keyRelease = (Keysym)input;
|
||||
}
|
||||
else {
|
||||
waitingFor.input = input;
|
||||
waitingFor = null;
|
||||
Game.getGame().setDirty();
|
||||
if(Game.getGame().open != null)
|
||||
Game.getGame().open.reformat();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isWindowActive() {
|
||||
return windowActive;
|
||||
}
|
||||
|
||||
public static void setWindowActive(boolean active) {
|
||||
windowActive = active;
|
||||
for(Wheel wheel : Wheel.values()) {
|
||||
wheel.reset();
|
||||
}
|
||||
}
|
||||
|
||||
private Bind(String id, String name, Input input) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.input = this.defInput = input;
|
||||
}
|
||||
|
||||
private void update() {
|
||||
boolean last = this.pressed;
|
||||
this.pressed = inputEnabled && windowActive && this.input != null && this.input.read();
|
||||
if(inputEnabled && this.input instanceof Button && !mouseEnabled)
|
||||
last = this.pressed;
|
||||
this.active = this.pressed && !last;
|
||||
}
|
||||
|
||||
public void setInput(Input input) {
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
public Input getInput() {
|
||||
return this.input;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getDisplay() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public boolean isDown() {
|
||||
return inputEnabled && this.pressed;
|
||||
}
|
||||
|
||||
public boolean isPressed() {
|
||||
return inputEnabled && this.active;
|
||||
}
|
||||
|
||||
public String getCVarName() {
|
||||
return "key_" + this.id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return TextColor.VIOLET + "key";
|
||||
}
|
||||
|
||||
public CVarCategory getCategory() {
|
||||
return CVarCategory.BIND;
|
||||
}
|
||||
|
||||
public boolean parse(String str) {
|
||||
if("none".equalsIgnoreCase(str)) {
|
||||
this.input = null;
|
||||
return true;
|
||||
}
|
||||
Input input = Util.parseEnum(Input.class, str, Keysym.class, Button.class, Wheel.class);
|
||||
if(input != null)
|
||||
this.input = input;
|
||||
return input != null;
|
||||
}
|
||||
|
||||
public String format() {
|
||||
return this.input != null ? this.input.getName() : "none";
|
||||
}
|
||||
|
||||
public String getDefault() {
|
||||
return this.defInput != null ? this.defInput.getName() : "none";
|
||||
}
|
||||
|
||||
public void setDefault() {
|
||||
this.input = this.defInput;
|
||||
}
|
||||
|
||||
public Element selector(int x, int y, int w, int h) {
|
||||
throw new UnsupportedOperationException("Kann kein Element für Tastenbelegung erstellen");
|
||||
}
|
||||
|
||||
public boolean isDefault() {
|
||||
return this.input == this.defInput;
|
||||
}
|
||||
|
||||
public boolean isDupe() {
|
||||
if(this.input == null)
|
||||
return false;
|
||||
for(Bind bind : values()) {
|
||||
if(this != bind && bind.input == this.input)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
51
java/src/game/window/Button.java
Normal file
51
java/src/game/window/Button.java
Normal file
|
@ -0,0 +1,51 @@
|
|||
package game.window;
|
||||
|
||||
import game.Game;
|
||||
|
||||
public enum Button implements Input {
|
||||
MOUSE_LEFT("lmb", "Linke Maustaste"),
|
||||
MOUSE_RIGHT("rmb", "Rechte Maustaste"),
|
||||
MOUSE_MIDDLE("mmb", "Mittlere Maustaste"),
|
||||
MOUSE_BTN_X("xmb", "Maustaste Seite 1"),
|
||||
MOUSE_BTN_Y("ymb", "Maustaste Seite 2"),
|
||||
MOUSE_BTN_A("m6", "Maustaste 6"),
|
||||
MOUSE_BTN_B("m7", "Maustaste 7"),
|
||||
MOUSE_BTN_C("m8", "Maustaste 8");
|
||||
|
||||
private static int buttons;
|
||||
|
||||
private final String id;
|
||||
private final String name;
|
||||
|
||||
private boolean down;
|
||||
|
||||
public static boolean isMouseDown() {
|
||||
return buttons != 0;
|
||||
}
|
||||
|
||||
private Button(String id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getDisplay() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public boolean read() {
|
||||
return Game.getGame().open == null && this.down;
|
||||
}
|
||||
|
||||
public void setDown(boolean down) {
|
||||
this.down = down;
|
||||
buttons = (buttons & ~(1 << this.ordinal())) | (down ? 1 << this.ordinal() : 0);
|
||||
}
|
||||
|
||||
public boolean isDown() {
|
||||
return this.down;
|
||||
}
|
||||
}
|
26
java/src/game/window/DisplayMode.java
Normal file
26
java/src/game/window/DisplayMode.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package game.window;
|
||||
|
||||
public class DisplayMode {
|
||||
public static final int VID_MODES = 28;
|
||||
|
||||
public final int width;
|
||||
public final int height;
|
||||
public final int refresh;
|
||||
|
||||
public DisplayMode(int width, int height, int refresh) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.refresh = refresh;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return String.format("%dx%d @ %d Hz", this.width, this.height, this.refresh);
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if(!(obj instanceof DisplayMode))
|
||||
return false;
|
||||
DisplayMode other = (DisplayMode)obj;
|
||||
return this.width == other.width && this.height == other.height && this.refresh == other.refresh;
|
||||
}
|
||||
}
|
8
java/src/game/window/Input.java
Normal file
8
java/src/game/window/Input.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package game.window;
|
||||
|
||||
import game.properties.IStringSerializable;
|
||||
import game.util.Displayable;
|
||||
|
||||
public interface Input extends IStringSerializable, Displayable {
|
||||
public boolean read();
|
||||
}
|
7
java/src/game/window/KeyEvent.java
Normal file
7
java/src/game/window/KeyEvent.java
Normal file
|
@ -0,0 +1,7 @@
|
|||
package game.window;
|
||||
|
||||
public enum KeyEvent {
|
||||
RELEASE,
|
||||
PRESS,
|
||||
REPEAT;
|
||||
}
|
141
java/src/game/window/Keysym.java
Normal file
141
java/src/game/window/Keysym.java
Normal file
|
@ -0,0 +1,141 @@
|
|||
package game.window;
|
||||
|
||||
public enum Keysym implements Input {
|
||||
N0('0'),
|
||||
N1('1'),
|
||||
N2('2'),
|
||||
N3('3'),
|
||||
N4('4'),
|
||||
N5('5'),
|
||||
N6('6'),
|
||||
N7('7'),
|
||||
N8('8'),
|
||||
N9('9'),
|
||||
|
||||
A('a'),
|
||||
B('b'),
|
||||
C('c'),
|
||||
D('d'),
|
||||
E('e'),
|
||||
F('f'),
|
||||
G('g'),
|
||||
H('h'),
|
||||
I('i'),
|
||||
J('j'),
|
||||
K('k'),
|
||||
L('l'),
|
||||
M('m'),
|
||||
N('n'),
|
||||
O('o'),
|
||||
P('p'),
|
||||
Q('q'),
|
||||
R('r'),
|
||||
S('s'),
|
||||
T('t'),
|
||||
U('u'),
|
||||
V('v'),
|
||||
W('w'),
|
||||
X('x'),
|
||||
Y('y'),
|
||||
Z('z'),
|
||||
|
||||
F1("f1", "F1"),
|
||||
F2("f2", "F2"),
|
||||
F3("f3", "F3"),
|
||||
F4("f4", "F4"),
|
||||
F5("f5", "F5"),
|
||||
F6("f6", "F6"),
|
||||
F7("f7", "F7"),
|
||||
F8("f8", "F8"),
|
||||
F9("f9", "F9"),
|
||||
F10("f10", "F10"),
|
||||
F11("f11", "F11"),
|
||||
F12("f12", "F12"),
|
||||
|
||||
KP_0("kp0", "Num 0"),
|
||||
KP_1("kp1", "Num 1"),
|
||||
KP_2("kp2", "Num 2"),
|
||||
KP_3("kp3", "Num 3"),
|
||||
KP_4("kp4", "Num 4"),
|
||||
KP_5("kp5", "Num 5"),
|
||||
KP_6("kp6", "Num 6"),
|
||||
KP_7("kp7", "Num 7"),
|
||||
KP_8("kp8", "Num 8"),
|
||||
KP_9("kp9", "Num 9"),
|
||||
|
||||
SPACE("space", "Leertaste"),
|
||||
CIRCUMFLEX('^'),
|
||||
SHARP_S('ß'),
|
||||
ACUTE('´'),
|
||||
UE('ü'),
|
||||
PLUS('+'),
|
||||
OE('ö'),
|
||||
AE('ä'),
|
||||
NUMBER_SIGN('#'),
|
||||
LESS_THAN('<'),
|
||||
COMMA(','),
|
||||
PERIOD('.'),
|
||||
HYPHEN('-'),
|
||||
|
||||
KP_DECIMAL("kp.", "Num ."),
|
||||
KP_DIVIDE("kp/", "Num /"),
|
||||
KP_MULTIPLY("kp*", "Num *"),
|
||||
KP_SUBTRACT("kp-", "Num -"),
|
||||
KP_ADD("kp+", "Num +"),
|
||||
KP_ENTER("enter", "Num Enter"),
|
||||
KP_EQUAL("kp=", "Num ="),
|
||||
|
||||
CAPS_LOCK("caps", "Feststellen"),
|
||||
SCROLL_LOCK("scroll", "Scroll Lock"),
|
||||
NUM_LOCK("num", "Num Lock"),
|
||||
|
||||
ESCAPE("esc", "Esc"),
|
||||
RETURN("return", "Enter"),
|
||||
TAB("tab", "Tab"),
|
||||
BACKSPACE("bksp", "Rücktaste"),
|
||||
INSERT("ins", "Einfg"),
|
||||
DELETE("del", "Entf"),
|
||||
RIGHT("right", "Pfeil rechts"),
|
||||
LEFT("left", "Pfeil links"),
|
||||
DOWN("down", "Pfeil unten"),
|
||||
UP("up", "Pfeil oben"),
|
||||
PAGE_UP("pgup", "Bild auf"),
|
||||
PAGE_DOWN("pgdn", "Bild ab"),
|
||||
HOME("home", "Pos1"),
|
||||
END("end", "Ende"),
|
||||
PRINT_SCREEN("print", "Druck"),
|
||||
PAUSE("pause", "Pause"),
|
||||
LEFT_SHIFT("lshift", "Umschalt links"),
|
||||
LEFT_CONTROL("lctrl", "Strg links"),
|
||||
ALT("alt", "Alt"),
|
||||
LEFT_LINUX("llinux", "Linux links"),
|
||||
RIGHT_SHIFT("rshift", "Umschalt rechts"),
|
||||
RIGHT_CONTROL("rctrl", "Strg rechts"),
|
||||
ALT_GRAPH("altgr", "Alt Gr"),
|
||||
RIGHT_LINUX("rlinux", "Linux rechts"),
|
||||
MENU("menu", "Menü");
|
||||
|
||||
private final String id;
|
||||
private final String name;
|
||||
|
||||
private Keysym(String id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
private Keysym(char character) {
|
||||
this(Character.toString(character), "<" + Character.toUpperCase(character) + ">");
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getDisplay() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public boolean read() {
|
||||
return WCF.getKey(this.ordinal() + 1);
|
||||
}
|
||||
}
|
535
java/src/game/window/WCF.java
Normal file
535
java/src/game/window/WCF.java
Normal file
|
@ -0,0 +1,535 @@
|
|||
package game.window;
|
||||
|
||||
public abstract class WCF {
|
||||
public static final int GL_EXP = 0x800;
|
||||
public static final int GL_LIGHT_MODEL_AMBIENT = 0xB53;
|
||||
public static final int GL_COLOR_MATERIAL = 0xB57;
|
||||
public static final int GL_FOG = 0xB60;
|
||||
public static final int GL_FOG_DENSITY = 0xB62;
|
||||
public static final int GL_FOG_START = 0xB63;
|
||||
public static final int GL_FOG_END = 0xB64;
|
||||
public static final int GL_FOG_MODE = 0xB65;
|
||||
public static final int GL_FOG_COLOR = 0xB66;
|
||||
public static final int GL_LIGHT0 = 0x4000;
|
||||
public static final int GL_LIGHT1 = 0x4001;
|
||||
public static final int GL_AMBIENT = 0x1200;
|
||||
public static final int GL_DIFFUSE = 0x1201;
|
||||
public static final int GL_SPECULAR = 0x1202;
|
||||
public static final int GL_POSITION = 0x1203;
|
||||
public static final int GL_COMPILE = 0x1300;
|
||||
public static final int GL_AMBIENT_AND_DIFFUSE = 0x1602;
|
||||
public static final int GL_MODELVIEW = 0x1700;
|
||||
public static final int GL_PROJECTION = 0x1701;
|
||||
public static final int GL_CLAMP = 0x2900;
|
||||
public static final int GL_VERTEX_ARRAY = 0x8074;
|
||||
public static final int GL_NORMAL_ARRAY = 0x8075;
|
||||
public static final int GL_COLOR_ARRAY = 0x8076;
|
||||
public static final int GL_TEXTURE_COORD_ARRAY = 0x8078;
|
||||
|
||||
public static final int GL_DEPTH_BUFFER_BIT = 0x00000100;
|
||||
public static final int GL_STENCIL_BUFFER_BIT = 0x00000400;
|
||||
public static final int GL_COLOR_BUFFER_BIT = 0x00004000;
|
||||
public static final int GL_FALSE = 0;
|
||||
public static final int GL_TRUE = 1;
|
||||
public static final int GL_POINTS = 0x0000;
|
||||
public static final int GL_LINES = 0x0001;
|
||||
public static final int GL_LINE_LOOP = 0x0002;
|
||||
public static final int GL_LINE_STRIP = 0x0003;
|
||||
public static final int GL_TRIANGLES = 0x0004;
|
||||
public static final int GL_TRIANGLE_STRIP = 0x0005;
|
||||
public static final int GL_TRIANGLE_FAN = 0x0006;
|
||||
public static final int GL_NEVER = 0x0200;
|
||||
public static final int GL_LESS = 0x0201;
|
||||
public static final int GL_EQUAL = 0x0202;
|
||||
public static final int GL_LEQUAL = 0x0203;
|
||||
public static final int GL_GREATER = 0x0204;
|
||||
public static final int GL_NOTEQUAL = 0x0205;
|
||||
public static final int GL_GEQUAL = 0x0206;
|
||||
public static final int GL_ALWAYS = 0x0207;
|
||||
public static final int GL_ZERO = 0;
|
||||
public static final int GL_ONE = 1;
|
||||
public static final int GL_SRC_COLOR = 0x0300;
|
||||
public static final int GL_ONE_MINUS_SRC_COLOR = 0x0301;
|
||||
public static final int GL_SRC_ALPHA = 0x0302;
|
||||
public static final int GL_ONE_MINUS_SRC_ALPHA = 0x0303;
|
||||
public static final int GL_DST_ALPHA = 0x0304;
|
||||
public static final int GL_ONE_MINUS_DST_ALPHA = 0x0305;
|
||||
public static final int GL_DST_COLOR = 0x0306;
|
||||
public static final int GL_ONE_MINUS_DST_COLOR = 0x0307;
|
||||
public static final int GL_SRC_ALPHA_SATURATE = 0x0308;
|
||||
public static final int GL_NONE = 0;
|
||||
public static final int GL_FRONT_LEFT = 0x0400;
|
||||
public static final int GL_FRONT_RIGHT = 0x0401;
|
||||
public static final int GL_BACK_LEFT = 0x0402;
|
||||
public static final int GL_BACK_RIGHT = 0x0403;
|
||||
public static final int GL_FRONT = 0x0404;
|
||||
public static final int GL_BACK = 0x0405;
|
||||
public static final int GL_LEFT = 0x0406;
|
||||
public static final int GL_RIGHT = 0x0407;
|
||||
public static final int GL_FRONT_AND_BACK = 0x0408;
|
||||
public static final int GL_NO_ERROR = 0;
|
||||
public static final int GL_INVALID_ENUM = 0x0500;
|
||||
public static final int GL_INVALID_VALUE = 0x0501;
|
||||
public static final int GL_INVALID_OPERATION = 0x0502;
|
||||
public static final int GL_OUT_OF_MEMORY = 0x0505;
|
||||
public static final int GL_CW = 0x0900;
|
||||
public static final int GL_CCW = 0x0901;
|
||||
public static final int GL_POINT_SIZE = 0x0B11;
|
||||
public static final int GL_POINT_SIZE_RANGE = 0x0B12;
|
||||
public static final int GL_POINT_SIZE_GRANULARITY = 0x0B13;
|
||||
public static final int GL_LINE_SMOOTH = 0x0B20;
|
||||
public static final int GL_LINE_WIDTH = 0x0B21;
|
||||
public static final int GL_LINE_WIDTH_RANGE = 0x0B22;
|
||||
public static final int GL_LINE_WIDTH_GRANULARITY = 0x0B23;
|
||||
public static final int GL_POLYGON_MODE = 0x0B40;
|
||||
public static final int GL_POLYGON_SMOOTH = 0x0B41;
|
||||
public static final int GL_CULL_FACE = 0x0B44;
|
||||
public static final int GL_CULL_FACE_MODE = 0x0B45;
|
||||
public static final int GL_FRONT_FACE = 0x0B46;
|
||||
public static final int GL_DEPTH_RANGE = 0x0B70;
|
||||
public static final int GL_DEPTH_TEST = 0x0B71;
|
||||
public static final int GL_DEPTH_WRITEMASK = 0x0B72;
|
||||
public static final int GL_DEPTH_CLEAR_VALUE = 0x0B73;
|
||||
public static final int GL_DEPTH_FUNC = 0x0B74;
|
||||
public static final int GL_STENCIL_TEST = 0x0B90;
|
||||
public static final int GL_STENCIL_CLEAR_VALUE = 0x0B91;
|
||||
public static final int GL_STENCIL_FUNC = 0x0B92;
|
||||
public static final int GL_STENCIL_VALUE_MASK = 0x0B93;
|
||||
public static final int GL_STENCIL_FAIL = 0x0B94;
|
||||
public static final int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95;
|
||||
public static final int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96;
|
||||
public static final int GL_STENCIL_REF = 0x0B97;
|
||||
public static final int GL_STENCIL_WRITEMASK = 0x0B98;
|
||||
public static final int GL_VIEWPORT = 0x0BA2;
|
||||
public static final int GL_DITHER = 0x0BD0;
|
||||
public static final int GL_BLEND_DST = 0x0BE0;
|
||||
public static final int GL_BLEND_SRC = 0x0BE1;
|
||||
public static final int GL_BLEND = 0x0BE2;
|
||||
public static final int GL_LOGIC_OP_MODE = 0x0BF0;
|
||||
public static final int GL_DRAW_BUFFER = 0x0C01;
|
||||
public static final int GL_READ_BUFFER = 0x0C02;
|
||||
public static final int GL_SCISSOR_BOX = 0x0C10;
|
||||
public static final int GL_SCISSOR_TEST = 0x0C11;
|
||||
public static final int GL_COLOR_CLEAR_VALUE = 0x0C22;
|
||||
public static final int GL_COLOR_WRITEMASK = 0x0C23;
|
||||
public static final int GL_DOUBLEBUFFER = 0x0C32;
|
||||
public static final int GL_STEREO = 0x0C33;
|
||||
public static final int GL_LINE_SMOOTH_HINT = 0x0C52;
|
||||
public static final int GL_POLYGON_SMOOTH_HINT = 0x0C53;
|
||||
public static final int GL_UNPACK_SWAP_BYTES = 0x0CF0;
|
||||
public static final int GL_UNPACK_LSB_FIRST = 0x0CF1;
|
||||
public static final int GL_UNPACK_ROW_LENGTH = 0x0CF2;
|
||||
public static final int GL_UNPACK_SKIP_ROWS = 0x0CF3;
|
||||
public static final int GL_UNPACK_SKIP_PIXELS = 0x0CF4;
|
||||
public static final int GL_UNPACK_ALIGNMENT = 0x0CF5;
|
||||
public static final int GL_PACK_SWAP_BYTES = 0x0D00;
|
||||
public static final int GL_PACK_LSB_FIRST = 0x0D01;
|
||||
public static final int GL_PACK_ROW_LENGTH = 0x0D02;
|
||||
public static final int GL_PACK_SKIP_ROWS = 0x0D03;
|
||||
public static final int GL_PACK_SKIP_PIXELS = 0x0D04;
|
||||
public static final int GL_PACK_ALIGNMENT = 0x0D05;
|
||||
public static final int GL_MAX_TEXTURE_SIZE = 0x0D33;
|
||||
public static final int GL_MAX_VIEWPORT_DIMS = 0x0D3A;
|
||||
public static final int GL_SUBPIXEL_BITS = 0x0D50;
|
||||
public static final int GL_TEXTURE_1D = 0x0DE0;
|
||||
public static final int GL_TEXTURE_2D = 0x0DE1;
|
||||
public static final int GL_TEXTURE_WIDTH = 0x1000;
|
||||
public static final int GL_TEXTURE_HEIGHT = 0x1001;
|
||||
public static final int GL_TEXTURE_BORDER_COLOR = 0x1004;
|
||||
public static final int GL_DONT_CARE = 0x1100;
|
||||
public static final int GL_FASTEST = 0x1101;
|
||||
public static final int GL_NICEST = 0x1102;
|
||||
public static final int GL_BYTE = 0x1400;
|
||||
public static final int GL_UNSIGNED_BYTE = 0x1401;
|
||||
public static final int GL_SHORT = 0x1402;
|
||||
public static final int GL_UNSIGNED_SHORT = 0x1403;
|
||||
public static final int GL_INT = 0x1404;
|
||||
public static final int GL_UNSIGNED_INT = 0x1405;
|
||||
public static final int GL_FLOAT = 0x1406;
|
||||
public static final int GL_CLEAR = 0x1500;
|
||||
public static final int GL_AND = 0x1501;
|
||||
public static final int GL_AND_REVERSE = 0x1502;
|
||||
public static final int GL_COPY = 0x1503;
|
||||
public static final int GL_AND_INVERTED = 0x1504;
|
||||
public static final int GL_NOOP = 0x1505;
|
||||
public static final int GL_XOR = 0x1506;
|
||||
public static final int GL_OR = 0x1507;
|
||||
public static final int GL_NOR = 0x1508;
|
||||
public static final int GL_EQUIV = 0x1509;
|
||||
public static final int GL_INVERT = 0x150A;
|
||||
public static final int GL_OR_REVERSE = 0x150B;
|
||||
public static final int GL_COPY_INVERTED = 0x150C;
|
||||
public static final int GL_OR_INVERTED = 0x150D;
|
||||
public static final int GL_NAND = 0x150E;
|
||||
public static final int GL_SET = 0x150F;
|
||||
public static final int GL_TEXTURE = 0x1702;
|
||||
public static final int GL_COLOR = 0x1800;
|
||||
public static final int GL_DEPTH = 0x1801;
|
||||
public static final int GL_STENCIL = 0x1802;
|
||||
public static final int GL_STENCIL_INDEX = 0x1901;
|
||||
public static final int GL_DEPTH_COMPONENT = 0x1902;
|
||||
public static final int GL_RED = 0x1903;
|
||||
public static final int GL_GREEN = 0x1904;
|
||||
public static final int GL_BLUE = 0x1905;
|
||||
public static final int GL_ALPHA = 0x1906;
|
||||
public static final int GL_RGB = 0x1907;
|
||||
public static final int GL_RGBA = 0x1908;
|
||||
public static final int GL_POINT = 0x1B00;
|
||||
public static final int GL_LINE = 0x1B01;
|
||||
public static final int GL_FILL = 0x1B02;
|
||||
public static final int GL_KEEP = 0x1E00;
|
||||
public static final int GL_REPLACE = 0x1E01;
|
||||
public static final int GL_INCR = 0x1E02;
|
||||
public static final int GL_DECR = 0x1E03;
|
||||
public static final int GL_VENDOR = 0x1F00;
|
||||
public static final int GL_RENDERER = 0x1F01;
|
||||
public static final int GL_VERSION = 0x1F02;
|
||||
public static final int GL_EXTENSIONS = 0x1F03;
|
||||
public static final int GL_NEAREST = 0x2600;
|
||||
public static final int GL_LINEAR = 0x2601;
|
||||
public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
|
||||
public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
|
||||
public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
|
||||
public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
|
||||
public static final int GL_TEXTURE_MAG_FILTER = 0x2800;
|
||||
public static final int GL_TEXTURE_MIN_FILTER = 0x2801;
|
||||
public static final int GL_TEXTURE_WRAP_S = 0x2802;
|
||||
public static final int GL_TEXTURE_WRAP_T = 0x2803;
|
||||
public static final int GL_REPEAT = 0x2901;
|
||||
public static final int GL_COLOR_LOGIC_OP = 0x0BF2;
|
||||
public static final int GL_POLYGON_OFFSET_UNITS = 0x2A00;
|
||||
public static final int GL_POLYGON_OFFSET_POINT = 0x2A01;
|
||||
public static final int GL_POLYGON_OFFSET_LINE = 0x2A02;
|
||||
public static final int GL_POLYGON_OFFSET_FILL = 0x8037;
|
||||
public static final int GL_POLYGON_OFFSET_FACTOR = 0x8038;
|
||||
public static final int GL_TEXTURE_BINDING_1D = 0x8068;
|
||||
public static final int GL_TEXTURE_BINDING_2D = 0x8069;
|
||||
public static final int GL_TEXTURE_INTERNAL_FORMAT = 0x1003;
|
||||
public static final int GL_TEXTURE_RED_SIZE = 0x805C;
|
||||
public static final int GL_TEXTURE_GREEN_SIZE = 0x805D;
|
||||
public static final int GL_TEXTURE_BLUE_SIZE = 0x805E;
|
||||
public static final int GL_TEXTURE_ALPHA_SIZE = 0x805F;
|
||||
public static final int GL_DOUBLE = 0x140A;
|
||||
public static final int GL_PROXY_TEXTURE_1D = 0x8063;
|
||||
public static final int GL_PROXY_TEXTURE_2D = 0x8064;
|
||||
public static final int GL_R3_G3_B2 = 0x2A10;
|
||||
public static final int GL_RGB4 = 0x804F;
|
||||
public static final int GL_RGB5 = 0x8050;
|
||||
public static final int GL_RGB8 = 0x8051;
|
||||
public static final int GL_RGB10 = 0x8052;
|
||||
public static final int GL_RGB12 = 0x8053;
|
||||
public static final int GL_RGB16 = 0x8054;
|
||||
public static final int GL_RGBA2 = 0x8055;
|
||||
public static final int GL_RGBA4 = 0x8056;
|
||||
public static final int GL_RGB5_A1 = 0x8057;
|
||||
public static final int GL_RGBA8 = 0x8058;
|
||||
public static final int GL_RGB10_A2 = 0x8059;
|
||||
public static final int GL_RGBA12 = 0x805A;
|
||||
public static final int GL_RGBA16 = 0x805B;
|
||||
public static final int GL_UNSIGNED_BYTE_3_3_2 = 0x8032;
|
||||
public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
|
||||
public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
|
||||
public static final int GL_UNSIGNED_INT_8_8_8_8 = 0x8035;
|
||||
public static final int GL_UNSIGNED_INT_10_10_10_2 = 0x8036;
|
||||
public static final int GL_TEXTURE_BINDING_3D = 0x806A;
|
||||
public static final int GL_PACK_SKIP_IMAGES = 0x806B;
|
||||
public static final int GL_PACK_IMAGE_HEIGHT = 0x806C;
|
||||
public static final int GL_UNPACK_SKIP_IMAGES = 0x806D;
|
||||
public static final int GL_UNPACK_IMAGE_HEIGHT = 0x806E;
|
||||
public static final int GL_TEXTURE_3D = 0x806F;
|
||||
public static final int GL_PROXY_TEXTURE_3D = 0x8070;
|
||||
public static final int GL_TEXTURE_DEPTH = 0x8071;
|
||||
public static final int GL_TEXTURE_WRAP_R = 0x8072;
|
||||
public static final int GL_MAX_3D_TEXTURE_SIZE = 0x8073;
|
||||
public static final int GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362;
|
||||
public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
|
||||
public static final int GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364;
|
||||
public static final int GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365;
|
||||
public static final int GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366;
|
||||
public static final int GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367;
|
||||
public static final int GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368;
|
||||
public static final int GL_BGR = 0x80E0;
|
||||
public static final int GL_BGRA = 0x80E1;
|
||||
public static final int GL_MAX_ELEMENTS_VERTICES = 0x80E8;
|
||||
public static final int GL_MAX_ELEMENTS_INDICES = 0x80E9;
|
||||
public static final int GL_CLAMP_TO_EDGE = 0x812F;
|
||||
public static final int GL_TEXTURE_MIN_LOD = 0x813A;
|
||||
public static final int GL_TEXTURE_MAX_LOD = 0x813B;
|
||||
public static final int GL_TEXTURE_BASE_LEVEL = 0x813C;
|
||||
public static final int GL_TEXTURE_MAX_LEVEL = 0x813D;
|
||||
public static final int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12;
|
||||
public static final int GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13;
|
||||
public static final int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22;
|
||||
public static final int GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23;
|
||||
public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
|
||||
public static final int GL_TEXTURE0 = 0x84C0;
|
||||
public static final int GL_TEXTURE1 = 0x84C1;
|
||||
public static final int GL_TEXTURE2 = 0x84C2;
|
||||
public static final int GL_TEXTURE3 = 0x84C3;
|
||||
public static final int GL_TEXTURE4 = 0x84C4;
|
||||
public static final int GL_TEXTURE5 = 0x84C5;
|
||||
public static final int GL_TEXTURE6 = 0x84C6;
|
||||
public static final int GL_TEXTURE7 = 0x84C7;
|
||||
public static final int GL_TEXTURE8 = 0x84C8;
|
||||
public static final int GL_TEXTURE9 = 0x84C9;
|
||||
public static final int GL_TEXTURE10 = 0x84CA;
|
||||
public static final int GL_TEXTURE11 = 0x84CB;
|
||||
public static final int GL_TEXTURE12 = 0x84CC;
|
||||
public static final int GL_TEXTURE13 = 0x84CD;
|
||||
public static final int GL_TEXTURE14 = 0x84CE;
|
||||
public static final int GL_TEXTURE15 = 0x84CF;
|
||||
public static final int GL_TEXTURE16 = 0x84D0;
|
||||
public static final int GL_TEXTURE17 = 0x84D1;
|
||||
public static final int GL_TEXTURE18 = 0x84D2;
|
||||
public static final int GL_TEXTURE19 = 0x84D3;
|
||||
public static final int GL_TEXTURE20 = 0x84D4;
|
||||
public static final int GL_TEXTURE21 = 0x84D5;
|
||||
public static final int GL_TEXTURE22 = 0x84D6;
|
||||
public static final int GL_TEXTURE23 = 0x84D7;
|
||||
public static final int GL_TEXTURE24 = 0x84D8;
|
||||
public static final int GL_TEXTURE25 = 0x84D9;
|
||||
public static final int GL_TEXTURE26 = 0x84DA;
|
||||
public static final int GL_TEXTURE27 = 0x84DB;
|
||||
public static final int GL_TEXTURE28 = 0x84DC;
|
||||
public static final int GL_TEXTURE29 = 0x84DD;
|
||||
public static final int GL_TEXTURE30 = 0x84DE;
|
||||
public static final int GL_TEXTURE31 = 0x84DF;
|
||||
public static final int GL_ACTIVE_TEXTURE = 0x84E0;
|
||||
public static final int GL_MULTISAMPLE = 0x809D;
|
||||
public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
|
||||
public static final int GL_SAMPLE_ALPHA_TO_ONE = 0x809F;
|
||||
public static final int GL_SAMPLE_COVERAGE = 0x80A0;
|
||||
public static final int GL_SAMPLE_BUFFERS = 0x80A8;
|
||||
public static final int GL_SAMPLES = 0x80A9;
|
||||
public static final int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
|
||||
public static final int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
|
||||
public static final int GL_TEXTURE_CUBE_MAP = 0x8513;
|
||||
public static final int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
|
||||
public static final int GL_PROXY_TEXTURE_CUBE_MAP = 0x851B;
|
||||
public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
|
||||
public static final int GL_COMPRESSED_RGB = 0x84ED;
|
||||
public static final int GL_COMPRESSED_RGBA = 0x84EE;
|
||||
public static final int GL_TEXTURE_COMPRESSION_HINT = 0x84EF;
|
||||
public static final int GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0;
|
||||
public static final int GL_TEXTURE_COMPRESSED = 0x86A1;
|
||||
public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
|
||||
public static final int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
|
||||
public static final int GL_CLAMP_TO_BORDER = 0x812D;
|
||||
public static final int GL_BLEND_DST_RGB = 0x80C8;
|
||||
public static final int GL_BLEND_SRC_RGB = 0x80C9;
|
||||
public static final int GL_BLEND_DST_ALPHA = 0x80CA;
|
||||
public static final int GL_BLEND_SRC_ALPHA = 0x80CB;
|
||||
public static final int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
|
||||
public static final int GL_DEPTH_COMPONENT16 = 0x81A5;
|
||||
public static final int GL_DEPTH_COMPONENT24 = 0x81A6;
|
||||
public static final int GL_DEPTH_COMPONENT32 = 0x81A7;
|
||||
public static final int GL_MIRRORED_REPEAT = 0x8370;
|
||||
public static final int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD;
|
||||
public static final int GL_TEXTURE_LOD_BIAS = 0x8501;
|
||||
public static final int GL_INCR_WRAP = 0x8507;
|
||||
public static final int GL_DECR_WRAP = 0x8508;
|
||||
public static final int GL_TEXTURE_DEPTH_SIZE = 0x884A;
|
||||
public static final int GL_TEXTURE_COMPARE_MODE = 0x884C;
|
||||
public static final int GL_TEXTURE_COMPARE_FUNC = 0x884D;
|
||||
public static final int GL_BLEND_COLOR = 0x8005;
|
||||
public static final int GL_BLEND_EQUATION = 0x8009;
|
||||
public static final int GL_CONSTANT_COLOR = 0x8001;
|
||||
public static final int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002;
|
||||
public static final int GL_CONSTANT_ALPHA = 0x8003;
|
||||
public static final int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004;
|
||||
public static final int GL_FUNC_ADD = 0x8006;
|
||||
public static final int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
|
||||
public static final int GL_FUNC_SUBTRACT = 0x800A;
|
||||
public static final int GL_MIN = 0x8007;
|
||||
public static final int GL_MAX = 0x8008;
|
||||
public static final int GL_BUFFER_SIZE = 0x8764;
|
||||
public static final int GL_BUFFER_USAGE = 0x8765;
|
||||
public static final int GL_QUERY_COUNTER_BITS = 0x8864;
|
||||
public static final int GL_CURRENT_QUERY = 0x8865;
|
||||
public static final int GL_QUERY_RESULT = 0x8866;
|
||||
public static final int GL_QUERY_RESULT_AVAILABLE = 0x8867;
|
||||
public static final int GL_ARRAY_BUFFER = 0x8892;
|
||||
|
||||
public static native void glAlphaFunc(int func, float ref);
|
||||
public static native void glBindTexture(int texture);
|
||||
public static native void glBlendFunc(int sfactor, int dfactor);
|
||||
public static native void glCallList(int list);
|
||||
public static native void glClear(int mask);
|
||||
public static native void glClearColor(float red, float green, float blue, float alpha);
|
||||
public static native void glClearDepth(double depth);
|
||||
public static native void glColor4f(float red, float green, float blue, float alpha);
|
||||
public static native void glColorMask(boolean red, boolean green, boolean blue, boolean alpha);
|
||||
public static native void glColorMaterial(int face, int mode);
|
||||
public static native void glColorPointer(int size, int type, int stride, long pointer);
|
||||
public static native void glCullFace(int mode);
|
||||
public static native void glDeleteLists(int list, int range);
|
||||
public static native void glDeleteTextures(int texture);
|
||||
public static native void glDepthFunc(int func);
|
||||
public static native void glDepthMask(boolean flag);
|
||||
public static native void glDisable(int cap);
|
||||
public static native void glDisableClientState(int cap);
|
||||
public static native void glDrawArrays(int mode, int first, int count);
|
||||
public static native void glEnable(int cap);
|
||||
public static native void glEnableClientState(int cap);
|
||||
public static native void glEndList();
|
||||
public static native void glFogf(int pname, float param);
|
||||
private static native void glFogfv(int pname, long params);
|
||||
public static native void glFogi(int pname, int param);
|
||||
public static native int glGenLists(int range);
|
||||
public static native int glGenTextures();
|
||||
private static native void glGetFloatv(int pname, long params);
|
||||
private static native void glGetIntegerv(long params);
|
||||
private static native void glLightfv(int light, int pname, long params);
|
||||
private static native void glLightModelfv(int pname, long params);
|
||||
public static native void glLineWidth(float width);
|
||||
public static native void glLoadIdentity();
|
||||
public static native void glMatrixMode(int mode);
|
||||
private static native void glMultMatrixf(long m);
|
||||
public static native void glNewList(int list, int mode);
|
||||
public static native void glNormal3f(float nx, float ny, float nz);
|
||||
private static native void glNormalPointer(int type, int stride, long pointer);
|
||||
public static native void glPolygonOffset(float factor, float units);
|
||||
public static native void glPopMatrix();
|
||||
public static native void glPushMatrix();
|
||||
public static native void glRotatef(float angle, float x, float y, float z);
|
||||
public static native void glScalef(float x, float y, float z);
|
||||
public static native void glShadeModel(int mode);
|
||||
public static native void glTexCoordPointer(int size, int type, int stride, long pointer);
|
||||
public static native void glTexImage2D(int width, int height);
|
||||
public static native void glTexParameteri(int pname, int param);
|
||||
private static native void glTexSubImage2D(int xoffset, int yoffset, int width, int height, long pixels);
|
||||
public static native void glTranslatef(float x, float y, float z);
|
||||
public static native void glVertexPointer(int size, int type, int stride, long pointer);
|
||||
|
||||
public static native void glActiveTexture(int texture);
|
||||
public static native void glClientActiveTexture(int texture);
|
||||
public static native void glMultiTexCoord2f(int target, float s, float t);
|
||||
|
||||
public static native void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha);
|
||||
|
||||
public static native void glBindBuffer(int buffer);
|
||||
public static native void glDeleteBuffers(int buffer);
|
||||
public static native int glGenBuffers();
|
||||
private static native void glBufferData(long data_size, long data);
|
||||
|
||||
public static native void glOrtho(double left, double right, double bottom, double top, double near, double far);
|
||||
public static native String glGetString(int id);
|
||||
public static native void glScissor(int x, int y, int w, int h);
|
||||
public static native void glViewport(int x, int y, int w, int h);
|
||||
private static native void glReadPixels(int x, int y, long data);
|
||||
public static native void glPolygonMode(boolean line);
|
||||
public static native void glFlush();
|
||||
|
||||
|
||||
public static native long getTime();
|
||||
private static native int[] pollEvents();
|
||||
public static native void setWindowed(int xpos, int ypos, int xsize, int ysize);
|
||||
public static native void setFullscreen(int width, int height, int refresh);
|
||||
public static native boolean getKey(int code);
|
||||
public static native void setTitle(String title);
|
||||
public static native void setIcon(byte[] icon, int w, int h);
|
||||
public static native String getClipboard();
|
||||
public static native void setClipboard(String text);
|
||||
public static native void swapBuffers();
|
||||
public static native void grabCursor(boolean grab);
|
||||
public static native void setVSync(boolean sync);
|
||||
private static native int[] getModes();
|
||||
private static native int[] getMode();
|
||||
public static native boolean createWindow(String id, boolean gldebug);
|
||||
public static native void destroyWindow();
|
||||
public static native void initWindow(int sx, int sy, int wx, int wy);
|
||||
|
||||
public static void glBufferData(java.nio.ByteBuffer data) {
|
||||
glBufferData(data.remaining(), ((sun.nio.ch.DirectBuffer)data).address() + data.position());
|
||||
}
|
||||
public static void glColorPointer(int size, int type, int stride, java.nio.ByteBuffer pointer) {
|
||||
glColorPointer(size, type, stride, ((sun.nio.ch.DirectBuffer)pointer).address() + pointer.position());
|
||||
}
|
||||
public static void glFog(int pname, java.nio.FloatBuffer params) {
|
||||
glFogfv(pname, ((sun.nio.ch.DirectBuffer)params).address() + (params.position() << 2));
|
||||
}
|
||||
public static void glGetFloat(int pname, java.nio.FloatBuffer params) {
|
||||
glGetFloatv(pname, ((sun.nio.ch.DirectBuffer)params).address() + (params.position() << 2));
|
||||
}
|
||||
public static void glGetInteger(java.nio.IntBuffer params) {
|
||||
glGetIntegerv(((sun.nio.ch.DirectBuffer)params).address() + (params.position() << 2));
|
||||
}
|
||||
public static void glLight(int light, int pname, java.nio.FloatBuffer params) {
|
||||
glLightfv(light, pname, ((sun.nio.ch.DirectBuffer)params).address() + (params.position() << 2));
|
||||
}
|
||||
public static void glLightModel(int pname, java.nio.FloatBuffer params) {
|
||||
glLightModelfv(pname, ((sun.nio.ch.DirectBuffer)params).address() + (params.position() << 2));
|
||||
}
|
||||
public static void glMultMatrix(java.nio.FloatBuffer m) {
|
||||
glMultMatrixf(((sun.nio.ch.DirectBuffer)m).address() + (m.position() << 2));
|
||||
}
|
||||
public static void glNormalPointer(int type, int stride, java.nio.ByteBuffer pointer) {
|
||||
glNormalPointer(type, stride, ((sun.nio.ch.DirectBuffer)pointer).address() + pointer.position());
|
||||
}
|
||||
public static void glTexCoordPointer(int size, int type, int stride, java.nio.ByteBuffer pointer) {
|
||||
glTexCoordPointer(size, type, stride, ((sun.nio.ch.DirectBuffer)pointer).address() + pointer.position());
|
||||
}
|
||||
public static void glTexSubImage2D(int xoffset, int yoffset, int width, int height, java.nio.IntBuffer pixels) {
|
||||
glTexSubImage2D(xoffset, yoffset, width, height, ((sun.nio.ch.DirectBuffer)pixels).address() + (pixels.position() << 2));
|
||||
}
|
||||
public static void glVertexPointer(int size, int type, int stride, java.nio.ByteBuffer pointer) {
|
||||
glVertexPointer(size, type, stride, ((sun.nio.ch.DirectBuffer)pointer).address() + pointer.position());
|
||||
}
|
||||
public static void glReadPixels(int x, int y, java.nio.ByteBuffer data) {
|
||||
glReadPixels(x, y, ((sun.nio.ch.DirectBuffer)data).address() + data.position());
|
||||
}
|
||||
public static WindowEvent[] poll() {
|
||||
int[] data = pollEvents();
|
||||
WindowEvent[] events = new WindowEvent[data.length / 3];
|
||||
for(int z = 0; z < events.length; z++) {
|
||||
events[z] = new WindowEvent(WindowAction.values()[data[z * 3 + 0]], data[z * 3 + 1], data[z * 3 + 2]);
|
||||
}
|
||||
return events;
|
||||
}
|
||||
public static DisplayMode[] getDisplayModes() {
|
||||
int[] data = getModes();
|
||||
if(data == null)
|
||||
return null;
|
||||
DisplayMode[] modes = new DisplayMode[data.length / 3];
|
||||
for(int z = 0; z < modes.length; z++) {
|
||||
modes[z] = new DisplayMode(data[z * 3 + 0], data[z * 3 + 1], data[z * 3 + 2]);
|
||||
}
|
||||
return modes;
|
||||
}
|
||||
public static DisplayMode getDisplayMode() {
|
||||
int[] data = getMode();
|
||||
if(data == null)
|
||||
return null;
|
||||
return new DisplayMode(data[0], data[1], data[2]);
|
||||
}
|
||||
public static void init() {
|
||||
System.setProperty("java.library.path", "lib");
|
||||
try {
|
||||
java.lang.reflect.Field paths = ClassLoader.class.getDeclaredField("sys_paths");
|
||||
paths.setAccessible(true);
|
||||
paths.set(null, null);
|
||||
paths.setAccessible(false);
|
||||
}
|
||||
catch(NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
java.io.File dir = new java.io.File("lib");
|
||||
dir.mkdirs();
|
||||
java.io.InputStream in = WCF.class.getResourceAsStream("/libwcf.so");
|
||||
if(in == null)
|
||||
throw new RuntimeException(new java.io.FileNotFoundException("libwcf.so"));
|
||||
try {
|
||||
java.nio.file.Files.copy(in, new java.io.File(dir, "libwcf.so").toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
catch(java.io.IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
System.loadLibrary("wcf");
|
||||
}
|
||||
}
|
40
java/src/game/window/Wheel.java
Normal file
40
java/src/game/window/Wheel.java
Normal file
|
@ -0,0 +1,40 @@
|
|||
package game.window;
|
||||
|
||||
import game.Game;
|
||||
|
||||
public enum Wheel implements Input {
|
||||
SCROLL_UP("scrup", "Mausrad aufwärts"),
|
||||
SCROLL_DOWN("scrdn", "Mausrad abwärts"),
|
||||
SCROLL_LEFT("scrl", "Mausrad links"),
|
||||
SCROLL_RIGHT("scrr", "Mausrad rechts");
|
||||
|
||||
private final String id;
|
||||
private final String name;
|
||||
|
||||
private boolean used;
|
||||
|
||||
private Wheel(String id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getDisplay() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public boolean read() {
|
||||
return Game.getGame().open == null && this.used;
|
||||
}
|
||||
|
||||
public void setUsed() {
|
||||
this.used = true;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
this.used = false;
|
||||
}
|
||||
}
|
14
java/src/game/window/WindowAction.java
Normal file
14
java/src/game/window/WindowAction.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package game.window;
|
||||
|
||||
public enum WindowAction {
|
||||
RESIZE,
|
||||
POSITION,
|
||||
CURSOR,
|
||||
SCROLL,
|
||||
BUTTON,
|
||||
KEY,
|
||||
CHARACTER,
|
||||
REDRAW,
|
||||
CLOSED,
|
||||
FOCUS;
|
||||
}
|
13
java/src/game/window/WindowEvent.java
Normal file
13
java/src/game/window/WindowEvent.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package game.window;
|
||||
|
||||
public class WindowEvent {
|
||||
public final WindowAction action;
|
||||
public final int param1;
|
||||
public final int param2;
|
||||
|
||||
public WindowEvent(WindowAction action, int p1, int p2) {
|
||||
this.action = action;
|
||||
this.param1 = p1;
|
||||
this.param2 = p2;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue