Graph App code, on draw pixels:
get_pixel(Point p)
{
return 0x00FFFFFF; /* cheat for now, return white */
}
set_pixel(Point p, unsigned long c)
{
enable_drawing();
set_rgb(c);
draw_point(gc, p);
}
draw_point(Point p)
{
draw_point(gc, p);
}
draw_line(Point p1, Point p2)
{
draw_line(gc, p1, p2);
}
The drawing of pixels is in functions, this is something that could slow down the performance by a lot. This functions is called “N” hundreds of time.
Instead if convert them in to loops, will be much faster, think i will create some kind of map or area of the pixels, so i can access them lather. To know what have been done. Maybe the “layer.h” i talk earlier and people probably din't understand will come in help now. We could put pixels in layers. width coordinates. red buttons on this screen → "100px right position" 3 buttons 80px by 80px. Etc…
#include draw.c
----
while(draw_pixels != null){
→draw
→create map
}
---