graphicsdriver/opengl: Add error checks

This commit is contained in:
Hajime Hoshi 2019-12-31 04:22:28 +09:00
parent e725c7ee78
commit 8285fbfac9

View File

@ -39,6 +39,10 @@ func (s *pboState) mapPBO(img *Image) {
if img.pbo == *new(buffer) {
img.pbo = img.driver.context.newPixelBufferObject(w, h)
}
if img.pbo == *new(buffer) {
panic("opengl: newPixelBufferObject failed")
}
s.image = img
s.mappedPBO = img.driver.context.mapPixelBuffer(img.pbo, img.textureNative)