opengl: IsTexture/IsFramebuffer fails on OSX

This commit is contained in:
Hajime Hoshi 2016-02-25 02:17:28 +09:00
parent 06ec244ff3
commit 73856a2298

View File

@ -111,7 +111,7 @@ func (c *Context) Check() {
func (c *Context) NewTexture(width, height int, pixels []uint8, filter Filter) (Texture, error) {
t := gl.CreateTexture()
if !gl.IsTexture(t) {
if t.Value <= 0 {
return Texture{}, errors.New("opengl: creating texture failed")
}
gl.PixelStorei(mgl.UNPACK_ALIGNMENT, 4)
@ -160,7 +160,7 @@ func (c *Context) BindZeroFramebuffer() {
func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) {
f := gl.CreateFramebuffer()
if !gl.IsFramebuffer(f) {
if f.Value <= 0 {
return Framebuffer{}, errors.New("opengl: creating framebuffer failed: gl.IsFramebuffer returns false")
}
gl.BindFramebuffer(mgl.FRAMEBUFFER, f)