Skip to content

Commit

Permalink
added an error if glGenTextures fails
Browse files Browse the repository at this point in the history
  • Loading branch information
tfriedel6 committed Jul 10, 2019
1 parent 5ce888f commit 9f92f2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/goglbackend/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9f92f2c

Please sign in to comment.