C++ graphics engine?

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
luzi82
Traffic Manager
Traffic Manager
Posts: 200
Joined: 12 Jul 2003 14:18
Location: Hong Kong
Contact:

C++ graphics engine?

Post by luzi82 »

hi all,

I am planning ( just planning ) to make a C++ 3D graphics engine for OTTD. However, I am not familiar with the OTTD code, and not familiar with using C and C++ together.

Um, I am planning to use Crystal Space (CS) to make the engine.
http://www.crystalspace3d.org/
it is open source and works with Win32 and Linux ( others not sure )

So I would like to ask some silly questions here

is it possible to have a C++ engine working together? I am worrying that the product would become useless when it is made.

Also I do not have VC++ at all
just mingw and Dev-C++
I would like to know if they can works together...

thanks a lot!!!
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

If you can compile the source, you're probably good to go, regardless of which compiler you use.

To get C++ and C to work together, the prototypes of all functions with C-style linkage (those coded in C, not C++) must be enclosed in

Code: Select all

extern "C" {
//...
}
blocks when appearing in C++ source. The easiest way to do this is probably to enclose the #includes for the OTTD header files in an extern block.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 9 guests