From de21a401846579e8023bf983a997f05b509f7d3d Mon Sep 17 00:00:00 2001
From: faiface <faiface@ksp.sk>
Date: Tue, 17 Jan 2017 01:24:15 +0100
Subject: [PATCH] disable mipmaping in Texture

---
 pixelgl/interface.go |  2 +-
 pixelgl/texture.go   | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/pixelgl/interface.go b/pixelgl/interface.go
index 73189cd..f651189 100644
--- a/pixelgl/interface.go
+++ b/pixelgl/interface.go
@@ -8,4 +8,4 @@ package pixelgl
 type BeginEnder interface {
 	Begin()
 	End()
-}
\ No newline at end of file
+}
diff --git a/pixelgl/texture.go b/pixelgl/texture.go
index b14e5b7..ee1c22c 100644
--- a/pixelgl/texture.go
+++ b/pixelgl/texture.go
@@ -4,6 +4,7 @@ import (
 	"runtime"
 
 	"github.com/go-gl/gl/v3.3-core/gl"
+	"github.com/go-gl/mathgl/mgl32"
 )
 
 // Texture is an OpenGL texture.
@@ -47,19 +48,19 @@ func NewTexture(width, height int, smooth bool, pixels []uint8) *Texture {
 		gl.Ptr(pixels),
 	)
 
-	gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.MIRRORED_REPEAT)
-	gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.MIRRORED_REPEAT)
+	borderColor := mgl32.Vec4{0, 0, 0, 0}
+	gl.TexParameterfv(gl.TEXTURE_2D, gl.TEXTURE_BORDER_COLOR, &borderColor[0])
+	gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_BORDER)
+	gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_BORDER)
 
 	if smooth {
-		gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR)
+		gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
 		gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
 	} else {
-		gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_NEAREST)
+		gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)
 		gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)
 	}
 
-	gl.GenerateMipmap(gl.TEXTURE_2D)
-
 	runtime.SetFinalizer(tex, (*Texture).delete)
 
 	return tex
-- 
GitLab