added an error if glGenTextures fails

This commit is contained in:
Thomas Friedel 2019-07-10 11:34:21 +02:00
parent 5ce888f8b9
commit 9f92f2c5c4

View file

@ -23,6 +23,10 @@ func (b *GoGLBackend) LoadImage(src image.Image) (backendbase.Image, error) {
var tex uint32
gl.GenTextures(1, &tex)
if tex == 0 {
return nil, errors.New("glGenTextures failed")
}
gl.ActiveTexture(gl.TEXTURE0)
gl.BindTexture(gl.TEXTURE_2D, tex)
if src == nil {