diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-01-24 23:16:13 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-01-24 23:16:13 +0100 |
| commit | e32b2212f0ebd9f988b3fca2433c6db69bb29992 (patch) | |
| tree | ad0870ff2b354d2c339fe58c5048ee6c519040d9 /include | |
| parent | 750c19410685218d66399554f4ed8e0cde7b8015 (diff) | |
clean dev, surf, ctx error handling
Diffstat (limited to 'include')
| -rw-r--r-- | include/vkvg.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/vkvg.h b/include/vkvg.h index 2da756e..06539e8 100644 --- a/include/vkvg.h +++ b/include/vkvg.h @@ -140,6 +140,9 @@ typedef enum { VKVG_STATUS_INVALID_DASH, /*!< invalid value for a dash setting */ VKVG_STATUS_INVALID_RECT, /*!< rectangle with height or width equal to 0. */ VKVG_STATUS_TIMEOUT, /*!< waiting for a vulkan operation to finish resulted in a fence timeout (5 seconds)*/ + VKVG_STATUS_DEVICE_ERROR, /*!< vkvg device initialization error */ + VKVG_STATUS_INVALID_IMAGE, /*!< */ + VKVG_STATUS_INVALID_SURFACE, /*!< */ }vkvg_status_t; typedef enum { @@ -703,6 +706,13 @@ uint32_t vkvg_surface_get_reference_count (VkvgSurface surf); vkvg_public void vkvg_surface_destroy (VkvgSurface surf); /** + * @brief Query the current status of the surface + * @param The vkvg surface to query the status for. + * @return The current surface status. + */ +vkvg_public +vkvg_status_t vkvg_surface_status (VkvgSurface surf); +/** * @brief Clear the surface content, alpha is also set to 0 resulting in a transparent image. * * @remark Internaly, the vulkan method used to clear the surface is the slowest, prefer using the @ref vkvg_clear @@ -743,16 +753,18 @@ uint32_t vkvg_surface_get_height (VkvgSurface surf); * @brief Write surface content to a png file on disk. * @param The surface to save on disk. * @param The png file path. + * @return SUCCESS or not. */ vkvg_public -void vkvg_surface_write_to_png (VkvgSurface surf, const char* path); +vkvg_status_t vkvg_surface_write_to_png (VkvgSurface surf, const char* path); /** * @brief Save surface to memory * @param The surface to save * @param A valid pointer on cpu memory large enough to contain surface pixels (stride * height) + * @return SUCCESS or not. */ vkvg_public -void vkvg_surface_write_to_memory (VkvgSurface surf, unsigned char* const bitmap); +vkvg_status_t vkvg_surface_write_to_memory (VkvgSurface surf, unsigned char* const bitmap); /** * @brief Explicitly resolve a multisampled surface. * |