The second solution is quite heavy but the genericism is also important, because, I can't manage 2D and 3D entities by the same way, 3D entities are stored in a 3D grid and 2D entitites in a 2D grid and the culling methods also differs. (I don't need a z culling for 2D entities)
The shadows and the light map generation also differs for 2D and 3D entitites.
I need to have a generic entity manager for 2D entitites and another one for 3D entities and defines some functions for all of them.
-The number of function to overload : I can decide it by myself. But to have a good entity manager, it's generally usefull to have something like 10 functions. (I use one for the frustum culling, another for loading 2D or 3D entities on components. (They decides how to render entitites), another to update the entities in the grid when they are transformed, another to find the path between two grid cells, etc...)
I don't use a BSP tree because of the path finding, I don't know how to do this with a BSP-tree and I want to let the possibility to the user to create one for 2D and 3D entities if he needs to make something more complex.
But excepted that difference, the mecanism is the same for 2D and 3D entities. (They use the same classes to render they vertices, it's just that the z of 2D entities is hidden, I use it only for the z-sorting and also in my shaders)
And the components make the links between 2D and 3D entities and the windows to render them in an more optimal way, later I think I'll make instanced rendering in components but actually I don't know how I can do that, it seems that this new features are not supported by a lot of PC's yet, I don't know if it's possible to do that with GLSL 130. (Which is the last version supported by my ati driver in ubuntu)
And moddern opengl (with glVertexAttribPointer) don't seems to render anything with my components but it works without any problems with older opengl function. (with glVertexColorPointer)
But when I do moddern opengl directly in a main it render something. (I figure out that there is certainly a problem in the class RenderTarget with the gl context)
For the components there is only one type of component at the moment (RenderComponent) which render the entities of the framework but later I think it'll be usefull to add a second type (guicomponent) to render guis like buttons, checkbox, etc... with sf-gui.