opengl: Unexport TexSubImage2D

This commit is contained in:
Hajime Hoshi 2018-11-04 19:42:21 +09:00
parent 531251d4ad
commit 786b349579
5 changed files with 8 additions and 4 deletions

View File

@ -307,7 +307,7 @@ func (c *replacePixelsCommand) Exec(indexOffsetInBytes int) error {
// glFlush is necessary on Android.
// glTexSubImage2D didn't work without this hack at least on Nexus 5x and NuAns NEO [Reloaded] (#211).
opengl.GetContext().Flush()
opengl.GetContext().TexSubImage2D(c.dst.image.Texture, c.pixels, c.x, c.y, c.width, c.height)
c.dst.image.TexSubImage2D(c.pixels, c.x, c.y, c.width, c.height)
return nil
}

View File

@ -220,7 +220,7 @@ func (c *Context) isTexture(t Texture) bool {
return r
}
func (c *Context) TexSubImage2D(t Texture, p []byte, x, y, width, height int) {
func (c *Context) texSubImage2D(t Texture, p []byte, x, y, width, height int) {
c.bindTexture(t)
_ = c.runOnContextThread(func() error {
gl.TexSubImage2D(gl.TEXTURE_2D, 0, int32(x), int32(y), int32(width), int32(height), gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(p))

View File

@ -241,7 +241,7 @@ func (c *Context) isTexture(t Texture) bool {
return gl.Call("isTexture", js.Value(t)).Bool()
}
func (c *Context) TexSubImage2D(t Texture, pixels []byte, x, y, width, height int) {
func (c *Context) texSubImage2D(t Texture, pixels []byte, x, y, width, height int) {
c.bindTexture(t)
gl := c.gl
// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,

View File

@ -191,7 +191,7 @@ func (c *Context) isTexture(t Texture) bool {
return gl.IsTexture(mgl.Texture(t))
}
func (c *Context) TexSubImage2D(t Texture, p []byte, x, y, width, height int) {
func (c *Context) texSubImage2D(t Texture, p []byte, x, y, width, height int) {
c.bindTexture(t)
gl := c.gl
gl.TexSubImage2D(mgl.TEXTURE_2D, 0, x, y, width, height, mgl.RGBA, mgl.UNSIGNED_BYTE, p)

View File

@ -128,3 +128,7 @@ func (i *Image) ensureFramebuffer() error {
i.Framebuffer = f
return nil
}
func (i *Image) TexSubImage2D(p []byte, x, y, width, height int) {
theContext.texSubImage2D(i.Texture, p, x, y, width, height)
}