PDA

View Full Version : Windows/Linux C++ project



TriKri
11-23-2006, 03:46 PM
I am planing to do a C++ project in Windows, using DevCpp as an IDE and using SDL as a graphics library. The project is supposed to compile both in Windows and in Linux. What shall I think of?

CornedBee
11-23-2006, 05:48 PM
Don't use any Win32 API. Don't use backslashes as path separators. (Windows will mostly work just fine with forward slashes.) Regularly compile and test on Linux.

Using DevCpp will largely shield you from accidentally using VC++-specific features.

manutd
11-23-2006, 06:36 PM
Try taking a look at wxWidgets if you need a GUI.

Salem
11-24-2006, 06:07 AM
> What shall I think of?
An old favourite - a tetris clone?

TriKri
11-24-2006, 04:55 PM
No, I'm not making a tetris clone, actually I'm trying to make something that visualises or illustrates something about the theory of relativity, that was the though at least. It's a project in school.

And thanks for the answers so far.

dwks
11-24-2006, 05:20 PM
If you need lines, circles, etc, consider using SDL_gfx or maybe SGE, or take the code from here if you can't use another library: http://www.brackeen.com/home/vga/

Also definitely consider using SDL_image, which lets you use png, jpg, tiff, etc images instead of just bmp images, which really saves on disk space.

blank
12-09-2006, 07:13 PM
Yeah, SDL is great. And it's true, using Dev-CPP on windows might ease out any pain, since it uses Mingw which is (As far as I know) a gcc implementation on windows (Also available for other OSes), so compiling options should be the same. I suggest either creating an SVN Repository or using one on the internet so that you can simply boot into either OS and update your code if you made changes to it from the other OS, or you can mount your Windows partition/drive in linux and just copy the source from there, or vice versa using a file system driver (Such as Ext2 IFS (http://www.fs-driver.org/)). You can also use DevIL (http://openil.sourceforge.net/) for image handling, I believe it supports many more image formats, but that is up to you and what you feel is better, after all, I doubt you'd be using little known image formats.

TriKri
01-01-2007, 06:13 PM
> What shall I think of?
An old favourite - a tetris clone?

Huh? :confused: