This allows Valve to make fixes and improvements to their SDL and those fixes to flow on to your game.
Sudo Apt-Get Libimage-Dev Download The SourceYou will need to download the source code first for most of them, unless prebuilt binaries are available.
SDL 1.2 isnt covered here. Sudo Apt-Get Libimage-Dev Mac OS 9It can be installed on legacy platforms that SDL2 doesnt support, such as Mac OS 9 or OS2, but settling for 1.2 would not be a drop-in replacement for 2.0. Some of these installation instructions happen to work with 1.2, however, on the platforms we cover. Sudo Apt-Get Libimage-Dev How To In ThisHowever, we encourage you to not do this for various technical and moral reasons (see docsREADME-dynapi.md ), and wont cover the details of how to in this document. SDL supports most popular flavors of Unix: Linux 2.6, the various BSDs (FreeBSD, NetBSD, OpenBSD), Solaris, and other things like them. First Do you need to compile SDL yourself Its possible your distributions package manager already did it for you Debian-based systems (including Ubuntu) can simply do sudo apt-get install libsdl2-2.0 to get the library installed system-wide, and all sorts of other useful dependencies, too. Please see docsREADME-linux.md for a more complete discussion of packages involved. Red Hat-based systems (including Fedora) can simply do sudo yum install SDL2 to get the library installed system-wide, or sudo yum install SDL2-devel to get headers and other build requirements ready for compiling your own SDL programs. Gentoo users can sudo emerge libsdl2 to get everything they need. If youre compiling SDL yourself, heres what we refer to as the Unix way of building: Get a copy of the source code, either from Mercurial or an official tarball or whatever. Make a separate build directory (SDL will refuse to build in the base of the source tree). Run make install to install your new SDL build on the system. You can change this to a different location with the --prefix option to the configure script. In fact, there are a LOT of good options you can use with configure Be sure to check out its --help option for details. SDL tries to do the right thing by default, though, so you can usually get away with no options at all. A good rule of thumb for Linux is the number of cores plus two, so you use all the processing resources possible, and if a process or two is competing for the disk, those two extra jobs might be able to put the otherwise-idle CPU cores to work in the meantime (so on a four-core system Try make -j6.) An (experimental) alternative to the configure script is the CMake project file. It works on similar principles to the configure script, but you might find that you enjoy it more, if this is the sort of thing you generally enjoy in the first place. Once you have the library installed, you can use the sdl2-config program to help you compile your own code: gcc -o myprogram myprogram.c sdl2-config --cflags --libs SDL on Unix should only link against the C runtime (glibc). Every thing else it needs will be dynamically loaded at runtime: X11, ALSA, d-bus, etc. This means it is possible to build an SDL that has support for all sorts of targets built in, and it will examine the system at runtime to decide what should be used (for example, if Xlib isnt available, it might try to load Wayland support, etc). In that respect, if you plan to ship the SDL binary that you build, it is to your benefit to make sure your system has development headers for as many targets as possible, regardless of what you plan to personally use, so your final library is as robust as possible. If you are shipping a Linux game on Steam, or explicitly targeting SteamOS, the system is guaranteed to provide SDL. The Steam Client will set up the dynamic loader path so that a known-good copy of SDL is available to any program that needs it before launching a game. Steam provides both SDL 1.2 and 2.0 in this manner, for both x86 and amd64, in addition to several add-on libraries like SDLmixer. When shipping a Linux game on Steam, do not ship a build of SDL with your game. Link against SDL as normal, and expect it to be available on the players system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |