mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Remove dependency on go-gl/gl in framebuffer.go
This commit is contained in:
parent
37828c452f
commit
7597268e85
@ -15,8 +15,6 @@
|
|||||||
package graphics
|
package graphics
|
||||||
|
|
||||||
import (
|
import (
|
||||||
// TODO: Remove this
|
|
||||||
"github.com/go-gl/gl"
|
|
||||||
"github.com/hajimehoshi/ebiten/internal"
|
"github.com/hajimehoshi/ebiten/internal"
|
||||||
"github.com/hajimehoshi/ebiten/internal/graphics/internal/shader"
|
"github.com/hajimehoshi/ebiten/internal/graphics/internal/shader"
|
||||||
"github.com/hajimehoshi/ebiten/internal/opengl"
|
"github.com/hajimehoshi/ebiten/internal/opengl"
|
||||||
@ -113,5 +111,5 @@ func (f *Framebuffer) DrawTexture(c *opengl.Context, t *Texture, quads TextureQu
|
|||||||
}
|
}
|
||||||
projectionMatrix := f.projectionMatrix()
|
projectionMatrix := f.projectionMatrix()
|
||||||
// TODO: Define texture.Draw()
|
// 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)
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ const size = 10000
|
|||||||
const uint16Size = 2
|
const uint16Size = 2
|
||||||
const float32Size = 4
|
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?
|
// TODO: Check len(quads) and gl.MAX_ELEMENTS_INDICES?
|
||||||
const stride = 4 * 4
|
const stride = 4 * 4
|
||||||
if !initialized {
|
if !initialized {
|
||||||
@ -83,7 +83,7 @@ func DrawTexture(c *opengl.Context, native gl.Texture, projectionMatrix [4][4]fl
|
|||||||
program := useProgramColorMatrix(glMatrix(projectionMatrix), geo, color)
|
program := useProgramColorMatrix(glMatrix(projectionMatrix), geo, color)
|
||||||
|
|
||||||
gl.ActiveTexture(gl.TEXTURE0)
|
gl.ActiveTexture(gl.TEXTURE0)
|
||||||
native.Bind(gl.TEXTURE_2D)
|
gl.Texture(texture).Bind(gl.TEXTURE_2D)
|
||||||
|
|
||||||
vertexAttrLocation := program.GetAttributeLocation("vertex")
|
vertexAttrLocation := program.GetAttributeLocation("vertex")
|
||||||
texCoordAttrLocation := program.GetAttributeLocation("tex_coord")
|
texCoordAttrLocation := program.GetAttributeLocation("tex_coord")
|
||||||
|
Loading…
Reference in New Issue
Block a user