Clears the buffer, optionally to a specific color.

 @option options :color [Gosu::Color, Array<Float>] (transparent)
171693
def clear(options = {})
      options = {
          color: [0.0, 0.0, 0.0, 0.0],
      }.merge! options

      color = options[:color]
      color = color.to_opengl if color.is_a? Gosu::Color

      Gl.glBindFramebufferEXT Gl::GL_FRAMEBUFFER_EXT, fbo_id unless rendering?

      Gl.glDisable Gl::GL_BLEND # Need to replace the alpha too.
      Gl.glClearColor(*color)
      Gl.glClear Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT
      Gl.glEnable Gl::GL_BLEND

      Gl.glBindFramebufferEXT Gl::GL_FRAMEBUFFER_EXT, 0 unless rendering?

      nil
    end
1021040
public void clear () {
		minWidth = null;
		minHeight = null;
		prefWidth = null;
		prefHeight = null;
		maxWidth = null;
		maxHeight = null;
		spaceTop = null;
		spaceLeft = null;
		spaceBottom = null;
		spaceRight = null;
		padTop = null;
		padLeft = null;
		padBottom = null;
		padRight = null;
		fillX = null;
		fillY = null;
		align = null;
		expandX = null;
		expandY = null;
		ignore = null;
		colspan = null;
		uniformX = null;
		uniformY = null;
	}
1066197
private void clearBackBuffer() {
        // Manually clear the backbuffer
        if(backbuffer != null) {
            Graphics2D graphics = backbuffer.createGraphics();
            Color backgroundColor = colorConfiguration.toAWTColor(TextColor.ANSI.DEFAULT, false, false);
            graphics.setColor(backgroundColor);
            graphics.fillRect(0, 0, getWidth(), getHeight());
            graphics.dispose();
        }
    }
204934
function () {
            // do nothing if there is no saved states
            if (this._matrixStack.length !== 0) {
                var color = this._colorStack.pop();
                var matrix = this._matrixStack.pop();

                // restore the previous context
                this.currentColor.copy(color);
                this.currentTransform.copy(matrix);

                // recycle objects
                me.pool.push(color);
                me.pool.push(matrix);
            }

            if (this._scissorStack.length !== 0) {
                // FIXME : prevent `scissor` object realloc and GC
                this.currentScissor.set(this._scissorStack.pop());
            } else {
                // turn off scissor test
                this.gl.disable(this.gl.SCISSOR_TEST);
                this.currentScissor[0] = 0;
                this.currentScissor[1] = 0;
                this.currentScissor[2] = this.backBufferCanvas.width;
                this.currentScissor[3] = this.backBufferCanvas.height;
            }
        }
499173
def clear(self, size=-1, *, offset=0, chunk=None) -> None:
        '''
            
        '''

        self.mglo.clear(size, offset, chunk)
1295721
public JsonXOutput clear(boolean clearBuffer)
    {
        if(clearBuffer)
            tail = head.clear();
        
        lastRepeated = false;
        lastNumber = 0;
        
        return this;
    }
1262376
def cleanup(self):
        ""
        if self.m_glVertBuffer != 0:
            glDeleteBuffers(1, (self.m_glIndexBuffer,))
            glDeleteVertexArrays( 1, (self.m_glVertArray,) )
            glDeleteBuffers(1, (self.m_glVertBuffer,))
            self.m_glIndexBuffer = 0
            self.m_glVertArray = 0
            self.m_glVertBuffer = 0
828705
def clear_canvas(self):
        """"""
        self.fig = None
        self.fmt = None
        self._qpix_buffer = []
        self.repaint()
766196
public void clearAlphaMap() {
		pushTransform();
		GL.glLoadIdentity();
		
		int originalMode = currentDrawingMode;
		setDrawMode(MODE_ALPHA_MAP);
		setColor(new Color(0,0,0,0));
		fillRect(0, 0, screenWidth, screenHeight);
		setColor(currentColor);
		setDrawMode(originalMode);
		
		popTransform();
	}
439449
public void setClearColor (int argb) {
    float red   = ((argb >> 16) & 0xFF) / 255f;
    float green = ((argb >>  8) & 0xFF) / 255f;
    float blue  = ((argb >>  0) & 0xFF) / 255f;
    float alpha = ((argb >> 24) & 0xFF) / 255f;
    setClearColor(red, green, blue, alpha);
  }
813267
void clear() {
        offset = intLen = 0;
        for (int index=0, n=value.length; index < n; index++)
            value[index] = 0;
    }
353607
function (clearAll, clearColor) {
        var dom = this.dom;
        var ctx = this.ctx;
        var width = dom.width;
        var height = dom.height;

        var clearColor = clearColor || this.clearColor;
        var haveMotionBLur = this.motionBlur && !clearAll;
        var lastFrameAlpha = this.lastFrameAlpha;

        var dpr = this.dpr;

        if (haveMotionBLur) {
            if (!this.domBack) {
                this.createBackBuffer();
            }

            this.ctxBack.globalCompositeOperation = 'copy';
            this.ctxBack.drawImage(
                dom, 0, 0,
                width / dpr,
                height / dpr
            );
        }

        ctx.clearRect(0, 0, width, height);
        if (clearColor && clearColor !== 'transparent') {
            var clearColorGradientOrPattern;
            // Gradient
            if (clearColor.colorStops) {
                // Cache canvas gradient
                clearColorGradientOrPattern = clearColor.__canvasGradient || Style.getGradient(ctx, clearColor, {
                    x: 0,
                    y: 0,
                    width: width,
                    height: height
                });

                clearColor.__canvasGradient = clearColorGradientOrPattern;
            }
            // Pattern
            else if (clearColor.image) {
                clearColorGradientOrPattern = Pattern.prototype.getCanvasPattern.call(clearColor, ctx);
            }
            ctx.save();
            ctx.fillStyle = clearColorGradientOrPattern || clearColor;
            ctx.fillRect(0, 0, width, height);
            ctx.restore();
        }

        if (haveMotionBLur) {
            var domBack = this.domBack;
            ctx.save();
            ctx.globalAlpha = lastFrameAlpha;
            ctx.drawImage(domBack, 0, 0, width, height);
            ctx.restore();
        }
    }
551165
def ClearVar(self):
    """"""
    self.value = None
    # Call OnClearVar on options.
    _ = [option.OnClearVar() for option in self.options]
1039022
protected void clear() {
        this.data.clear();
        this.buffer.clear();
        this.child = null;
        this.timestamp = Entry.defaultTimestamp;
    }
971417
public void resetWithShared(char[] buf, int start, int len)
    {
        // Let's first mark things we need about input buffer
        mInputBuffer = buf;
        mInputStart = start;
        mInputLen = len;

        // Then clear intermediate values, if any:
        mResultString = null;
        mResultArray = null;

        // And then reset internal input buffers, if necessary:
        if (mHasSegments) {
            clearSegments();
        }
    }
212293
def clear(self, scope = 'screen'):
        """"""
        if scope == 'line':
            self.clear('beginning of line')
            self.clear('end of line')
        else: self.stream.write(self._get_cap('clear '+scope))
        self.flush()
305815
public function clear() {

        // set bold and underscore to false
        $this->bold         = false;
        $this->underscore   = false;

        // set the text and fill color to empty colors
        $this->textColor    = new Color();
        $this->fillColor    = new Color(); 
    }