Render Overlays without asking for an instance of the game
parent
4969939fdc
commit
8d6220386f
|
@ -81,7 +81,7 @@ public class Litecraft extends Game
|
|||
// If there's a world, render it!
|
||||
if (this.world != null) renderWorld(this);
|
||||
// Render any overlays (GUIs, HUDs)
|
||||
this.engine.renderOverlays(this);
|
||||
this.engine.renderOverlays();
|
||||
// Put what's stored in the inactive framebuffer on the screen
|
||||
Window.swapBuffers();
|
||||
}
|
||||
|
@ -104,7 +104,6 @@ public class Litecraft extends Game
|
|||
((GingerGL)engine).getRegistry().masterRenderer.renderScene(data.entities, data.normalMapEntities, data.lights, data.camera, data.clippingPlane);
|
||||
((GingerGL)engine).contrastFbo.unbindFBO();
|
||||
PostProcessing.doPostProcessing(((GingerGL)engine).contrastFbo.colorTexture);
|
||||
if (data.handleGuis) ((GingerGL)engine).renderOverlays(game);
|
||||
}
|
||||
|
||||
public void update()
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.github.hydos.ginger.engine.common.api;
|
||||
|
||||
import com.github.hydos.ginger.engine.common.api.game.Game;
|
||||
import com.github.hydos.ginger.engine.common.io.Window;
|
||||
import com.github.hydos.ginger.engine.common.screen.Screen;
|
||||
import com.github.hydos.ginger.engine.common.util.Timer;
|
||||
|
@ -50,5 +49,5 @@ public abstract class GingerEngine
|
|||
|
||||
public abstract void openScreen(Screen screen);
|
||||
|
||||
public abstract void renderOverlays(Game game);
|
||||
public abstract void renderOverlays();
|
||||
}
|
||||
|
|
|
@ -83,8 +83,7 @@ public class StaticCube
|
|||
|
||||
public static Mesh getCube()
|
||||
{
|
||||
if (mesh == null)
|
||||
{ mesh = new Mesh(vertices, textureCoords, new float[vertices.length], indices, vertices.length); }
|
||||
if (mesh == null) mesh = new Mesh(vertices, textureCoords, new float[vertices.length], indices, vertices.length);
|
||||
return mesh;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,9 +60,9 @@ public class GingerGL extends GingerEngine
|
|||
return text;
|
||||
}
|
||||
|
||||
public void renderOverlays(Game game)
|
||||
public void renderOverlays()
|
||||
{
|
||||
getRegistry().masterRenderer.renderGuis(game.data.guis);
|
||||
getRegistry().masterRenderer.renderGuis(getRegistry().game.data.guis);
|
||||
if (getRegistry().currentScreen != null) getRegistry().masterRenderer.renderGuis(getRegistry().currentScreen.elements);
|
||||
TextMaster.render();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue