SDL library

| --SDL (SDL game library)

SDL (Simple DirectMedia Layer) is a cross-platform multimedia development library open source, written in C language.
SDL provides several control images, sounds, input and output functions, allowing developers to use as long as the same or similar code
can be developed across multiple platforms (Linux, Windows, Mac OS X, etc.) applications.
SDL currently used for multimedia applications development game, simulator, media players.

| - Introduction

SDL (Simple DirectMedia Layer) is widely used in many well-known game.
The most famous game is to win the group Linux Game Development Awards:
call rights (Civilization: Call To Power).
SDL is the author Lantinga Sam,
Loki Entertainment Software's main programmer (Lead Programmer)

| - Features

  ·video

8bpp or more video mode set any color depth.
If the hardware does not support a mode can be selected into another mode.
Direct write linear image frame buffer (framebuffer).
Creating color key surface (the colorkey) or alpha blending properties.
Surface the blit can be automatically converted to the target format. blit is optimized, and can use hardware acceleration.
There MMX optimized for blit on the x86 platform.
Hardware accelerated blit and fill (filling) the operation, if the hardware supports it.

·event

The following events:
Application visibility changes
Keyboard input
Mouse input
exit to user requirements of
each event can be accessed through SDL_EventState () to close or open.
Event designated by the user via the filter function is then added to the inside of the event queue.
Thread-safe event queue.

• Audio

  8-bit and 16-bit set of audio, mono or stereo, if the hardware does not support the format, the conversion can be selected.
  The audio portion by an independent execution threads, and provides user callback (callback) mechanism.
  Taking into account the custom soft mixer design,
  but in fact routine contains a complete audio / music output library.

· CD Audio

     Full CD audio control API
   · thread

      Simple thread creation API
      for simple binary semaphore synchronization (semaphores)
  · Timer

    Reads the number of milliseconds have elapsed.
    Wait for the specified number of milliseconds.
     Setting a periodic-timer 10 millisecond accuracy.
  · Endian-independent

    Detection endianness of the current system
    fast data transfer function
    to read and write data byte order specified
| - Support System

 ·Linux
    视频显示使用X11,利用XFree86 DGA扩展的优势,全屏显示使用新的w MTRR加速。
    声音使用OSS API。
    使用clone()系统调用和SysV IPC,或者glibc-2.1的pthreads实现线程。
  ·Win32
    有两个版本,一个是适合所有基于Win32的系统的安全版本,
    另一个是基于DirectX的高性能版本。
    安全版本的视频显示采用GDI。高性能版本采用DirectDraw,并支持硬件加速。
    安全版本的音频回放采用waveOut API。高性能版本采用DirectSound
  ·BeOS
    视频显示采用BWindow。
    音频回放采用BSoundPlayer API。
  ·非正式的移植版本,进展中Solaris, IRIX, FreeBSD MacOS
|--其它

SDL内置了调用OpenGL的函数。
通过使用SDL_image、SDL_ttf、SDL_mixer、SDL_net等外部扩展库,
可以轻松实现JPG、PNG、TIFF图像的加载使用,TrueType字体的使用,MP3文件的使用、网络相关的使用等。
SDL也有其他语言的包装,可以在这里查看 SDL用C语言写成,
但是可以很容易在C++下面工作,并且SDL绑定了许多其它的语言,
这其中就包括Ada, C#, Eiffel, Erlang, Euphoria, Guile, Haskell,
Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, Pike,
Pliant, Python, Ruby, and Smalltalk。
包装得比较好的是python语言的pygame。
不过仍然建议你熟悉c/c++环境下的SDL后再使用,会得心应手许多。

|--SDL版权

   SDL在GNU LGPL 2(一个国际上的开源组织)下发布,
  这个版本允许你将SDL以动态链接库(dynamic link library)的形式免费地用于商业游戏软件的开发。

Guess you like

Origin www.cnblogs.com/xuzhaoping/p/11072774.html