diff --git a/typenames.witx b/typenames.witx index 2705081..0618921 100644 --- a/typenames.witx +++ b/typenames.witx @@ -1,3 +1,5 @@ +(typename $size u32) + ;;; Error codes returned by functions. ;;; (typename $errno @@ -6,3 +8,16 @@ $success ) ) + +;;; A video device handle. +(typename $video_device (handle)) + +;;; A video context handle. +(typename $video_context (handle)) + +;;; Pixel formats used by framebuffer related functions. +(typename pixel_format + (enum u16 + rbga_32, + ) +) diff --git a/waki_unstable.witx b/waki_unstable.witx index 6a6ec7d..0886449 100644 --- a/waki_unstable.witx +++ b/waki_unstable.witx @@ -3,4 +3,73 @@ (module $waki_unstable ;;; Linear memory to be accessed by functions that need it. (import "memory" (memory)) + + ;;; Open a video device + ;;; + (@interface func (export "video_open_device") + ;;; The error that occured, if any. + (result $error $errno) + + ;;; The video device handle of the device that has been opened. + (result $opened_device $video_device) + ) + + ;;; Close a video device + ;;; + (@interface func (export "video_close_device") + ;; The video device handle that should be closed. + ;; + (param device $video_device) + + ;;; The error that occured, if any. + (result $error $errno) + ) + + ;;; Create a video context + ;;; + (@interface func (export "video_create_context") + ;;; The device to create a context for + (param device $video_device) + + ;;; The error that occured, if any. + (result $error $errno) + ) + + ;;; Close a video context + ;;; + (@interface func (export "video_destroy_context") + ;;; The context to destroy. + (param context $video_context) + + ;;; The error that occured, if any. + (result $error $errno) + ) + + ;;; Write a block of pixels to the frame buffer + ;;; + (@interface func (export "video_draw_pixels") + ;;; The context to destroy. + (param context $video_context) + + ;;; Specifies the y raster position. + (param x $size) + + ;;; Specifies the y raster position. + (param y $size) + + ;;; Specifies the height of the pixel data. + (param width $size) + + ;;; Specifies the width of the pixel data. + (param height $size) + + ;;; Specifies the format of the pixel data. + (param format $pixel_format) + + ;;; Specifies a pointer to the pixel data. + (param data $size) + + ;;; The error that occured, if any. + (result $error $errno) + ) )