MCPcopy Index your code
hub / github.com/processing/processing / beginRender

Method beginRender

core/src/processing/opengl/PGL.java:695–764  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

693
694
695 protected void beginRender() {
696 if (sketch == null) {
697 sketch = graphics.parent;
698 }
699
700 pgeomCount = geomCount;
701 geomCount = 0;
702
703 pclearColor = clearColor;
704 clearColor = false;
705
706 pclearDepth = clearDepth;
707 clearDepth = false;
708
709 pclearStencil = clearStencil;
710 clearStencil = false;
711
712 if (SINGLE_BUFFERED && sketch.frameCount == 1) {
713 restoreFirstFrame();
714 }
715
716 if (fboLayerEnabledReq) {
717 fboLayerEnabled = true;
718 fboLayerEnabledReq = false;
719 }
720
721 if (fboLayerEnabled) {
722 if (fbolayerResetReq) {
723 destroyFBOLayer();
724 fbolayerResetReq = false;
725 }
726 if (!fboLayerCreated) {
727 createFBOLayer();
728 }
729
730 // Draw to the back texture
731 bindFramebufferImpl(FRAMEBUFFER, glColorFbo.get(0));
732 framebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0,
733 TEXTURE_2D, glColorTex.get(backTex), 0);
734
735 if (1 < numSamples) {
736 bindFramebufferImpl(FRAMEBUFFER, glMultiFbo.get(0));
737 }
738
739 if (sketch.frameCount == 0) {
740 // No need to draw back color buffer because we are in the first frame.
741 int argb = graphics.backgroundColor;
742 float ba = ((argb >> 24) & 0xff) / 255.0f;
743 float br = ((argb >> 16) & 0xff) / 255.0f;
744 float bg = ((argb >> 8) & 0xff) / 255.0f;
745 float bb = ((argb) & 0xff) / 255.0f;
746 clearColor(br, bg, bb, ba);
747 clear(COLOR_BUFFER_BIT);
748 } else if (!pclearColor || !sketch.isLooping()) {
749 // Render previous back texture (now is the front) as background,
750 // because no background() is being used ("incremental drawing")
751 int x = 0;
752 int y = 0;

Callers 2

beginOnscreenDrawMethod · 0.80
displayMethod · 0.80

Calls 11

restoreFirstFrameMethod · 0.95
destroyFBOLayerMethod · 0.95
createFBOLayerMethod · 0.95
bindFramebufferImplMethod · 0.95
framebufferTexture2DMethod · 0.95
clearColorMethod · 0.95
clearMethod · 0.95
getPixelScaleMethod · 0.95
drawTextureMethod · 0.95
isLoopingMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected