Power render and C++

Started by
16 comments, last by Azrael 23 years, 10 months ago
Thanks whirlwind there were the proper minus signs on that line but this forum didnt showed them

I will send you the errors I get maybe we can fix this together

And voodoo if you change the extensions from .c to .cpp the compiler automatically reads it as C and C++ code, (almost all c++ compilers do, Im assuming you use visual c)if you dont believe me try it, you will notice the compiler gives you warning or errors you didnt before.. (if you are using classes or c++ code of course )

On a curious note: In unix and GNU you can even use c and C to or c and cc and the compiler takes it as c and C++ code respectively..
Advertisement
Has anyone tried to convert land1 to cpp?
Im getting some weird error in the winutil.cpp file...
should I leave that file as it is?

btw the (void *) errors can be fixed by using a cast...
no problem there...
I have an idea, maybe this wont fly but is worth to try...
why dont we start a community effort
and post CPP versions of the Pr examples?
maybe chris can upload them to the egerter web page...
this may seem silly but I think we may all get benefit from...

diferent winutil files...
c++ classes wrapping pr.. etc.
I think this is a good idea
I leave town for 3 days (no computer access by the way), and I end up helping Azreal somehow... is that good?? If I go on vacation for a week, will that fix all the compile time errors he is having?
Two weeks should do it...

Gary
At this point I should be calling my mommy for some re-affirmation.....
Well... since I did this thread I should also continue it..
so heres another pointer...

Wrapper classes: This is probably the best (and in some cases the only way) to convert some examples or PR based engines into actual working c++.

How does this work? use higher level functions that execute PR code inside them but leave this original code as it is.. just call it... in our dear Land1 that means calling LoadTerrain from load.c or a function inside load.c made in c per example setfogrange...
Also you can subdivide the function in c and call it from a more complex wrapper function.
Per example:
Terrain::LoadTerrain
{
setfogrange; //This function is set on load.c
loadterrainsections //this function is also set on load.c
LoadCharacters //This can be a function from your own code
}
(this is what im using now to compile in c++ land1 )

Correct me if im wrong.. I will be a real fool, if im not able to accept and learn from my own mistakes.
ChrisE was nice enough to group things in the lstudio.h file for lstudio. It shouldn''t be too hard (yeah, ok like anything is..) to port 75% of it to C++. So you are just making land1 functions accessible as a single call from C++, and globals are kept globals?

This topic is closed to new replies.

Advertisement