Hello,

The following code displays a blank stage (i.e. the image is not
rendered at all). Why is this so? I'd expect a 50x50 rectangle to be
visible.


import clutter
from clutter import cogl

class Texture(clutter.Texture):
    __gtype_name__ = 'Texture'

    def do_paint(self):
        cogl.push_matrix()
        cogl.clip_set(0, 0, 50, 50)
        clutter.Texture.do_paint(self)
        cogl.clip_unset()
        cogl.pop_matrix()

stage = clutter.Stage()
stage.set_size(640, 480)
stage.connect('key-press-event', clutter.main_quit)

tex = Texture('image.png')
tex.set_size(200, 200)
stage.add(tex)

stage.show_all()
clutter.main()



Thomas
-- 
To unsubscribe send a mail to [email protected]

Reply via email to