Revert "graphicsdriver/opengl: Use GL_RGBA8 as the internal format at glTexImage2D"

This reverts commit f5044f3d8f.

Reason: This doesn't work on some iOS machines
This commit is contained in:
Hajime Hoshi 2019-02-12 03:34:06 +09:00
parent 4273f1982d
commit 6c4260d0e1
3 changed files with 2 additions and 4 deletions

View File

@ -145,7 +145,7 @@ func (c *context) newTexture(width, height int) (textureNative, error) {
gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE) gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
// If data is nil, this just allocates memory and the content is undefined. // If data is nil, this just allocates memory and the content is undefined.
// https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml // https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, int32(width), int32(height), 0, gl.RGBA, gl.UNSIGNED_BYTE, nil) gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, int32(width), int32(height), 0, gl.RGBA, gl.UNSIGNED_BYTE, nil)
return nil return nil
}) })
return texture, nil return texture, nil

View File

@ -172,8 +172,6 @@ func (c *context) newTexture(width, height int) (textureNative, error) {
// In Ebiten, textures are filled with pixels laster by the filter that ignores destination, so it is fine // In Ebiten, textures are filled with pixels laster by the filter that ignores destination, so it is fine
// to leave textures as uninitialized here. Rather, extra memory allocating for initialization should be // to leave textures as uninitialized here. Rather, extra memory allocating for initialization should be
// avoided. // avoided.
// gl.RGBA8 is available as of WebGL 2.
gl.Call("texImage2D", texture2d, 0, rgba, width, height, 0, rgba, unsignedByte, nil) gl.Call("texImage2D", texture2d, 0, rgba, width, height, 0, rgba, unsignedByte, nil)
return textureNative(t), nil return textureNative(t), nil

View File

@ -130,7 +130,7 @@ func (c *context) newTexture(width, height int) (textureNative, error) {
gl.TexParameteri(mgl.TEXTURE_2D, mgl.TEXTURE_MIN_FILTER, mgl.NEAREST) gl.TexParameteri(mgl.TEXTURE_2D, mgl.TEXTURE_MIN_FILTER, mgl.NEAREST)
gl.TexParameteri(mgl.TEXTURE_2D, mgl.TEXTURE_WRAP_S, mgl.CLAMP_TO_EDGE) gl.TexParameteri(mgl.TEXTURE_2D, mgl.TEXTURE_WRAP_S, mgl.CLAMP_TO_EDGE)
gl.TexParameteri(mgl.TEXTURE_2D, mgl.TEXTURE_WRAP_T, mgl.CLAMP_TO_EDGE) gl.TexParameteri(mgl.TEXTURE_2D, mgl.TEXTURE_WRAP_T, mgl.CLAMP_TO_EDGE)
gl.TexImage2D(mgl.TEXTURE_2D, 0, mgl.RGBA8, width, height, mgl.RGBA, mgl.UNSIGNED_BYTE, nil) gl.TexImage2D(mgl.TEXTURE_2D, 0, mgl.RGBA, width, height, mgl.RGBA, mgl.UNSIGNED_BYTE, nil)
return textureNative(t), nil return textureNative(t), nil
} }