Mail Archives: djgpp/1998/06/24/08:23:46
I dont saw you 3d engine but I know this kind of software manipulates
lots of objects. This is a tipical C++ task.
If you do the job in C then you would be using some flavor of
indirections too, the code would be less readable and possibly
error-prone. Don't do that. To write eficient C++ code you just need
some caution. I will give to you an advice (other guys can tell more):
Unfortunatelly the most expensive operations in C++ are the hide ones:
destruction/construction. It can consume lots and lots of CPU cycles.
Avoid excessive construction/destruction using const and references
wherever you can.
If you do the job the right way then you will see C++ running so fast as
plain C code.
[]s
Obs.: Excuse my English. I'm brasilian.
Colin Walsh escreveu:
>
> I'm writing a 3D engine using DJGPP and I'm currently at the stage
> where I could use some optimizations, and I've always heard that
> C++ classes were slow in some way, and I happen to be using classes
> for storing my 3D objects (meshes, triangles, texturemaps).
> So, would it be in my best interests just to write some C helper
> functions for managing these objects, or is the speed drop
> negligible?
>
> Thanks,
> Colin Walsh
> /"Its all fun and games until someone loses an eye...\
> |Then it becomes Australian Rules Football!" |
> \email - cwalsh AT nf DOT sympatico DOT ca /
- Raw text -