exp/gl/glutil: set blend mode when drawing sprites
Change-Id: Ib8a3dc3b08c8d64f2d461f943c8ebab75578a127
Reviewed-on: https://go-review.googlesource.com/17320
Reviewed-by: Nigel Tao <nigeltao@golang.org>
diff --git a/exp/gl/glutil/glimage.go b/exp/gl/glutil/glimage.go
index 55aba42..ca41c07 100644
--- a/exp/gl/glutil/glimage.go
+++ b/exp/gl/glutil/glimage.go
@@ -169,6 +169,9 @@
glimage := img.images
glctx := img.images.glctx
+ glctx.BlendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA)
+ glctx.Enable(gl.BLEND)
+
// TODO(crawshaw): Adjust viewport for the top bar on android?
glctx.UseProgram(glimage.program)
{
@@ -288,6 +291,8 @@
glctx.DisableVertexAttribArray(glimage.pos)
glctx.DisableVertexAttribArray(glimage.inUV)
+
+ glctx.Disable(gl.BLEND)
}
var quadXYCoords = f32.Bytes(binary.LittleEndian,