kzs_display_native.hpp File Reference

Functions

EGLNativeDisplayType kzsEGLGetNativeDisplay (const struct KzsDesktopNative *desktopNative, const struct KzsDisplayNative *displayNative, const struct KzsWindowNative *windowNative)
 
kzsError kzsDisplayNativePageFlip (struct KzsDisplayNative *displayNative, int fd, int fbId)
 Schedule a page-flip, swap-buffers should be called prior to this. More...
 
kzsError kzsDisplayNativePageFlipInvoke (struct KzsDisplayNative *displayNative, int fd, int fbId)
 Queues to page flip to happen on next vblank. More...
 
kzsError kzsDisplayNativePageFlipWait (struct KzsDisplayNative *displayNative, int fd)
 Waits for vblank signal that is sent on page flip. More...
 
kzsError kzsDisplayNativeModeSet (struct KzsDisplayNative *displayNative, int fd, int fbId)
 Set the mode for the display. More...
 
kzsError kzsDisplayNativeRestoreMode (struct KzsDisplayNative *displayNative, int fd)
 Restore original mode of the display. More...
 
bool kzsDisplayNativeIsConnected (struct KzsDisplayNative *displayNative)
 Check if display is connected. More...
 

Function Documentation

EGLNativeDisplayType kzsEGLGetNativeDisplay ( const struct KzsDesktopNative *  desktopNative,
const struct KzsDisplayNative *  displayNative,
const struct KzsWindowNative windowNative 
)
kzsError kzsDisplayNativePageFlip ( struct KzsDisplayNative *  displayNative,
int  fd,
int  fbId 
)

Schedule a page-flip, swap-buffers should be called prior to this.

This function internally first schedules a page flip with kzsDisplayNativePageFlipInvoke(), then waits for the synchronization using kzsDisplayNativePageFlipWait().

Parameters
displayNativeHandle to display-native.
fdFile handle to drm device or control-device.
fbIdHandle to the framebuffer.
Returns
KZS_SUCCESS on success.
kzsError kzsDisplayNativePageFlipInvoke ( struct KzsDisplayNative *  displayNative,
int  fd,
int  fbId 
)

Queues to page flip to happen on next vblank.

Parameters
displayNativeHandle to display-native.
fdFile handle to drm device or control-device.
fbIdHandle to the framebuffer.
Returns
KZS_SUCCESS on success.
kzsError kzsDisplayNativePageFlipWait ( struct KzsDisplayNative *  displayNative,
int  fd 
)

Waits for vblank signal that is sent on page flip.

Must be called from the same thread as kzsDisplayNativePageFlipInvoke().

Parameters
displayNativeHandle to display-native.
fdFile handle to drm device or control-device.
Returns
KZS_SUCCESS on success.
kzsError kzsDisplayNativeModeSet ( struct KzsDisplayNative *  displayNative,
int  fd,
int  fbId 
)

Set the mode for the display.

Parameters
displayNativeHandle to display-native.
fdFile handle to drm device or control-device.
fbIdHandle to the framebuffer.
Returns
KZS_SUCCESS on success.
kzsError kzsDisplayNativeRestoreMode ( struct KzsDisplayNative *  displayNative,
int  fd 
)

Restore original mode of the display.

Parameters
displayNativeHandle to display-native.
fdFile handle to drm device or control-device.
fbIdHandle to the framebuffer.
Returns
KZS_SUCCESS on success.
bool kzsDisplayNativeIsConnected ( struct KzsDisplayNative *  displayNative)

Check if display is connected.

Parameters
displayNativeHandle to display-native.
Returns
true if display connected and usable, otherwise false.