Quick search

Table Of Contents

GL instructions

New in version 1.3.0.

Clearing an FBO

To clear an FBO, you can use ClearColor and ClearBuffers instructions like this example:

self.fbo = Fbo(size=self.size)
with self.fbo:
    ClearColor(0, 0, 0, 0)
    ClearBuffers()
class kivy.graphics.gl_instructions.ClearColor

Bases: kivy.graphics.instructions.Instruction

ClearColor Graphic Instruction.

New in version 1.3.0.

Sets the clear color used to clear buffers with glClear function, or ClearBuffers graphics instructions.

a

Alpha component, between 0-1

b

Blue component, between 0-1

g

Green component, between 0-1

r

Red component, between 0-1

rgb

RGB color, list of 3 values in 0-1 range, alpha will be 1.

rgba

RGBA used for clear color, list of 4 values in 0-1 range

class kivy.graphics.gl_instructions.ClearBuffers

Bases: kivy.graphics.instructions.Instruction

Clearbuffer Graphic Instruction

New in version 1.3.0.

Clear the buffers specified by the instructions buffer mask property. By default, only the coloc buffer is cleared.

clear_color

If true, the color buffer will be cleared

clear_depth

If true, the depth buffer will be cleared

clear_stencil

If true, the stencil buffer will be cleared