opengl - glCheckFramebufferStatus returns 36062 -
problem: glcheckframebufferstatus returns value(36062) doesn't match documented constant.
i'm trying create framebuffer object , check status, glcheckframebufferstatus returns value doesn't match constant.
doing wrong? other commands worked far.
code (blitzmax):
glgenframebuffers(1, varptr gl_framebuffer) glgentextures(1, varptr gl_framebuffertex) glbindtexture(gl_texture_2d, gl_framebuffertex) glteximage2d(gl_texture_2d, 0, gl_rgb, vrw, vrh, 0, gl_rgb, gl_unsigned_byte, 0) gltexparameteri(gl_texture_2d, gl_texture_mag_filter, gl_nearest); gltexparameteri(gl_texture_2d, gl_texture_min_filter, gl_nearest); glbindframebuffer(gl_framebuffer, gl_framebuffer) glframebuffertexturearb(gl_read_framebuffer, gl_color_attachment0, gl_framebuffertex, 0) glframebuffertexturearb(gl_draw_framebuffer, gl_color_attachment0, gl_framebuffertex, 0) local fbo0status:int = glcheckframebufferstatus(gl_framebuffer) select fbo0status case gl_framebuffer_incomplete_attachment print "[fbo0] gl_framebuffer_incomplete_attachment" ... default print "[fbo0] gl_i_dont_know_this_freaking_value (" + fbo0status + ")" endselect
so ran problem while following erroneous fbo demo code. after half hour of debugging, figured out problem.
the issue here code
local fbo0status:int = glcheckframebufferstatus(gl_framebuffer)
according opengl documentation here:
http://www.opengl.org/sdk/docs/man3/xhtml/glcheckframebufferstatus.xml
you should not passing in framebuffer id. instead should passing in gl_framebuffer.
the specifications state upon passing invalid value glcheckframebufferstatus(), should generate gl_invalid_enum. seems driver bug generates 36062 instead.
Comments
Post a Comment