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-27 6:46

>>4
you should write a lightweight enterprise abstraction to these two methods so that your app can easily switch between them

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