// dvx_video.h — Layer 1: VESA VBE video backend for DV/X GUI #ifndef DVX_VIDEO_H #define DVX_VIDEO_H #include "dvxTypes.h" // Initialize VESA video mode and map LFB // Returns 0 on success, -1 on failure (error message printed to stderr) int32_t videoInit(DisplayT *d, int32_t requestedW, int32_t requestedH, int32_t preferredBpp); // Shut down video — restore text mode, unmap LFB, free backbuffer void videoShutdown(DisplayT *d); // Pack an RGB color into the display's pixel format // For 15/16/32-bit: returns packed pixel value // For 8-bit: returns nearest palette index uint32_t packColor(const DisplayT *d, uint8_t r, uint8_t g, uint8_t b); // Set the clip rectangle on the display void setClipRect(DisplayT *d, int32_t x, int32_t y, int32_t w, int32_t h); // Reset clip rectangle to full display void resetClipRect(DisplayT *d); // Set VGA DAC palette (8-bit mode only) void videoSetPalette(const uint8_t *pal, int32_t firstEntry, int32_t count); #endif // DVX_VIDEO_H