From 7597268e8587d50cbd42008ca475da3d14ca6617 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 31 Dec 2014 17:04:03 +0900 Subject: [PATCH] Remove dependency on go-gl/gl in framebuffer.go --- internal/graphics/framebuffer.go | 4 +--- internal/graphics/internal/shader/drawtexture.go | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/graphics/framebuffer.go b/internal/graphics/framebuffer.go index 6dbf366b2..81f2594d4 100644 --- a/internal/graphics/framebuffer.go +++ b/internal/graphics/framebuffer.go @@ -15,8 +15,6 @@ package graphics import ( - // TODO: Remove this - "github.com/go-gl/gl" "github.com/hajimehoshi/ebiten/internal" "github.com/hajimehoshi/ebiten/internal/graphics/internal/shader" "github.com/hajimehoshi/ebiten/internal/opengl" @@ -113,5 +111,5 @@ func (f *Framebuffer) DrawTexture(c *opengl.Context, t *Texture, quads TextureQu } projectionMatrix := f.projectionMatrix() // TODO: Define texture.Draw() - return shader.DrawTexture(c, gl.Texture(t.native), projectionMatrix, quads, geo, clr) + return shader.DrawTexture(c, t.native, projectionMatrix, quads, geo, clr) } diff --git a/internal/graphics/internal/shader/drawtexture.go b/internal/graphics/internal/shader/drawtexture.go index 1d0307932..10ffb34b0 100644 --- a/internal/graphics/internal/shader/drawtexture.go +++ b/internal/graphics/internal/shader/drawtexture.go @@ -47,7 +47,7 @@ const size = 10000 const uint16Size = 2 const float32Size = 4 -func DrawTexture(c *opengl.Context, native gl.Texture, projectionMatrix [4][4]float64, quads TextureQuads, geo Matrix, color Matrix) error { +func DrawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix [4][4]float64, quads TextureQuads, geo Matrix, color Matrix) error { // TODO: Check len(quads) and gl.MAX_ELEMENTS_INDICES? const stride = 4 * 4 if !initialized { @@ -83,7 +83,7 @@ func DrawTexture(c *opengl.Context, native gl.Texture, projectionMatrix [4][4]fl program := useProgramColorMatrix(glMatrix(projectionMatrix), geo, color) gl.ActiveTexture(gl.TEXTURE0) - native.Bind(gl.TEXTURE_2D) + gl.Texture(texture).Bind(gl.TEXTURE_2D) vertexAttrLocation := program.GetAttributeLocation("vertex") texCoordAttrLocation := program.GetAttributeLocation("tex_coord")