File:  [Research Unix] / researchv9 / jtools / src / sunlib / t4.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

/*
	test for getrect, ngetrect, texture, mouse input, rectf
*/
#include "jerq.h"
static short darkgrey_bits[] ={
	0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777,
	0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777,
};

main (argc, argv)
char **argv;
{
	static Texture darkgrey;
	Rectangle r;

	request(MOUSE);
	initdisplay(argc, argv);
	darkgrey = ToTexture(darkgrey_bits);
	/* ngetrect allows optional blocking so this can work */
	for(;;jnap(1)){
		if(button1()){
			ngetrect(&r, 0, 1, 0, 10, 10);
			rectf(&display, r, F_XOR);
		}
		else if(button2()){
			ngetrect(&r, 0, 2, 0, 10, 10);
			texture(&display, r, &darkgrey, F_XOR);
		}
		else if(button3())
			break;
	}
}


unix.superglobalmegacorp.com

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