db_none.c 584 B

123456789101112131415161718192021222324252627
  1. #define DB_IMPL_NAME "None"
  2. typedef struct {
  3. Display *display;
  4. Window window;
  5. GC gc;
  6. } DB;
  7. void db_init(DB *db, Display *display, Window window)
  8. {
  9. db->display = display;
  10. db->window = window;
  11. db->gc = XCreateGC(display, window, 0, NULL);
  12. }
  13. void db_clear(DB *db)
  14. {
  15. XClearArea(db->display, db->window, 0, 0, WIDTH, HEIGHT, False);
  16. }
  17. void db_fill_rect(DB *db, int x, int y, unsigned int w, unsigned int h)
  18. {
  19. XSetForeground(db->display, db->gc, 0xFF0000);
  20. XFillRectangle(db->display, db->window, db->gc, x, y, w, h);
  21. }
  22. #define db_swap_buffers(...)