<s> from vispy import app , gloo <EOL> from vispy . gloo import Program <EOL> vertex = """<STR_LIT>""" <EOL> fragment = """<STR_LIT>""" <EOL> class Canvas ( app . Canvas ) : <EOL> def __init__ ( self ) : <EOL> app . Canvas . __init__ ( self , size = ( <NUM_LIT> , <NUM_LIT> ) , title = '<STR_LIT>' , <EOL> keys = '<STR_LIT>' ) <EOL> self . program = Program ( vertex , fragment , count = <NUM_LIT:4> ) <EOL> self . program [ '<STR_LIT>' ] = [ ( <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:1> ) , <EOL> ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> ) , ( <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:1> ) ] <EOL> self . program [ '<STR_LIT>' ] = [ ( - <NUM_LIT:1> , - <NUM_LIT:1> ) , ( - <NUM_LIT:1> , + <NUM_LIT:1> ) , <EOL> ( + <NUM_LIT:1> , - <NUM_LIT:1> ) , ( + <NUM_LIT:1> , + <NUM_LIT:1> ) ] <EOL> gloo . set_viewport ( <NUM_LIT:0> , <NUM_LIT:0> , * self . physical_size ) <EOL> self . show ( ) <EOL> def on_draw ( self , event ) : <EOL> gloo . clear ( color = '<STR_LIT>' ) <EOL> self . program . draw ( '<STR_LIT>' ) <EOL> def on_resize ( self , event ) : <EOL> gloo . set_viewport ( <NUM_LIT:0> , <NUM_LIT:0> , * event . physical_size ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> c = Canvas ( ) <EOL> app . run ( ) </s>
