|
|
1.1 root 1: /*
2: test for getrect, ngetrect, texture, mouse input, rectf
3: */
4: #include "jerq.h"
5: static 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: static Texture darkgrey;
14: Rectangle r;
15:
16: request(MOUSE);
17: initdisplay(argc, argv);
18: darkgrey = ToTexture(darkgrey_bits);
19: /* ngetrect allows optional blocking so this can work */
20: for(;;jnap(1)){
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: }
32: }
33:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.