C ++: platform independent lib game?

I want to write a serious 2D game, and it would be nice if I had a version for Linux and one for Windows (and ultimately OSX). Java is fantastic because it is platform independent. But Java is too slow to write a serious game. So, I decided to write it in C ++. But C ++ is not very cross-platform. I can find game libraries for Windows and libraries for Linux, but I am looking for one that I can use for both by recompiling the source on the Windows platform and on the Linux platform.

Are there any engines for this or does this idea not matter? Isn't it that easy (recompilation)?

Any advice and information on C ++ libraries would be greatly appreciated!

+4
source share
3 answers

Try SDL (combined with c / C ++), this is great for 2D games (and supports 3D via opengGL), and works on windows, os x and linux.

+5
source

I use SFML to create simple games. In your 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 that perfectly suit your needs. You can use SFML as a minimal window system for interface with OpenGL, or as a fully functional multimedia library for creating games or interactive programs.

I really like that this is definitely a C ++ library, not a C written as C ++.

However, you asked about 2D engines, I have not found a good one yet. SFML and SDL are lower-level multimedia libraries.

+2
source

For 2D games, I recommend SFML . This is similar to the concept of SDL, which has most of the same features, but is much more oriented to C ++ (SDL is a C library), and since it uses OpenGL internally, it works better in most cases. In addition, in my opinion, it is much easier to use.

0
source

Source: https://habr.com/ru/post/1311281/


All Articles