diff options
author | Stephane Marchesin <stephane.marchesin@gmail.com> | 2010-09-22 11:53:21 -0700 |
---|---|---|
committer | Stephane Marchesin <stephane.marchesin@gmail.com> | 2010-09-22 11:53:21 -0700 |
commit | 2603fb51db63ac99f8692b0b906a32841273d7b3 (patch) | |
tree | 01f984fcb03f91c0e5c99676e6087f247ada7e9f | |
parent | 2109c0580fc8f9e4951e4b4d07af7f6f2838cd08 (diff) |
-rw-r--r-- | draw.c | 5 | ||||
-rw-r--r-- | draw.h | 2 | ||||
-rw-r--r-- | render.c | 5 | ||||
-rw-r--r-- | window.c | 2 | ||||
-rw-r--r-- | xlib_api.c | 4 |
5 files changed, 12 insertions, 6 deletions
@@ -27,8 +27,9 @@ void draw_rectangle(GC gc, xenon_rect* r) damage_add(r); } -void draw_image(GC gc, XImage* image, xenon_rect area, int x, int y) +void draw_image(GC gc, XImage* image, xenon_rect* area, int x, int y) { - + //image->funcs.get_pixel(image,i,j); + damage_add(area); } @@ -21,7 +21,7 @@ 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); +extern void draw_image(GC gc, XImage* image, xenon_rect* area, int x, int y); #endif @@ -101,7 +101,10 @@ void render_init(int w, int h) screen_rect.w = w; screen_rect.h = h; - pixels = (unsigned char*) calloc (1, w * h * 4); + pixels = (unsigned char*) malloc (w * h * 4); + for(int y = 0 ; y < screen_rect.h ; y++) + for(int x = 0 ; x < screen_rect.w ; x++) + pixelrgba(x,y) = 0xFF501010; render_update(screen_rect); } @@ -33,7 +33,7 @@ xenon_window* window_find(Window wid) void window_resize(Window w, int width, int height) { xenon_window* xw = window_find(w); - + } void window_move(Window w, int posx, int posy) @@ -174,6 +174,8 @@ int XNextEvent( XEvent* event_return ) { + printf("event requested\n"); + event_return->type = KeyPress; } Display *XOpenDisplay( @@ -263,7 +265,7 @@ int XPutImage( } xenon_rect r = {src_x,src_y,width,height}; - draw_image(gc, image, r, dest_x, dest_y); + draw_image(gc, image, &r, dest_x, dest_y); printf("put image ok\n"); } |