summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Marchesin <stephane.marchesin@gmail.com>2010-09-22 11:53:21 -0700
committerStephane Marchesin <stephane.marchesin@gmail.com>2010-09-22 11:53:21 -0700
commit2603fb51db63ac99f8692b0b906a32841273d7b3 (patch)
tree01f984fcb03f91c0e5c99676e6087f247ada7e9f
parent2109c0580fc8f9e4951e4b4d07af7f6f2838cd08 (diff)
More rendering...HEADmaster
-rw-r--r--draw.c5
-rw-r--r--draw.h2
-rw-r--r--render.c5
-rw-r--r--window.c2
-rw-r--r--xlib_api.c4
5 files changed, 12 insertions, 6 deletions
diff --git a/draw.c b/draw.c
index 73b41cb..9d0a0ef 100644
--- a/draw.c
+++ b/draw.c
@@ -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);
}
diff --git a/draw.h b/draw.h
index c7445d4..7e6a2e1 100644
--- a/draw.h
+++ b/draw.h
@@ -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
diff --git a/render.c b/render.c
index ea88c9a..99670ad 100644
--- a/render.c
+++ b/render.c
@@ -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);
}
diff --git a/window.c b/window.c
index a78be77..5774bd8 100644
--- a/window.c
+++ b/window.c
@@ -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)
diff --git a/xlib_api.c b/xlib_api.c
index 760e80d..6d63a48 100644
--- a/xlib_api.c
+++ b/xlib_api.c
@@ -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");
}