Annotation of researchv9/jtools/src/sunlib/t6.c, revision 1.1

1.1     ! root        1: /*
        !             2:        test for getrect, ngetrect, texture, mouse input, rectf
        !             3: */
        !             4: #include "jerq.h"
        !             5: short darkgrey_bits[] ={
        !             6:        0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777,
        !             7:        0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777,
        !             8: };
        !             9: 
        !            10: main (argc, argv)
        !            11: char **argv;
        !            12: {
        !            13:        Texture darkgrey;
        !            14:        Rectangle r;
        !            15: 
        !            16:        request(KBD|MOUSE|ALARM);
        !            17:        initdisplay(argc, argv);
        !            18:        darkgrey = ToTexture(darkgrey_bits);
        !            19:        alarm(60);
        !            20:        for( ; ; wait(MOUSE|ALARM)) {
        !            21:                if(button1()){
        !            22:                        ngetrect(&r, 0, 1, 0, 10, 10);
        !            23:                        rectf(&display, r, F_XOR);
        !            24:                }
        !            25:                else if(button2()){
        !            26:                        ngetrect(&r, 0, 2, 0, 10, 10);
        !            27:                        texture(&display, r, &darkgrey, F_XOR);
        !            28:                }
        !            29:                else if(button3())
        !            30:                        break;
        !            31:                if (own() & ALARM) {
        !            32:                        rectf(&display, Rect(0, 0, 100, 100), F_XOR);
        !            33:                        rectf(&display,
        !            34:                        Rect(Drect.cor.x-100, Drect.cor.y-100, Drect.cor.x, Drect.cor.y), F_XOR);
        !            35:                        alarm(60);
        !            36:                }
        !            37:                        
        !            38:        }
        !            39: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.