c++ - OpenGL framebuffer android without GL_OES_packed_depth_stencil (on Nexus 7 2012) -


how init framebuffer depth , stencil on device not support gl_oes_packed_depth_stencil (in case nexus 7 2012)?

this not work:

    glgenrenderbuffers(1, &depthstencil);      glbindrenderbuffer(gl_renderbuffer, depthstencil);     glrenderbufferstorage(gl_renderbuffer, gl_depth24_stencil8_oes, width, height);     glframebufferrenderbuffer(gl_framebuffer, gl_depth_attachment, gl_renderbuffer, depthstencil);     glframebufferrenderbuffer(gl_framebuffer, gl_stencil_attachment, gl_renderbuffer, depthstencil);      glenum status = glcheckframebufferstatus(gl_framebuffer);     //... 

you create separate renderbuffers depth , stencil:

gluint depthstencil[2]; glgenrenderbuffers(2, depthstencil);  glbindrenderbuffer(gl_renderbuffer, depthstencil[0]); glrenderbufferstorage(gl_renderbuffer, gl_depth_component16, width, height);  glbindrenderbuffer(gl_renderbuffer, depthstencil[1]); glrenderbufferstorage(gl_renderbuffer, gl_stencil_index8, width, height);  glframebufferrenderbuffer(gl_framebuffer,     gl_depth_attachment, gl_renderbuffer, depthstencil[0]); glframebufferrenderbuffer(gl_framebuffer,     gl_stencil_attachment, gl_renderbuffer, depthstencil[1]); 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -