MCPcopy Index your code
hub / github.com/benfry/processing4 / initDepthBuffer

Method initDepthBuffer

core/src/processing/opengl/FrameBuffer.java:430–462  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

428
429
430 protected void initDepthBuffer() {
431 if (screenFb) return;
432
433 if (width == 0 || height == 0) {
434 throw new RuntimeException("PFramebuffer: size undefined.");
435 }
436
437 pg.pushFramebuffer();
438 pg.setFramebuffer(this);
439
440 pgl.bindRenderbuffer(PGL.RENDERBUFFER, glDepth);
441
442 int glConst = PGL.DEPTH_COMPONENT16;
443 if (depthBits == 16) {
444 glConst = PGL.DEPTH_COMPONENT16;
445 } else if (depthBits == 24) {
446 glConst = PGL.DEPTH_COMPONENT24;
447 } else if (depthBits == 32) {
448 glConst = PGL.DEPTH_COMPONENT32;
449 }
450
451 if (multisample) {
452 pgl.renderbufferStorageMultisample(PGL.RENDERBUFFER, nsamples, glConst,
453 width, height);
454 } else {
455 pgl.renderbufferStorage(PGL.RENDERBUFFER, glConst, width, height);
456 }
457
458 pgl.framebufferRenderbuffer(PGL.FRAMEBUFFER, PGL.DEPTH_ATTACHMENT,
459 PGL.RENDERBUFFER, glDepth);
460
461 pg.popFramebuffer();
462 }
463
464
465 protected void initStencilBuffer() {

Callers 1

allocateMethod · 0.95

Calls 7

pushFramebufferMethod · 0.80
setFramebufferMethod · 0.80
popFramebufferMethod · 0.80
bindRenderbufferMethod · 0.45
renderbufferStorageMethod · 0.45

Tested by

no test coverage detected