objective c - glCheckFramebufferStatus returns 0 in iOS 8 -
i making app utilizes rendering texture opengl es 2.0. have tested code in ios 7.1 numerous times without error. after updating ios 8.0 getting return of 0 on glcheckframebufferstatus. after doing research have found glcheckframebufferstatus returns 0 when there error. know why happening after updating ios 8.0? here code:
// generate renderbufferer glgenrenderbuffers(1, &viewrenderbuffer); glbindrenderbuffer(gl_renderbuffer, viewrenderbuffer); [context renderbufferstorage:gl_renderbuffer fromdrawable:(id<eagldrawable>)self.layer]; glgetrenderbufferparameteriv(gl_renderbuffer, gl_renderbuffer_width, &backingwidth); glgetrenderbufferparameteriv(gl_renderbuffer, gl_renderbuffer_height, &backingheight); // generate framebuffer object texture handling glgenframebuffers(1, &textureframebuffer); glbindframebuffer(gl_framebuffer, textureframebuffer); // generate texture , bind framebuffer glgentextures(1, &layers[0]); glbindtexture(gl_texture_2d, layers[0]); glteximage2d(gl_texture_2d, 0, gl_rgba, backingwidth, backingheight, 0, gl_rgba, gl_unsigned_byte, null); gltexparameterf(gl_texture_2d, gl_texture_mag_filter, gl_linear); gltexparameterf(gl_texture_2d, gl_texture_min_filter, gl_linear); gltexparameterf(gl_texture_2d, gl_texture_wrap_s, gl_clamp_to_edge); gltexparameterf(gl_texture_2d, gl_texture_wrap_t, gl_clamp_to_edge); glframebuffertexture2d(gl_framebuffer, gl_color_attachment0, gl_texture_2d, layers[0], 0); if(glcheckframebufferstatus(gl_framebuffer) != gl_framebuffer_complete){ nslog(@"failed make complete textureframebuffer objects %x", glcheckframebufferstatus(gl_framebuffer)); // returns "failed make complete textureframebuffer objects 0" return no; }
Comments
Post a Comment