C++ 多媒體 API SFML

jopen 13年前發布 | 17K 次閱讀 多媒體

SFML 是一個免費的 C++ 多媒體 API,提供了低級和高級的圖形、輸入、音頻等信息的訪問。

項目地址: http://sfml-dev.org/

What is SFML ? Why should I use it ?

SFML is a portable and easy to use multimedia API written in C++. You can see it as a modern, object-oriented alternative to SDL.
SFML is composed of several packages to perfectly suit your needs. You can use SFML as a minimal windowing system to interface with OpenGL, or as a fully-featured multimedia library for building games or interactive programs.

Main features

  • Portable
    SFML compiles on standard platforms like Windows (98, 2000, XP, Vista) and Unix systems (Linux, Mac OS X). As the library grows up, support for more operating systems will be added.
  • Object-oriented
    SFML is written in C++ and provides an efficient, object-oriented design. It relies on standard patterns and idioms to provide a simple and robust framework.
  • Easy to use
    SFML aims at being easy to manipulate. Effort is put on internal code to provide the simplest public interface.
  • Flexible
    Instead of being one big API, SFML rather contains a lot of small packages, that can be chosen and combined according to the intended usage. You can use only the base package to get input and windowing, as well as the full graphics package with sprites and post-effects.
  • Easily integrable
    SFML can be used in one or more windows, and/or can be integrated in existing interface components. Integration with existing graphical user interface (GUI) libraries is easy, so that you can add SFML views into complex interfaces built with Qt, wxWidgets, MFC or whatever.

Languages

SFML is available in the following languages :

  • C++
  • C
  • .Net (C#, VB.Net, C++/CLI, ...)
  • Python
  • D
  • Ruby

System

  • Portable and accurate time measurement
  • Simple and object oriented threads and mutexes
  • Unicode module for proper conversions between UTF and locale-dependant encodings

Window

  • Can be used as a minimal, portable package to replace GLUT or SDL for windowing and input with OpenGL
  • Can create several rendering windows
  • Can be integrated into components of existing Qt / MFC / wxWidgets / Win32 / X11 / ... interfaces
  • Provides both a message-based and a real-time interface for handling input
  • Can handle mouses with up to 5 buttons
  • Can handle four joysticks with up to 7 axes and 32 buttons

Graphics

  • Interfaces very easily with OpenGL (see OpenGL samples)
  • Modern effects available and hardware-accelerated : alpha-blending, rotations, shaders, ...
  • Manages memory efficiently, so that you don't have to worry about resources lifetime or storage ; you can even load your graphical resources before any window is created
  • Can load and save standard image formats : bmp, dds, jpg, png, tga, psd
  • Can load all graphics resources directly from files in memory
  • Can use views like in a 3D scene, to zoom / translate / rotate the whole world
  • Uses a simplified shader language for adding real-time post-effects
  • Easy manipulation of graphical text through bitmap fonts
  • Supports unicode characters
  • Can load standard font file formats : ttf, cff, pcf, fnt, bdf, pfr, sfnt, type 1, type 42

Audio

  • Uses hardware acceleration whenever possible
  • Can load and save standard sound formats : ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64
  • Can load all audio resources directly from files in memory
  • 3D sound spacialization
  • Easy interface for capturing audio
  • Manages memory efficiently, so that you don't have to worry about resources lifetime or storage
  • Supports streaming for big files ; you can even write your custom streaming class for any source (network, ...)
  • Supports multi-channels formats (mono, stereo, 4.0, 5.1, 6.1, 7.1)

Network

  • Implements a portable layer over TCP and UDP sockets
  • Easy data transfers through stream-based extensible packets
  • Classes to use the HTTP and FTP internet protocols

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!