Package:Simple DirectMedia Layer

From Funtoo
Revision as of 03:03, February 16, 2019 by Digifuzzy (talk | contribs) (SDL2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Simple DirectMedia Layer

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Introduction

Simple DirectMedia Layer is commonly referred to by its acronym sdl. There are two versions of the sdl libraries commonly used: sdl and sdl2. The distinction is all libraries pre-version 2.0 are sdl while post-version 2.0 are sdl2. Version in this case is important as post-2.0 release involved a major changed to the SDL code base with non-backwards compatible changes to its API.

sdl (pre-2.0) is considered outdated and new development with sdl is discouraged. Components of sdl and sdl2 cannot be intermixed.

This page covers sdl2 only.

Usage(Simple)

Applications may only require the presence of the core sdl2 library. For this, executing below should be sufficient:

root #  emerge media-libs/libsdl2

Usage(Source)

Some game applications that are built from sources may also require additional SDL2 component libraries below:

  • SDL2-GFX - Graphics drawing primitives library for SDL2
  • SDL2-Image - Image file loading library
  • SDL2-Mixer - Audio and sound mixing functionality
  • SDL2-Net - Networking support
  • SDL2-TTF - True Type Font handling functions

These subsystems can be installed with libsdl2 by executing the following:

root #  emerge media-libs/libsdl2 media-libs/sdl2-{gfx,image,mixer,net,ttf}

Note: shell brace expansion used in emerge command to install multiple items

Further Reading

Simple DirectMedia Layer Wiki Home Page
Wikipedia - Simple DirectMedia Layer
Flare Game Engine - example of needing SDL2 source install
Lazy Foo Productions - SDL2 programming tutorial