protected virtual void Dispose(bool disposing) { if (handle != null) { gbm_device_destroy(handle); } handle = null; }
public Device(int gpu) { this.gpu = gpu; handle = gbm_create_device(this.gpu); if (handle == null) { throw new NotSupportedException("[GBM] device creation failed."); } }
public Device(gbm_device *handle) { if (handle == null) { throw new NotSupportedException("[GBM] device creation failed."); } this.handle = handle; this.gpu = this.DeviceGetFD(); }
static extern gbm_surface *gbm_surface_create_with_modifiers(gbm_device *deviceHandle, uint width, uint height, SurfaceFormat format, ulong *modifiers, uint count);
static extern gbm_surface *gbm_surface_create(gbm_device *deviceHandle, uint width, uint height, SurfaceFormat format, SurfaceFlags flags);
static extern nint gbm_device_get_backend_name(gbm_device *handle);
static extern bool gbm_device_is_format_supported(gbm_device *handle, SurfaceFormat format, SurfaceFlags flags);
static extern int gbm_device_get_fd(gbm_device *handle);
static extern void gbm_device_destroy(gbm_device *handle);