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

@ -1,5 +1,8 @@
package game.renderer;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
import game.window.WCF;
public class GlState
@ -174,7 +177,7 @@ public class GlState
if (param != fogState.mode)
{
fogState.mode = param;
WCF.glFogi(WCF.GL_FOG_MODE, param);
WCF.glFogi(GL11.GL_FOG_MODE, param);
}
}
@ -183,7 +186,7 @@ public class GlState
if (param != fogState.density)
{
fogState.density = param;
WCF.glFogf(WCF.GL_FOG_DENSITY, param);
WCF.glFogf(GL11.GL_FOG_DENSITY, param);
}
}
@ -192,7 +195,7 @@ public class GlState
if (param != fogState.start)
{
fogState.start = param;
WCF.glFogf(WCF.GL_FOG_START, param);
WCF.glFogf(GL11.GL_FOG_START, param);
}
}
@ -201,7 +204,7 @@ public class GlState
if (param != fogState.end)
{
fogState.end = param;
WCF.glFogf(WCF.GL_FOG_END, param);
WCF.glFogf(GL11.GL_FOG_END, param);
}
}
@ -312,9 +315,9 @@ public class GlState
public static void setActiveTexture(int texture)
{
if (activeTextureUnit != texture - WCF.GL_TEXTURE0)
if (activeTextureUnit != texture - GL13.GL_TEXTURE0)
{
activeTextureUnit = texture - WCF.GL_TEXTURE0;
activeTextureUnit = texture - GL13.GL_TEXTURE0;
WCF.glActiveTexture(texture);
}
}
@ -594,9 +597,9 @@ public class GlState
private ColorMaterialState()
{
this.colorMaterial = new GlState.BooleanState(WCF.GL_COLOR_MATERIAL);
this.face = WCF.GL_FRONT_AND_BACK;
this.mode = WCF.GL_AMBIENT_AND_DIFFUSE;
this.colorMaterial = new GlState.BooleanState(GL11.GL_COLOR_MATERIAL);
this.face = GL11.GL_FRONT_AND_BACK;
this.mode = GL11.GL_AMBIENT_AND_DIFFUSE;
}
}
@ -637,9 +640,9 @@ public class GlState
private FogState()
{
this.fog = new GlState.BooleanState(WCF.GL_FOG);
this.fog = new GlState.BooleanState(GL11.GL_FOG);
this.enabled = true;
this.mode = WCF.GL_EXP;
this.mode = GL11.GL_EXP;
this.density = 1.0F;
this.start = 0.0F;
this.end = 1.0F;