Remove dependency on go-gl/gl in framebuffer.go

This commit is contained in:
Hajime Hoshi 2014-12-31 17:04:03 +09:00
parent 37828c452f
commit 7597268e85
2 changed files with 3 additions and 5 deletions

View File

@ -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)
}

View File

@ -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")