On Tue, Mar 04, 2003 at 11:10:02PM -0800, Ian Romanick wrote:
Jens Owen wrote:
Concern #3: Readability by the active contributors. I'm not the only old fuddy duddy in this group of developers. How much "readability" time do you figure the young C++ whipper snappers will save by investing in this transition to C++?
I don't think the issue is readability so much. I think the bigger issue is the ability to share code among the drivers. Looking at the code for the various CreateContext functions, the code is about 60% between mga, radeon, r200, and r128 drivers. I assume that the mach64 and savage drivers will likely be the same. I haven't looked at the i810 and i830 drivers, but they probably follow similar form. If we could share a bunch of that code among four or five drivers, it would save a LOT of duplicated code.
Are you saying that C++ somehow allows for more code sharing between drivers than straight ANSI C?
It's not so much that it allows it as it makes it less painful. Look at the texmem-0-0-1 branch. In lib/GL/mesa/src/drv/common/texmem.h there is a structure called driTextureObject. In lib/GL/mesa/src/drv/radeon/radeon_context.h there is a structure called radeon_tex_obj that has a driTextureObject as it's first element. Basically, I'm using inheritance here. The problem is that everywhere I want to use something from the base "class" I have to say "tObj->base.foo". There's also no easy way to over-ride functions from the base.
There are a number of structures, like the *_context structures, where we could do this. It's possible to do in C, but in C++ it's less syntactically painful.
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel