from: http://www.24hsoftware.com/DevelopersForum/CrossPlatform-C-Library.html
Is there a portable (Cross Platform) library in C++ for Windows, WM, WinCE, MacOS, iPhone?
I wand to port a windows screensaver written in MS Visual Studio 2005, C++.
I need the library to contain:
- animated sprites, with transparency, z-order
- bitmap stretching
- have something to avoid flickering when drawing on screen
For the settings dialogs of the screensaver it must have controls like:
- buttons,
- edit boxes,
- image place holders,
- tick boxes,
- panels,
- etc.
For the file I/O it must have:
- file read/write, getSize, fileExists functions.
- INI file class
- Text file Event Logging file class
I have been looking at the internet for cross platform libraries and have summarized below some available libraries.
It seems the most promising of them are:
QT by QtSoftware,
wxWidgets
If you have experience n cross platform programming, please give your advice.
wxWidgets
http://www.wxwidgets.org/
Create applications for Win32, Mac OS X, GTK+, X11, Motif, WinCE, and more using one codebase.
License:
L-GPL
Review:
Google PR: 6
Last announcement/update: 2009-04-28
Comparison of wxWidgets with other cross platform tools
http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits#FLTK
SDL - Simple DirectMedia Layer
http://www.libsdl.org/
SDL is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. It is used by MPEG playback software, emulators, and many popular games.
Platforms:
Linux, Windows, Windows CE, BeOS, MacOS, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
The code contains support for AmigaOS, Dreamcast, Atari, AIX, OSF/Tru64, RISC OS, SymbianOS, and OS/2, but these are not officially supported.
There's also a version of SDL that uses NDK to run on android.
License:
GNU LGPL version 2. This license allows you to use SDL freely in commercial programs as long as you link with the dynamic library.
Review:
May developers suggest that SFML is better than SDL.
"SFML is incredibly simple and intuitive to use. "
"SDL is in C, SFML is in C++"
Allegro
http://alleg.sourceforge.net/
http://www.allegro.cc/
Allegro is a game programming library for C/C++ developers distributed freely, supporting the following platforms: DOS, Unix (Linux, FreeBSD, Irix, Solaris, Darwin), Windows, QNX, BeOS and MacOS X. It provides many functions for graphics, sounds, player input (keyboard, mouse and joystick) and timers. It also provides fixed and floating point mathematical functions, 3d functions, file management functions, compressed datafile and a GUI.
License:
gift-ware (free to use in any way)
Review:
Google PR: 5
Last announcement/update: 2009-03-25
Comments: It seems to me that SDL has larger installed base and I would prefer SDL instead of Allegro
Troll 2D
http://code.google.com/p/troll2d/
Troll is an easy-to-use 2D game engine. It supports several back-ends, such as SDL and Allegro. Compatible with any OS, such as Windows, Mac OS X, Linux and Unix. Embedded systems, like Symbian OS, Windows Mobile and the iPhone, are also supported.
* Surface transformations (rotate, scale)
* PNG support
* Frame timing control (with low CPU usage)
* Many primitives (Lines, Rect, Circle, Arc, RoundedRect)
* Alpha support
Review:
Google PR: 4
Last announcement/update: 2008-10-01
Comments: Troll has no updates for some months. Is based on SDL and Allegro, so I would go for either of those two, instead of Troll.
Qt – A cross-platform application and UI framework
http://www.qtsoftware.com
Develop applications and user interfaces once, and deploy them across Windows, Mac, Linux/X11, embedded Linux, Windows CE and S60 (coming soon) without rewriting the source code.
Qt SDK, libraries and Qt Creator IDE available under LGPL and GPL licenses.
Review:
Google PR: 6
Last announcement/update: 2009-04-23
OpenGL
Platforms: Windows, Linux and MacOS X, and mobile edtion.
Comments: I wouldn't go for OpenGL because not all graphics card support it. For example, cheap netbooks do not support it.
DirectX
Comments: I wouldn't go for DirectX because it is only for Microsoft systems.
ClanLib is a cross platform C++ toolkit library.
# Windows, Linux and Mac OS X
# Basic cross platform runtime (threading, file I/O, etc.)
# Template based C++ signal library (type-safe callbacks)
# Integrated resource management
# Sound mixer supporting wav, tracker formats (mod/s3m/xm/..) and ogg-vorbis
# XML/DOM support
# High level 2D graphics API supporting OpenGL and SDL as render targets
# Batch rendering engine maximizing performance when rendering 2D with OpenGL
# 2D collision detection
# 2D sprite animation support
# Highly customizable GUI framework
# Network library with low level and high level interfaces
# Cross platform OpenGL 2.0 wrapper
External Libraries Used by ClanLib
* zlib, required by clanCore
* libjpeg, required by clanDisplay
* libpng, required by clanDisplay
* MikMod, required by clanMikMod
* libOgg, required by clanVorbis
* libVorbis, required by clanVorbis
* FreeType, required by clanDisplay
* pcre, required by clanRegExp
* SDL, required by clanSDL
You can also download precompiled versions for Win32 of these external libraries.
Platforms:
Windows, Linux
http://www.clanlib.org/