mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
opengl: Refactoring
This commit is contained in:
parent
7fbf9f652e
commit
95a925ec9a
@ -245,7 +245,7 @@ func (c *drawImageCommand) Exec(indexOffsetInBytes int) error {
|
||||
proj := f.ProjectionMatrix()
|
||||
dw, dh := c.dst.Size()
|
||||
sw, sh := c.src.Size()
|
||||
opengl.UseProgram(proj, c.src.image.Texture, dw, dh, sw, sh, c.color, c.filter)
|
||||
opengl.UseProgram(proj, c.src.image, dw, dh, sw, sh, c.color, c.filter)
|
||||
opengl.GetContext().DrawElements(c.nindices, indexOffsetInBytes)
|
||||
|
||||
// glFlush() might be necessary at least on MacBook Pro (a smilar problem at #419),
|
||||
|
@ -266,8 +266,8 @@ func BufferSubData(vertices []float32, indices []uint16) {
|
||||
c.elementArrayBufferSubData(indices)
|
||||
}
|
||||
|
||||
func UseProgram(proj []float32, texture Texture, dstW, dstH, srcW, srcH int, colorM *affine.ColorM, filter graphics.Filter) {
|
||||
theOpenGLState.useProgram(proj, texture, dstW, dstH, srcW, srcH, colorM, filter)
|
||||
func UseProgram(proj []float32, src *Image, dstW, dstH, srcW, srcH int, colorM *affine.ColorM, filter graphics.Filter) {
|
||||
theOpenGLState.useProgram(proj, src.Texture, dstW, dstH, srcW, srcH, colorM, filter)
|
||||
}
|
||||
|
||||
// useProgram uses the program (programTexture).
|
||||
|
Loading…
Reference in New Issue
Block a user