mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-11 10:17:29 +00:00
Merge branch 'no-texture'
This commit is contained in:
4 files changed
+16
No files matched your search
@@ -23,11 +23,13 @@
|
||||
package com.falsepattern.lib.util;
|
||||
|
||||
import com.falsepattern.lib.StableAPI;
|
||||
import com.falsepattern.lib.internal.Tags;
|
||||
import com.falsepattern.lib.internal.render.ClampedIcon;
|
||||
import com.falsepattern.lib.internal.render.FullTextureIcon;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import lombok.val;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -45,6 +47,7 @@ import static net.minecraft.client.Minecraft.getMinecraft;
|
||||
@StableAPI(since = "0.8.0")
|
||||
public final class RenderUtil {
|
||||
private static final Timer MINECRAFT_TIMER = getMinecraftTimer();
|
||||
private static final ResourceLocation EMPTY_TEXTURE = new ResourceLocation(Tags.MODID, "textures/gui/empty_texture.png");
|
||||
|
||||
/**
|
||||
* Sets the OpenGL translation, relative to the player's position.
|
||||
@@ -95,6 +98,19 @@ public final class RenderUtil {
|
||||
return new ClampedIcon(icon);
|
||||
}
|
||||
|
||||
/**
|
||||
* Binds an empty texture.
|
||||
* <p>
|
||||
* When rendering without shaders, using {@link GL11#glDisable(int)} with {@link GL11#GL_TEXTURE_2D}
|
||||
* is sufficient to achieve the same effect.
|
||||
* <p>
|
||||
* However, when shaders are enabled, disabling textures using this method will have no effect. Therefore this method can be used as a workaround.
|
||||
*/
|
||||
@StableAPI.Expose(since = "1.3.0")
|
||||
public static void bindEmptyTexture() {
|
||||
getMinecraft().renderEngine.bindTexture(EMPTY_TEXTURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the partial tick between the last and next client tick, in the range of 0 to 1.
|
||||
* <p>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 139 B |
Binary file not shown.
|
After Width: | Height: | Size: 140 B |
Binary file not shown.
|
After Width: | Height: | Size: 141 B |
Reference in new issue
Block a user