Reference Manual - 1.0.1
DirectFB Interfaces   IDirectFB

IDirectFB is the main interface. It can be retrieved by a call to DirectFBCreate. It's the only interface with a global creation facility. Other interfaces are created by this interface or interfaces created by it.
IDirectFB是DirectFB的主接口,调用DirectFBCreate函数创建取得,是唯一可以在全局中方便创建的接口,其他接口都是通过它来创建而获得。

Hardware capabilities such as the amount of video memory or a list of supported drawing/blitting functions and flags can be retrieved. It also provides enumeration of all supported video modes.
硬件能力,像显存的总量或drawing/blitting 功能与标识支持列表都可以得到。它同样可以枚举所有支持显示模式。

Input devices and display layers that are present can be enumerated via a callback mechanism. The callback is given the capabilities and the device or layer ID. An interface to specific input devices or display layers can be retrieved by passing the device or layer ID to the corresponding method.
输入设备与显示层可以通过回调机制枚举取得,通过回调机制可以得到设备的能力或层的ID。一个输入设备或显示层的具体接口,可以通过向相应方法传递一个设备或层的ID来取得。


Surfaces for general purpose use can be created via CreateSurface. These surfaces are so called "offscreen surfaces" and could be used for sprites or icons.
平面一般可以通过CreateSurface. 函数创建,这个平面同样称为 "离屏平面",同样可为精灵或图标使用。

The primary surface is an abstraction and API shortcut for getting a surface for visual output. Fullscreen games for example have the whole screen as their primary surface. Alternatively fullscreen applications can be forced to run in a window. The primary surface is also created via CreateSurface but with the special capability DSCAPS_PRIMARY.
主平面是平面可视输出的一个抽象与API简称。例如满屏游戏拥有整个屏幕当作他们的主平面。另外满屏程序被强迫运行在一个窗口上。主平面同样是通过CreateSurface函数创建,但需要指定DSCAPS_PRIMARY参数。(

The cooperative level selects the type of the primary surface. With a call to SetCooperativeLevel the application can choose between the surface of an implicitly created window and the surface of the primary layer (deactivating the window stack). The application doesn't need to have any extra functionality to run in a window. If the application is forced to run in a window the call to SetCooperativeLevel fails with DFB_ACCESSDENIED. Applications that want to be "window aware" shouldn't exit on this error.
cooperative level 选择主平面的类型。调用SetCooperativeLevel,应用程序可以选择暗地创建窗口或主层的平面(取消窗口堆栈),应用程序不需要额外功能去运行在一个窗口中。如果程序强制运行在一个窗口中,DFB_ACCESSDENIED错误将导致SetCooperativeLevel函数。程序尝试窗口感知,以免此类错误而退出。

The video mode can be changed via SetVideoMode and is the size and depth of the primary surface, i.e. the screen when in exclusive cooperative level. Without exclusive access SetVideoMode sets the size of the implicitly created window.
显示模式可以通过SetVideoMode()函数 进行改变,同样可以改动主平面的大小与色深,当屏幕处于独占协作层模式时,当非独占时调用SetVideoMode设置大小时,是暗地创建窗口。(

Event buffers can be created with an option to automatically attach input devices matching the specified capabilities. If DICAPS_NONE is passed an event buffer with nothing attached to is created. An event buffer can be attached to input devices and windows.
事件缓冲可由某一选项创建,自动匹配具体的能力连接到输入设备。如果由DICAPS_NONE 参数创建了没有连接的事件缓冲,那么这个事件缓冲,可以连接到输入装置和窗户。#


Fonts, images and videos are created by this interface. There are different implementations for different content types. On creation a suitable implementation is automatically chosen.
字体,图片与及视频都是由这个接口号创建的。不同的内容类型有不同的实现,创建自动选择性合适的实现方法。

IDirectFB方法

Cooperative level, video mode $ C/ j; q( N) u8 r" g9 E8 e
协作层,显示模式
SetCooperativeLevel Puts the interface into the specified cooperative level.
安置接口到具体协作层中
SetVideoMode Switch the current video mode (primary layer).  
切换当前显示模式(主层)
Hardware capabilities & l* Q+ K% p* w  O
硬件功能
GetDeviceDescription Get a description of the graphics device.
. R, z0 n* t7 H; c
4 K' ]* }- S' y! H取得显卡的相关描述
EnumVideoModes Enumerate supported video modes.
8 t# r* I( d9 I4 }3 M枚举显示模式
Surfaces & Palettes & I1 ?8 M8 n" e- k
平面&调用板
CreateSurface Create a surface matching the specified description.
创建一个匹配具体描述的平面
CreatePalette Create a palette matching the specified description.  
创建一个匹配具体描述的调色板
Screens
2 w7 R/ B" B7 O" ]: q  h2 N屏幕
EnumScreens Enumerate all existing screen.
枚举所有存在的屏幕
GetScreen Retrieve an interface to a specific screen.
7 N7 D$ W& o0 [0 V. f取得一个具体的屏幕
Display Layers - k' y! ~0 O( D, I4 ~7 ?
显示层
EnumDisplayLayers Enumerate all existing display layers.
枚举所存在的层  u; ~  F  `3 k9 w
GetDisplayLayer Retrieve an interface to a specific display layer.
取得一个具体的显示层
Input Devices
6 [( z  A0 \% v, n# L输入设备
EnumInputDevices Enumerate all existing input devices.
枚举所存在的输入设备4 s% H5 L1 B; l2 `: \
GetInputDevice Retrieve an interface to a specific input device.
取得一个具体的输入设备接口
CreateEventBuffer Create a buffer for events.
创建一个事件缓冲区
CreateInputEventBuffer Create a buffer for events with input devices connected.
为已链接输入设备,创建事件缓冲区
Media
/ N: Q( U' I+ \2 u0 _" j: j. s媒体
CreateImageProvider Create an image provider for the specified file.
创建一个图像装备容器
CreateVideoProvider Create a video provider.
. T" B# m# H3 u. I, n+ x1 a创建一个视频装备容器
CreateFont Load a font from the specified file given a description of how to load the glyphs. 从如何装置字符的具体描述中装载某种字体
CreateDataBuffer Create a data buffer.
创建数据缓冲
Clipboard $ u% r5 H% R6 P) J! W7 c( K: Q# z
剪切板
SetClipboardData Set clipboard content.
设置剪切板内容
GetClipboardData Get clipboard content.
获取剪切板内容
GetClipboardTimeStamp Get time stamp of last SetClipboardData call.
/ B% t* D" W: G) S- Y$ u取得最后调用SetClipboardData 的时间戳
Misc
& H: n& m7 Z- ^杂项
Suspend Suspend DirectFB, no other calls to DirectFB are allowed until Resume has been called. , X, U! k+ x, |; Y. [, P
挂起DirectFB,在没有唤醒之前不允许其他操作访问
Resume Resume DirectFB, only to be called after Suspend.
6 c6 B8 B& g0 J8 V* n) G" R- w唤醒DirectFB,只有在挂起后才被调用
WaitIdle Wait until graphics card is idle, i.e. finish all drawing/blitting functions. 7 w3 s# U6 i5 r2 [1 o- w4 G
等待直到图形卡空闲时,即完成所有画图/位块传统送功能
WaitForSync Wait for next vertical retrace.
2 _- ?& m# J! J1 t. X5 E) [& f等待下一个轮回
Extensions
4 K' p  j% h5 Y3 b, X' h4 m扩展
GetInterface Load an implementation of a specific interface type' J# c$ _2 p4 m; @+ j! |5 i
装载一个完成的具体接口类型.

Creative Commons License This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License