| Reference Manual - 1.4.13

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. 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.

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.

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.

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.

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.

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.

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.

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.

Methods of IDirectFB
Cooperative level, video mode | SetCooperativeLevel | Puts the interface into the specified cooperative level.
| SetVideoMode | Switch the current video mode (primary layer).
Hardware capabilities | GetDeviceDescription | Get a description of the graphics device.
| EnumVideoModes | Enumerate supported video modes.
Surfaces & Palettes | CreateSurface | Create a surface matching the specified description.
| CreatePalette | Create a palette matching the specified description.
Screens | EnumScreens | Enumerate all existing screen.
| GetScreen | Retrieve an interface to a specific screen.
Display Layers | EnumDisplayLayers | Enumerate all existing display layers.
| GetDisplayLayer | Retrieve an interface to a specific display layer.
Input Devices | EnumInputDevices | Enumerate all existing input devices.
| 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 | CreateImageProvider | Create an image provider for the specified file.
| CreateVideoProvider | Create a video provider.
| CreateFont | Load a font from the specified file given a description of how to load the glyphs.
| CreateDataBuffer | Create a data buffer.
Clipboard | SetClipboardData | Set clipboard content.
| GetClipboardData | Get clipboard content.
| GetClipboardTimeStamp | Get time stamp of last SetClipboardData call.
Misc | Suspend | Suspend DirectFB, no other calls to DirectFB are allowed until Resume has been called.
| Resume | Resume DirectFB, only to be called after Suspend.
| WaitIdle | Wait until graphics card is idle, i.e. finish all drawing/blitting functions.
| WaitForSync | Wait for next vertical retrace.
Extensions | GetInterface | Load an implementation of a specific interface type.

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