summaryrefslogtreecommitdiff
path: root/draw.h
blob: 7e6a2e19ccefb69237b739dac256eeebe2f6d3d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef _draw_h_
#define _draw_h_

#include "xenon.h"

#define pixelr(x,y) pixels[(screen_rect.w * (y) + (x))*4 + 0]
#define pixelg(x,y) pixels[(screen_rect.w * (y) + (x))*4 + 1]
#define pixelb(x,y) pixels[(screen_rect.w * (y) + (x))*4 + 2]
#define pixela(x,y) pixels[(screen_rect.w * (y) + (x))*4 + 3]

#define pixelrgba(x,y) ((unsigned*)pixels)[(screen_rect.w * (y) + (x))]

typedef struct xenon_rect
{
	int x, y;
	int w, h;
}
xenon_rect;
extern unsigned char* pixels;
extern xenon_rect screen_rect;

extern void draw_point(GC gc, int x, int y);
extern void draw_rectangle(GC gc, xenon_rect* r);
extern void draw_image(GC gc, XImage* image, xenon_rect* area, int x, int y);

#endif