Replace GL11.GL_CLAMP with GL12.GL_CLAMP_TO_EDGE to fix GL_INVALID_ENUM

This commit is contained in:
UnicornFreedom 2025-09-13 05:15:33 +02:00
parent 22ee84d74c
commit 876043bf2f
No known key found for this signature in database
GPG Key ID: B4ED0DB6B940024F

View File

@ -8,14 +8,14 @@ import org.lwjgl.opengl._
import java.awt.image.BufferedImage
import java.nio.ByteBuffer
class Texture() extends Logging with Resource {
class Texture extends Logging with Resource {
val texture: Int = GL11.glGenTextures()
bind()
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST)
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST)
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP)
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP)
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE)
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE)
def this(image: BufferedImage) {
this()