[xmoto-dev] About rendering lib

[ Thread Index | Date Index | More lists.tuxfamily.org/xmoto-dev Archives ]


This mail is to start a discussion about the rendering method.

keesj has start a discussion about that on
http://wiki.xmoto.free.fr/index.php?title=SDL_gfx

A simple example :
class Entity() {
...
}

=> how to render an entity (and the others like block, biker, ...)

first, i thought to make something like it :

class Entity() {
...
 virtual draw() = 0;
}


but finally i think it's not the good method.
I think i will make the class Entity independant of the rendering and make a virtual render methods :

enum RenderQuality {
ugly, low, medium, high, debug, testTheme
};

class Render {
 public:
Renderer(XmScene *i_scene); // XmScene will replace MotoGame, i'm cleaning the code, but it's not finished. // the scene is composed of all the elements when we play. And a scene can then be renderer
 void init() = 0;
 void uninit() = 0;
 void render(RenderQuality i_quality); // call private functions

 protected:
   renderBlocks(const vector<Block*> &i_blocks);
   renderEntities(const vector<Block*> &i_entites);
}

and deriv :

class RenderOpenGl {
...
}

i think that ugly is not a render class but a style but a level;

would it be ok ?
what are your ideas about that ?

Nicolas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/