perf(GL): move opengl33 off of draw loop
protected static final String PARTICLE_MATERIAL_URI = "engine:prog.particle";
private final FloatBuffer matrixBuffer = BufferUtils.createFloatBuffer(16);
-
+ private boolean opengl33 = false;
/**
* Vertices of a unit quad on the xy plane, centered on the origin.
* Vertices are in counter-clockwise order starting from the bottom right vertex.
@@ -114,7 +114,7 @@ public void renderOpaque() {
@Override
public void renderAlphaBlend() {
- if(!GL.createCapabilities().OpenGL33) {
+ if (!opengl33) {
return;
}
PerspectiveCamera camera = (PerspectiveCamera) worldRenderer.getActiveCamera();
@@ -143,6 +143,7 @@ public void renderShadows() {
@Override
public void initialise() {
+ opengl33 = GL.createCapabilities().OpenGL33;
// Nasty hack to only run LWJGL code with a LwjglDisplayDevice. Should be unnecessary once "big todo" for drawParticles is resolved.
if (!(displayDevice instanceof LwjglDisplayDevice)) {
return;
