Not logged inOpenClonk Forum
Up Topic 3D mesh rendering

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Günther

>    // TODO: Note this cannot be CSurface here, because CSurface
>    // does not have a virtual destructor, so we couldn't delete it
>    // properly in that case. I am a bit annoyed that this
>    // currently requires a cross-ref to lib/texture. I think
>    // C4Surface should go away and the file loading/saving
>    // should be free functions instead. I also think the file
>    // loading/saving should be decoupled from the surfaces, so we
>    // can skip the surface here and simply use a CTexRef. armin.


Most of CSurface and all of CSurface8 can go to lib/textures, because it isn't actually platform dependent. The parts that are, the "primary surface" stuff, would be better in an extra class anyway. I think it's only used to draw the rain in d3d mode, and making screenshots. That leaves CTexRef in platform, cleanly separated from the platform independent image loading/saving code. Whether those should support loading directly into textures I'm unsure, because it would probably need code duplication. We don't want to go to a virtual method call for every pixel for performance reasons. Maybe templates.
Also, the mesh loading stuff probably deserves it's own directory under lib, or can go together with the stuff in lib/texture to a renamed lib/graphics. XML file reading is not at all platform dependent :-)

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill