inline OpenGL constants to lwjgl GLxx

This commit is contained in:
Sen 2025-03-18 10:14:37 +01:00
parent a891ab4d3a
commit 783adb350b
20 changed files with 183 additions and 495 deletions

View file

@ -2,6 +2,8 @@ package game.gui;
import java.util.List;
import org.lwjgl.opengl.GL13;
import com.google.common.collect.Lists;
import game.Game;
@ -18,7 +20,6 @@ import game.vars.ColorVar;
import game.window.Bind;
import game.window.Button;
import game.window.Keysym;
import game.window.WCF;
public abstract class Gui {
public static final String DIRT_BACKGROUND = "textures/background.png";
@ -327,7 +328,7 @@ public abstract class Gui {
if(this.gm.fb_x != 0 && this.gm.fb_y != 0)
this.draw();
GlState.bindTexture(0);
GlState.setActiveTexture(WCF.GL_TEXTURE0);
GlState.setActiveTexture(GL13.GL_TEXTURE0);
GlState.enableTexture2D();
GlState.disableDepth();
this.drawPost();

View file

@ -3,6 +3,8 @@ package game.gui.container;
import java.util.List;
import java.util.Set;
import org.lwjgl.opengl.GL13;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@ -351,7 +353,7 @@ public abstract class GuiContainer extends Gui
this.theSlot = null;
int k = 240;
int l = 240;
WCF.glMultiTexCoord2f(WCF.GL_TEXTURE1, (float)k / 1.0F, (float)l / 1.0F);
WCF.glMultiTexCoord2f(GL13.GL_TEXTURE1, (float)k / 1.0F, (float)l / 1.0F);
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
this.drawSlots(mouseX, mouseY);

View file

@ -1,5 +1,7 @@
package game.gui.element;
import org.lwjgl.opengl.GL11;
import game.Game;
import game.gui.Font;
import game.gui.Gui;
@ -232,7 +234,7 @@ public abstract class Element {
int y2 = this.size_y - (this.margin_y1 + this.margin_y2);
// if(elem.type == ElemType.FIELD) {
WCF.glScissor(x1 < 0 ? 0 : x1, (this.gm.fb_y - (y1 + y2)) < 0 ? 0 : (this.gm.fb_y - (y1 + y2)), x2 < 0 ? 0 : x2, y2 < 0 ? 0 : y2);
WCF.glEnable(WCF.GL_SCISSOR_TEST);
WCF.glEnable(GL11.GL_SCISSOR_TEST);
// }
// if(this.type == ElemType.CUSTOM)
// this.func(this, 1);
@ -240,7 +242,7 @@ public abstract class Element {
this.drawForeground(x1, y1, x2, y2);
// logd("DBG", "%d @ %d %d -> %d %d", elem.id, x1, y1, elem.pos_x + x2, elem.pos_y + y2);
// if(elem.type == ElemType.FIELD) {
WCF.glDisable(WCF.GL_SCISSOR_TEST);
WCF.glDisable(GL11.GL_SCISSOR_TEST);
// glScissor(0, 0, sys.fb_x, sys.fb_y);
// }
}

View file

@ -1,5 +1,7 @@
package game.gui.element;
import org.lwjgl.opengl.GL11;
import game.gui.Font;
import game.renderer.Drawing;
import game.renderer.Drawing.Offset;
@ -430,9 +432,9 @@ public class Textbox extends Element {
int x2 = this.size_x - (this.margin_x1 + this.margin_x2);
int y2 = this.size_y - (this.margin_y1 + this.margin_y2);
WCF.glScissor(x1 < 0 ? 0 : x1, (this.gm.fb_y - (y1 + y2)) < 0 ? 0 : (this.gm.fb_y - (y1 + y2)), x2 < 0 ? 0 : x2, y2 < 0 ? 0 : y2);
WCF.glEnable(WCF.GL_SCISSOR_TEST);
WCF.glEnable(GL11.GL_SCISSOR_TEST);
Drawing.drawRectColor(this.cursorX, this.cursorY, 1, Font.YGLYPH, this.gm.style.cursor);
WCF.glDisable(WCF.GL_SCISSOR_TEST);
WCF.glDisable(GL11.GL_SCISSOR_TEST);
}
}