use of io.xol.chunkstories.api.entity.interfaces.EntityOverlay in project chunkstories by Hugobros3.
the class WorldRendererImplementation method blitFinalImage.
public void blitFinalImage(RenderingInterface renderingContext, boolean hideGui) {
Texture finalBuffer = this.renderingGraph.getRenderPass("final").resolvedOutputs.get("finalBuffer");
if (finalBuffer != null && finalBuffer instanceof Texture2D) {
final Texture2D finalTexture = (Texture2D) (finalBuffer);
// We render to the screen.
renderingContext.getRenderTargetManager().setConfiguration(null);
renderingContext.setDepthTestMode(DepthTestMode.DISABLED);
renderingContext.setBlendMode(BlendMode.DISABLED);
renderingContext.useShader("blit");
renderingContext.bindTexture2D("diffuseTexture", finalTexture);
renderingContext.drawFSQuad();
if (!hideGui) {
world.entitiesLock.readLock().lock();
Iterator<Entity> ei = world.getAllLoadedEntities();
Entity e;
while (ei.hasNext()) {
e = ei.next();
if (e instanceof EntityOverlay) {
((EntityOverlay) e).drawEntityOverlay(renderingContext);
}
}
world.entitiesLock.readLock().unlock();
}
}
}
Aggregations