views:

161

answers:

3

Hi,

I want to write a serious 2D game, and it would be nice if I have a version for Linux and one for Windows (and eventually OSX). Java is fantastic because it is platform independent. But Java is too slow to write a serious game. So, I thought to write it in C++. But C++ isn't very cross-platform friendly. I can find game libraries for Windows and libraries for Linux, but I'm searching one that I can use for both, by recompiling the source on a Windows platform and on a Linux platform.

Are there engines for this or is this idea irrelevant? Isn't it that easy (recompiling)?

Any advice and information about C++ libraries would be very very very appreciated!

+4  A: 

Try SDL (in association with c/c++), it's great for 2D games (and supports 3D through opengGL), and it works on windows, os x and linux.

Autopulated
A: 

For 2D games I recommend SFML. It's similar in concept to SDL, having most of the same capabilities, but is much more C++ oriented (SDL is a C library), and because it uses OpenGL internally, it performs better in most cases. Besides that, in my opinion, it is much easier to use.

+1  A: 

I have use SFML to build simple games. In its own words

SFML is a portable and easy to use multimedia API written in C++. You can see it as a modern, object-oriented alternative to SDL. SFML is composed of several packages to perfectly suit your needs. You can use SFML as a minimal windowing system to interface with OpenGL, or as a fully-featured multimedia library for building games or interactive programs.

I really like it as it's definitely a C++ library, not C written as C++.

However, you asked about 2D engines, I've yet to find a good one. SFML and SDL are more low level media libraries.

caspin