Wiki Page Content

Differences between revisions 1 and 10 (spanning 9 versions)
Revision 1 as of 2011-02-11 18:04:28
Size: 4683
Editor: SheenaSmith
Comment: create new intro page split from front page
Revision 10 as of 2013-07-21 18:36:11
Size: 4922
Editor: Sam Lantinga
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
#acl All:read #pragma camelcase off
Line 4: Line 4:
= Introduction to SDL 1.3 = = Introduction to SDL 2.0 =
Line 10: Line 10:
The Simple !DirectMedia Layer library (SDL) is a general API that provides low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D framebuffer across multiple platforms. The Simple DirectMedia Layer library (SDL) is a general API that provides low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D framebuffer across multiple platforms.
Line 12: Line 12:
The current version (1.3) supports Windows, Windows CE, Mac OS X, Linux, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, and QNX. The code contains support for other operating systems but those are not officially supported. The current version supports Windows XP/Vista/7/8, Mac OS X, Linux, iOS, and Android. The code contains support for other operating systems but those are not officially supported.
 . For the latest information on what is supported see http://hg.libsdl.org/SDL/file/default/README-platforms.txt
Line 15: Line 16:
 . For the latest list of languages see http://www.libsdl.org/languages.php
Line 16: Line 18:
This library is distributed under [[http://www.libsdl.org/license-lgpl.php|GNU LGPL version 2.1]]. This license allows you to use SDL freely in commercial programs as long as you link with the dynamic library. A full commercial license for SDL 1.3 is available from [[http://www.galaxygameworks.com|Galaxy Gameworks]]. SDL 2.0 is under the [[http://www.zlib.net/zlib_license.html|zlib]] license, which allows free use for commercial and non-commercial purposes.
Line 93: Line 96:
'''''Mac OSX''''' '''''Mac OS X'''''
Line 103: Line 106:
== Special features in SDL 1.3 == '''''iOS'''''

 * Uses UIKit for video display, taking advantage of OpenGL ES 2.0 for hardware acceleration
 * Uses Core Audio for sound

'''''Android'''''

 * Uses JNI interfaces for video display, taking advantage of OpenGL ES 1.1 and 2.0 for hardware acceleration
 * Uses JNI audio callbacks for sound

== Special features in SDL 2.0 ==
Line 111: Line 124:
=== Transitioning from SDL 1.2 to 1.3 === === Transitioning from SDL 1.2 to 2.0 ===
Line 113: Line 126:

----
This wiki is powered by [[http://moinmo.in/|MoinMoin]].

Introduction to SDL 2.0

1. Introduction to SDL

1.1. What is SDL?

The Simple DirectMedia Layer library (SDL) is a general API that provides low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D framebuffer across multiple platforms.

The current version supports Windows XP/Vista/7/8, Mac OS X, Linux, iOS, and Android. The code contains support for other operating systems but those are not officially supported.

SDL is written in C, but works with C++ natively, and has bindings to several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, Pike, Pliant, Python, Ruby, and Smalltalk.

SDL 2.0 is under the zlib license, which allows free use for commercial and non-commercial purposes.

1.2. What can SDL do?

Video

  • Set a video mode at any depth (8-bpp or greater) with optional conversion, if the video mode is not supported by the hardware
  • Write directly to a linear graphics framebuffer
  • Create surfaces with color key or alpha blending attributes
  • Surface blits are automatically converted to the target format using optimized blitters and are hardware accelerated, when possible. MMX optimized blits are available for the x86
  • Hardware accelerated blit and fill operations are used if supported by the hardware
  • Window Management
  • Rendering

Input Events

  • Events provided for:
    • Application visibility changes
    • Keyboard input
    • Mouse input
    • Joystick input
    • User-requested quit
  • Each event can be enabled or disabled with SDL_EventState()

  • Events are passed through a user-specified filter function before being posted to the internal event queue
  • Thread-safe event queue

Force Feedback

  • Force feedback is supported under Windows, Mac OSX and Linux

Audio

  • Set audio playback of 8-bit and 16-bit audio, mono or stereo, with optional conversion if the format is not supported by the hardware
  • Audio runs independently in a separate thread, filled via a user callback mechanism
  • Designed for custom software audio mixers, but the example archive contains a complete audio/music output library

File I/O Abstraction

  • General purpose abstraction for opening, reading and writing data
  • Built-in support for files and memory

Shared Object Support

  • Load shared objects (DLL on Windows, .dylib on Mac OSX, .so on Linux)
  • Lookup functions in shared objects

Threads

  • Simple thread creation API
  • Simple binary semaphores for synchronization

Timers

  • Get the number of milliseconds elapsed
  • Wait a specified number of milliseconds
  • Set a single periodic timer with 10ms resolution

CPU Feature Detection

  • Detect MMX, SSE, 3DNow and AltiVec CPU features

Endian Independence

  • Detect the endianness of the current system
  • Routines for fast swapping of data values
  • Read and write data of a specified endianness

Power Management

  • Querying power management status

1.3. What platforms does SDL run on?

Windows

  • Two versions, one safe for all systems based on Win32 APIs, and one with higher performance, based on DirectX APIs
  • Safe version uses GDI for video display. High performance version uses !Direct3D for video display, taking advantage of modern hardware acceleration
  • Safe version uses waveOut APIs for sound. High performance version uses DirectSound for audio playback

Mac OS X

  • Uses Cocoa for video display, taking advantage of OpenGL for hardware acceleration
  • Uses Core Audio for sound

Linux

  • Uses X11 for video display, taking advantage of OpenGL for hardware acceleration
  • Uses the ALSA, OSS and PulseAudio APIs for sound

iOS

  • Uses UIKit for video display, taking advantage of OpenGL ES 2.0 for hardware acceleration
  • Uses Core Audio for sound

Android

  • Uses JNI interfaces for video display, taking advantage of OpenGL ES 1.1 and 2.0 for hardware acceleration
  • Uses JNI audio callbacks for sound

2. Special features in SDL 2.0

  • Full 3D hardware acceleration
  • Support for OpenGL 3.0+
  • Support for multiple windows
  • Support for multiple displays
  • Support for multiple mice, tablets, etc.
  • Force Feedback available on Windows, Mac OS X and Linux

2.1. Transitioning from SDL 1.2 to 2.0

None: Introduction (last edited 2018-11-06 03:33:30 by DanielG)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit