Fix matrices not being updated on time
import static org.lwjgl.opengl.GL11.GL_PROJECTION;
import static org.lwjgl.opengl.GL11.glMatrixMode;
+import static org.terasology.engine.subsystem.lwjgl.LwjglDisplayDevice.DISPLAY_RESOLUTION_CHANGE;
/**
* Simple default camera.
@@ -58,7 +59,7 @@ public PerspectiveCamera(WorldProvider worldProvider, RenderingConfig renderingC
super(worldProvider, renderingConfig);
this.cameraSettings = renderingConfig.getCameraSettings();
- displayDevice.subscribe(this);
+ displayDevice.subscribe(DISPLAY_RESOLUTION_CHANGE, this);
}
@Override
@@ -197,7 +198,7 @@ private static Matrix4f createPerspectiveProjectionMatrix(float fov, float zNear
}
public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
- if (propertyChangeEvent.getPropertyName().equals("displayResolution")) {
+ if (propertyChangeEvent.getPropertyName().equals(DISPLAY_RESOLUTION_CHANGE)) {
cachedFov = -1; // Invalidate the cache, so that matrices get regenerated.
updateMatrices();
}
