Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Best method for drawing things

Name: Anonymous 2009-05-26 19:44

List method: Graphic items are separate, and contain data structures containing information on rendering, i.e.:
struct render_item {
    int x, y;
    image *data;
    void (*draw_function) (struct render_item*);
    bool use_data_or_function;
};

A separate thread is running that goes through a list of render_items added with draw_this (item);, rendering them one by one. Useful especially for games and things that have to draw a lot of different objects.

Tree method: Graphic items are arranged in a hierarchy, with one master containing all of the others. Useful for GUIs and things that have nested objects. Not particularly useful if you can't get it to work properly.

Thoughts?

Name: Anonymous 2009-05-26 20:05

Just wanted some actual programming discussion, really.
Plus, I'm trying to do things the tree way and am failing miserably, I've done it the list way before and it worked fine, but it's a shitload of hassle to redesign the whole project and I don't see any advantages over the way I'm trying to do it, apart from it won't not work inexplicably.
Also, are there any other good ways anyone's done it?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List