struct Drawable_interface
{
- void (*draw)(struct Drawable_data *);
+ void (*draw)(void *self);
};
struct Tri
int x1; int y1; int x2; int y2;
};
-void draw_tri(struct Drawable_data *v)
+void draw_tri(void *self)
{
- struct Tri *t=(struct Tri *)v;
+ struct Tri *t=(struct Tri *)self;
printf("%d,%d - %d,%d - %d,%d\n",t->x1,t->y1,t->x2,t->y2,t->x3,t->y3);
};
-void draw_rect(struct Drawable_data *v)
+void draw_rect(void *self)
{
- struct Rect *r=(struct Rect *)v;
+ struct Rect *r=(struct Rect *)self;
printf("%d,%d - %d,%d\n",r->x1,r->y1,r->x2,r->y2);
};