summaryrefslogtreecommitdiff
path: root/draw.c
blob: 442979809ee6c18a83fb463d611cdd31da75cd49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "xenon.h"
#include "draw.h"
#include "damage.h"

unsigned char* pixels;
xenon_rect screen_rect;

void draw_rectangle(GC gc, xenon_rect* r)
{
	for(int i = r->x ; i < r->x + r->w ; i++)
	{
		pixelrgba(i, r->y) = 0xffffffff;
		pixelrgba(i, r->y + r->h -1) = 0xffffffff;
	}
	for(int j = r->y ; j < r->y + r->h ; j++)
	{
		pixelrgba(r->x, j) = 0xffffffff;
		pixelrgba(r->x + r->w -1, j) = 0xffffffff;
	}
	damage_add(r);
}