• Beginning SDL 2.0(1) SDL功能简介


    原文链接为 http://wiki.libsdl.org/Introduction

    由于近期整理音视频可视化的技术,发现好久不更新的SDL发布了2.0版本,以前也没有过于关注,这里准备尝试下。了解SDL到底支持哪些功能。

    本文部分内容为翻译内容。有任何不当支持请联系我。

    SDL全名Simple DirectMedia Layer (SDL)。官网:http://www.libsdl.org/

    What can SDL do? SDL功能简介

    Read ahead for an overview of what SDL is capable of. If you're simply interested in the changes from 1.2 to 2.0, check out theMigration Guide.

    Video 视频

    • 3D graphics(3D图像处理):
      • SDL can be used in combination with the OpenGL API or Direct3D API for 3D graphics
      • 在处理三维图形的时候,SDL可以与OpenGL APi或Direct 3D配合使用。
    • Accelerated 2D render API(优化的2D渲染API):
      • Supports easy rotation, scaling and alpha blending, all accelerated using modern 3D APIs
      • 支持简单旋转、缩放和alpha叠加,所有加速都是基于现代的3D API。
      • Acceleration is supported using OpenGL and Direct3D, and there is a software fallback
      • 硬件加速是基于OpenGL和Direct3D的
    • Create and manage multiple windows(支持多窗口管理及创建)

    Input Events 输入事件

    • Events and API functions provided for(为下列输入提供了事件及API函数接口):
      • Application and window state changes 应用程序和窗口状态改变
      • Mouse input 鼠标输入
      • Keyboard input 键盘输入
      • Joystick and game controller input 手柄和游戏控制器输入
      • Multitouch gestures 多点触控手势
    • Each event can be enabled or disabled with SDL_EventState()

    • 每个事件都可以使用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 OS X and Linux

    Audio 音频

    • Set audio playback of 8-bit and 16-bit audio, mono stereo or 5.1 surround sound, with optional conversion if the format is not supported by the hardware
    • 支持8位、16位,单声道、立体声或5.1环绕声的播放,同时在硬件不支持特定格式时提供可选的转换。
    • Audio runs independently in a separate thread, filled via a user callback mechanism
    • 音频处理运行在独立的线程中,通过自定义回调函数实现数据填充。
    • Designed for custom software audio mixers, but SDL_mixer provides a complete audio/music output library

    • 为自定义的软件音频混音器设计,但SDL_mixer提供完整的音频/音乐输出接口。

    File I/O Abstraction 文件I/O抽象机制

    • 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 OS X, .so on Linux)
    • 支持加载共享对象(windows下的DLL,Mac OS X下的.dylib,Linux下的.so)
    • Lookup functions in shared objects 支持在共享对象中查找函数

    Threads 线程机制

    • Simple thread creation API 支持简单的线程创建函数
    • Simple thread local storage API 支持简单的线程局部存储机制
    • Mutexes, semaphores and condition variables 提供互斥量、信号量和条件变量
    • Atomic operations for lockless programming 提供原子操作函数

    Timers 定时器

    • Get the number of milliseconds elapsed 支持获取消耗的时间(单位毫秒)
    • Wait a specified number of milliseconds 等待指定长度的时间(精度毫秒)
    • Create timers that run alongside your code in a separate thread
    • 支持创建在独立线程运行的定时器
    • Use high resolution counter for profiling 支持高精度计数器

    CPU Feature Detection CPU功能检测

    • Query the number of CPUs 可获取CPU个数
    • Detect CPU features and supported instruction sets 可获取CPU支持的功能及指令集

    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 支持获取电源管理状态

     

    What platforms does SDL run on? SDL支持的平台

    Windows

    • Uses Win32 APIs for display, taking advantage of Direct3D for hardware acceleration
    • 使用Win32 API显示,可充分利用Direct3D提供的硬件加速
    • Uses DirectSound and XAudio2 for sound 使用DirectSound和XAudio2处理音频

    Mac OS X

    • Uses Cocoa for video display, taking advantage of OpenGL for hardware acceleration
    • 使用Cocoa进行视频显示,可充分利用OpenGL提供的硬件加速
    • Uses Core Audio for sound 使用Core Audio处理音频

    Linux

    • Uses X11 for video display, taking advantage of OpenGL for hardware acceleration
    • 使用X11进行视频显示,可充分利用OpenGL提供的硬件加速
    • Uses the ALSA, OSS and PulseAudio APIs for sound

    • 使用ALSA、OSS、PulseAudio API处理音频

    iOS

    • Uses UIKit for video display, taking advantage of OpenGL ES 2.0 for hardware acceleration
    • 使用UIKit进行视频显示,可充分利用OpenGL ES 2.0提供的硬件加速
    • Uses Core Audio for sound 使用Core Audio处理音频

    Android

    • Uses JNI interfaces for video display, taking advantage of OpenGL ES 1.1 and 2.0 for hardware acceleration
    • 使用JNI接口进行硬件加速,可充分利用OpenGL ES 1.1、2.0提供的硬件加速
    • Uses JNI audio callbacks for sound 使用JNI音频回调函数处理音频
    • See also Android 其他详见Android

    ----------------------------------------------------------------------------------------------------------------------------

    本文作者:Tocy  e-mail: zyvj@qq.com

    版权所有@2015,请勿用于商业用途,转载请注明原文地址。本人保留所有权利

  • 相关阅读:
    Linux 删除文件夹和文件的命令
    克隆一台liunx机器重启后和另外一台机器ip冲突,新机器设置新的ip地址
    微服务网关Ocelot加入IdentityServer4鉴权-.NetCore(.NET5)中使用
    kafka、zookeeper相关命令
    kafka tool2 配置及链接失败解决办法
    vmware配置centos7网络
    java8 list新特性
    java分页
    移除chrome浏览器“由贵公司接管”插件
    java获取Object属性类型、属性名称、属性值
  • 原文地址:https://www.cnblogs.com/tocy/p/Beginning-SDL2-1-Introduction.html
Copyright © 2020-2023  润新知