42#ifndef ULTRALIGHT_CAPI_SURFACE_H
43#define ULTRALIGHT_CAPI_SURFACE_H
161typedef void* (*ULSurfaceDefinitionCreateCallback)(
unsigned int width,
unsigned int height);
206typedef void* (*ULSurfaceDefinitionLockPixelsCallback)(
void* user_data);
226 unsigned int height);
Various defines and utility functions for the C API.
struct C_Surface * ULBitmapSurface
Definition CAPI_Defines.h:74
#define ULExport
Definition CAPI_Defines.h:38
struct C_Surface * ULSurface
Definition CAPI_Defines.h:73
struct C_Bitmap * ULBitmap
Definition CAPI_Defines.h:64
ULExport ULBitmap ulBitmapSurfaceGetBitmap(ULBitmapSurface surface)
Get the underlying Bitmap from the default Surface.
ULExport unsigned int ulSurfaceGetWidth(ULSurface surface)
Width (in pixels).
ULExport void ulSurfaceUnlockPixels(ULSurface surface)
Unlock the pixel buffer.
unsigned int(* ULSurfaceDefinitionGetRowBytesCallback)(void *user_data)
The callback invoked when a Surface's row bytes is requested.
Definition CAPI_Surface.h:191
ULExport void ulSurfaceResize(ULSurface surface, unsigned int width, unsigned int height)
Resize the pixel buffer to a certain width and height (both in pixels).
ULExport void * ulSurfaceLockPixels(ULSurface surface)
Lock the pixel buffer and get a pointer to the beginning of the data for reading/writing.
ULExport size_t ulSurfaceGetSize(ULSurface surface)
Size in bytes.
ULExport ULIntRect ulSurfaceGetDirtyBounds(ULSurface surface)
Get the dirty bounds.
ULExport unsigned int ulSurfaceGetRowBytes(ULSurface surface)
Number of bytes between rows (usually width * 4)
ULExport void ulSurfaceClearDirtyBounds(ULSurface surface)
Clear the dirty bounds.
ULExport unsigned int ulSurfaceGetHeight(ULSurface surface)
Height (in pixels).
void(* ULSurfaceDefinitionResizeCallback)(void *user_data, unsigned int width, unsigned int height)
The callback invoked when a Surface is requested to be resized to a certain width/height.
Definition CAPI_Surface.h:225
void *(* ULSurfaceDefinitionCreateCallback)(unsigned int width, unsigned int height)
The callback invoked when a Surface is created.
Definition CAPI_Surface.h:161
unsigned int(* ULSurfaceDefinitionGetWidthCallback)(void *user_data)
The callback invoked when a Surface's width (in pixels) is requested.
Definition CAPI_Surface.h:175
void(* ULSurfaceDefinitionDestroyCallback)(void *user_data)
The callback invoked when a Surface is destroyed.
Definition CAPI_Surface.h:168
ULExport void ulSurfaceSetDirtyBounds(ULSurface surface, ULIntRect bounds)
Set the dirty bounds to a certain value.
void(* ULSurfaceDefinitionUnlockPixelsCallback)(void *user_data)
The callback invoked when a Surface's pixel buffer is requested to be unlocked after previously being...
Definition CAPI_Surface.h:214
void *(* ULSurfaceDefinitionLockPixelsCallback)(void *user_data)
The callback invoked when a Surface's pixel buffer is requested to be locked for reading/writing (sho...
Definition CAPI_Surface.h:206
ULExport void * ulSurfaceGetUserData(ULSurface surface)
Get the underlying user data pointer (this is only valid if you have set a custom surface implementat...
size_t(* ULSurfaceDefinitionGetSizeCallback)(void *user_data)
The callback invoked when a Surface's size (in bytes) is requested.
Definition CAPI_Surface.h:198
unsigned int(* ULSurfaceDefinitionGetHeightCallback)(void *user_data)
The callback invoked when a Surface's height (in pixels) is requested.
Definition CAPI_Surface.h:182
Definition CAPI_Defines.h:257
User-defined surface interface.
Definition CAPI_Surface.h:234
ULSurfaceDefinitionGetHeightCallback get_height
Definition CAPI_Surface.h:238
ULSurfaceDefinitionUnlockPixelsCallback unlock_pixels
Definition CAPI_Surface.h:242
ULSurfaceDefinitionCreateCallback create
Definition CAPI_Surface.h:235
ULSurfaceDefinitionResizeCallback resize
Definition CAPI_Surface.h:243
ULSurfaceDefinitionLockPixelsCallback lock_pixels
Definition CAPI_Surface.h:241
ULSurfaceDefinitionGetWidthCallback get_width
Definition CAPI_Surface.h:237
ULSurfaceDefinitionGetRowBytesCallback get_row_bytes
Definition CAPI_Surface.h:239
ULSurfaceDefinitionGetSizeCallback get_size
Definition CAPI_Surface.h:240
ULSurfaceDefinitionDestroyCallback destroy
Definition CAPI_Surface.h:236