Add RenderThreadTaskHandler
This commit is contained in:
@@ -18,7 +18,8 @@ import com.seibel.distanthorizons.core.enums.MinecraftTextFormat;
|
||||
import com.seibel.distanthorizons.core.jar.ModJarInfo;
|
||||
import com.seibel.distanthorizons.core.jar.updater.SelfUpdater;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.distanthorizons.core.render.glObject.GLProxy;
|
||||
import com.seibel.distanthorizons.common.render.nativeGl.glObject.GLProxy;
|
||||
import com.seibel.distanthorizons.core.render.RenderThreadTaskHandler;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IModAccessor;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IModChecker;
|
||||
import com.seibel.distanthorizons.coreapi.DependencyInjection.ApiEventInjector;
|
||||
@@ -67,7 +68,7 @@ public abstract class AbstractModInitializer
|
||||
|
||||
public void onInitializeClient()
|
||||
{
|
||||
GLProxy.queueRunningOnRenderThread(() -> { DependencySetup.createRenderBindings(); });
|
||||
RenderThreadTaskHandler.INSTANCE.queueRunningOnRenderThread(() -> { DependencySetup.createRenderBindings(); });
|
||||
DependencySetup.createClientBindings();
|
||||
this.createInitialClientBindings();
|
||||
|
||||
|
||||
+6
-5
@@ -8,10 +8,11 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.seibel.distanthorizons.api.objects.render.DhApiRenderableBox;
|
||||
import com.seibel.distanthorizons.core.logging.DhLogger;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.distanthorizons.core.render.glObject.GLEnums;
|
||||
import com.seibel.distanthorizons.core.render.glObject.GLProxy;
|
||||
import com.seibel.distanthorizons.core.render.renderer.generic.IGenericObjectVertexBufferContainer;
|
||||
import com.seibel.distanthorizons.core.render.renderer.generic.RenderableBoxGroup;
|
||||
import com.seibel.distanthorizons.common.render.nativeGl.glObject.GLEnums;
|
||||
import com.seibel.distanthorizons.common.render.nativeGl.glObject.GLProxy;
|
||||
import com.seibel.distanthorizons.core.render.RenderThreadTaskHandler;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.render.IGenericObjectVertexBufferContainer;
|
||||
import com.seibel.distanthorizons.common.render.nativeGl.generic.RenderableBoxGroup;
|
||||
import com.seibel.distanthorizons.core.util.ColorUtil;
|
||||
import org.lwjgl.opengl.GL32;
|
||||
|
||||
@@ -258,7 +259,7 @@ public class BlazeGenericObjectVertexContainer implements IGenericObjectVertexBu
|
||||
@Override
|
||||
public void close()
|
||||
{
|
||||
GLProxy.queueRunningOnRenderThread(() ->
|
||||
RenderThreadTaskHandler.INSTANCE.queueRunningOnRenderThread(() ->
|
||||
{
|
||||
if (this.vboGpuBuffer != null)
|
||||
{
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Distant Horizons mod
|
||||
* licensed under the GNU LGPL v3 License.
|
||||
*
|
||||
* Copyright (C) 2020 James Seibel
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.seibel.distanthorizons.common.util;
|
||||
|
||||
/**
|
||||
* Added to MC's dynamic textures via mixins
|
||||
* in order to denote whether a texture is a lightmap or not. <br><br>
|
||||
*
|
||||
* If not done any dynamic texture could be used as the lightmap
|
||||
* which causes some weird rendering bugs.
|
||||
*/
|
||||
public interface ILightTextureMarker
|
||||
{
|
||||
void markLightTexture();
|
||||
}
|
||||
+3
-2
@@ -24,7 +24,8 @@ import java.io.File;
|
||||
import com.mojang.blaze3d.platform.Window;
|
||||
import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper;
|
||||
import com.seibel.distanthorizons.core.file.structure.ClientOnlySaveStructure;
|
||||
import com.seibel.distanthorizons.core.render.glObject.GLProxy;
|
||||
import com.seibel.distanthorizons.common.render.nativeGl.glObject.GLProxy;
|
||||
import com.seibel.distanthorizons.core.render.RenderThreadTaskHandler;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper;
|
||||
import com.seibel.distanthorizons.coreapi.ModInfo;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
@@ -225,7 +226,7 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
|
||||
player.displayClientMessage(net.minecraft.network.chat.Component.translatable(string), /*isOverlay*/false);
|
||||
#else
|
||||
|
||||
GLProxy.queueRunningOnRenderThread(() ->
|
||||
RenderThreadTaskHandler.INSTANCE.queueRunningOnRenderThread(() ->
|
||||
{
|
||||
player.displayClientMessage(net.minecraft.network.chat.Component.translatable(string), /*isOverlay*/false);
|
||||
});
|
||||
|
||||
+1
-1
Submodule coreSubProjects updated: 8240101a46...82c832a4af
Reference in New Issue
Block a user