Search in sources :

Example 6 with Texture2DGL

use of io.xol.chunkstories.renderer.opengl.texture.Texture2DGL in project chunkstories by Hugobros3.

the class ObjectRenderer method renderTexturedRotatedRectRVBA.

public static void renderTexturedRotatedRectRVBA(float xpos, float ypos, float w, float h, float rot, float tcsx, float tcsy, float tcex, float tcey, String textureName, float r, float v, float b, float a) {
    /*if (textureName.startsWith("internal://"))
			textureName = textureName.substring("internal://".length());
		else if (textureName.startsWith("gameDir://"))
			textureName = textureName.substring("gameDir://".length());//GameDirectory.getGameFolderPath() + "/" + tex.substring("gameDir://".length());
		else if (textureName.contains("../"))
			textureName = ("./" + textureName.replace("../", "") + ".png");
		else
			textureName = ("./textures/" + textureName + ".png");
		 */
    Texture2DGL texture = TexturesHandler.getTexture(textureName);
    texture.setLinearFiltering(false);
    // TexturesHandler.mipmapLevel(texture, -1);
    Client.getInstance().getGameWindow().getRenderingInterface().getGuiRenderer().drawBoxWindowsSpace(xpos - w / 2, ypos + h / 2, xpos + w / 2, ypos - h / 2, tcsx, tcsy, tcex, tcey, texture, false, true, new Vector4f(r, v, b, a));
}
Also used : Vector4f(org.joml.Vector4f) Texture2DGL(io.xol.chunkstories.renderer.opengl.texture.Texture2DGL)

Aggregations

Texture2DGL (io.xol.chunkstories.renderer.opengl.texture.Texture2DGL)6 Vector4f (org.joml.Vector4f)4 Shader (io.xol.chunkstories.api.rendering.shader.Shader)1 Texture2DRenderTargetGL (io.xol.chunkstories.renderer.opengl.texture.Texture2DRenderTargetGL)1 FontFormatException (java.awt.FontFormatException)1 DataBuffer (java.awt.image.DataBuffer)1 DataBufferByte (java.awt.image.DataBufferByte)1 DataBufferInt (java.awt.image.DataBufferInt)1 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1