Cross Platform Development - Without Linux

Recommended Posts

I am in the process of starting the re-planning and re-design of a cross platform engine, using both DirectX and OpenGL.
Unfortunatly, my Linux install is busted. I have spent the entire day trying to fix it, patch it etc. but it needs a full-rebuild. I have no intention of doing this until I upgrade my PC, so for the time being, I will be developing 100% on windows.
What I am looking for are good pointers or advice as to what traps not to fall into so when I do finally slip it onto Linux, I don't have re-structure everything and re-write hugh amounts of code.
I am not a novice coder, so I do have a good understanding of making a cross platform engine, but my linux expereince if very limited.
It goes without saying I need an OpenGL renderer for linux, but I have a the urge to do both DX and GL for now. The engine will use a wide range of dynamic link libraries, which I know are handled differently in linux, but I am not sure how.
I intend to use Code::Blocks on Linux, as it seems to be the only environment that uses Workspaces (as I am far to comfortable to MS VS), and that also seems to handle complex folder structures - whereas Anjuta always complains that the source file is not in the correct folder!
So what kinds of things should I avoid and what kind of things should I do to make my life easier in about 5/6 months!
Any advice or pointers to good information would be appreciated.
Thanks
Spree

Share this post

Link to post

Share on other sites

1) #ifdef WIN32/etc, #endif is your friend.2) Write a low level file loader, again wrapped in #ifdef/#endif's so your loading works on any system with no changes needed in the actual game.3) Abstract out windows handling stuff just like above.

Making the engine cross platform ready took all of 3 days. I didn't handle the linux side at all, but with a good base system it was done in literally hours. At this point I think we're done most of the major work, will be tweaks all over the place I know but it's actually not that bad. Make a good solid base structure and you'll be fine.

Share this post

Link to post

Share on other sites

Regarding IDE's. I am not too worried about using different IDE's on different platforms, I think getting a flavour for different app's can only help you understand the nuances of a given platform.

I am concerned about the differences between dynamic libs on Linux and Windows (though the actual dynamic loading code is similar), so thanks for making me worry about Mac too ;) Unfortunately, the plug-in architecture is paramount to my engine so I can’t avoid it!

I am going to attempt very limited testing on Linux for the time being, though it might be difficult.

I fully expect to have _some_ #ifdef's around, especially at the lowest level, but hopefully, with a fully class orientated plug-in architecture this will be avoided in most places (expect maybe the shared GL code).

Thanks againSpree

0

Share this post

Link to post

Share on other sites

since linux doesnt have DX you're buggered if u try that (youll have to rewrite heaps)perhaps use a crossplatform library eg i use sdl my game compiles flawlessly on bioth win/linux and for 100k LOC project theres only a couple #ifdef's

0

Share this post

Link to post

Share on other sites

Hi, I would recommend using SCons as a cross-platform building tool. It is a lot easier to maintain than the GNU autotools, and it keeps you focussed on development, not configuration. I don't know if it is possible to integrate SCons in your favourite IDEs though.

And make sure all the libraries you use are cross platform, and tested on you target platform.