Esempio n. 1
0
    def init_gl(self):
        self.program = oogl.ShaderProgram(
            oogl.VertexShader(vertex_shader),
            oogl.FragmentShader(fragment_shader),
        )

        self.vbo = oogl.VertexBuffer(self.data)
Esempio n. 2
0
    def init_gl(self):
        self.program = oogl.ShaderProgram(
            oogl.VertexShader(vertex_shader),
            oogl.FragmentShader(fragment_shader),
        )

        self.update_buffers()
Esempio n. 3
0
    def __init__(self):
        app.Canvas.__init__(self)
        self.geometry = 0, 0, 400, 400

        self.program = oogl.ShaderProgram(oogl.VertexShader(VERT_CODE),
                                          oogl.FragmentShader(FRAG_CODE))

        self.program.attributes['a_position'] = positions
        self.program.attributes['a_color'] = colors
Esempio n. 4
0
    def __init__(self):
        app.Canvas.__init__(self)
        self.geometry = 0, 0, 400, 400

        self.program = oogl.ShaderProgram(oogl.VertexShader(VERT_CODE),
                                          oogl.FragmentShader(FRAG_CODE))

        # Set attributes
        self.program.attributes['a_position'] = oogl.VertexBuffer(positions)
        self.program.attributes['a_color'] = oogl.VertexBuffer(colors)

        self.init_transforms()

        self.timer = app.Timer(1.0 / 60)
        self.timer.connect(self.update_transforms)
        self.timer.start()
Esempio n. 5
0
    def __init__(self):
        app.Canvas.__init__(self)

        self.geometry = 0, 0, 400, 400

        # Create program
        self._program = oogl.ShaderProgram(oogl.VertexShader(VERT_SHADER),
                                           oogl.FragmentShader(FRAG_SHADER))

        # Create vbo
        self._vbo = oogl.VertexBuffer(vertex_data)

        # Set uniforms, samplers, attributes
        self._program.attributes.update(self._vbo)
        self._program.uniforms['s_texture'] = oogl.Texture2D(im1)

        # Create first explosion
        self._new_explosion()
Esempio n. 6
0
    def __init__(self, **kwargs):
        app.Canvas.__init__(self, **kwargs)
        self.geometry = 0, 0, 400, 400

        self.program = oogl.ShaderProgram(oogl.VertexShader(VERT_CODE),
                                          oogl.FragmentShader(FRAG_CODE))

        # Set attributes
        self.program.attributes['a_position'] = oogl.VertexBuffer(positions)
        self.program.attributes['a_texcoord'] = oogl.VertexBuffer(texcoords)

        self.program.uniforms['u_texture'] = oogl.Texture2D(io.cat())

        # Handle transformations
        self.init_transforms()

        self.timer = app.Timer(1.0 / 60)
        self.timer.connect(self.update_transforms)
        self.timer.start()