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?
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?
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.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Try taking a look at wxWidgets if you need a GUI.
> What shall I think of?
An old favourite - a tetris clone?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
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.
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.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
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). You can also use DevIL 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.
Huh?Originally Posted by Salem