sdl3/lib/sdl3-video-impl.scm

55 lines
1.8 KiB
Scheme
Raw Normal View History

2024-09-22 21:46:26 +00:00
(import (scheme)
(srfi 152)
(chicken base)
(chicken foreign)
(chicken syntax))
(foreign-declare "#include <SDL3/SDL_video.h>")
(define-syntax define-sdl-flag
(er-macro-transformer
(lambda (exp rename compare)
(let ((flag (cadr exp)))
`(begin
(export ,flag)
(define ,flag
(foreign-value
,(string-append "SDL_"
(string-map (lambda (c)
(if (char=? #\- c)
#\_
(char-upcase c)))
(symbol->string flag)))
unsigned-int32)))))))
(define-sdl-flag window-fullscreen)
(define-sdl-flag window-opengl )
(define-sdl-flag window-occluded )
(define-sdl-flag window-hidden )
(define-sdl-flag window-borderless)
(define-sdl-flag window-resizable)
(define-sdl-flag window-minimized)
(define-sdl-flag window-maximized)
(define-sdl-flag window-mouse-grabbed)
(define-sdl-flag window-input-focus)
(define-sdl-flag window-mouse-focus)
(define-sdl-flag window-external)
(define-sdl-flag window-modal)
(define-sdl-flag window-high-pixel-density)
(define-sdl-flag window-mouse-capture)
(define-sdl-flag window-mouse-relative-mode)
(define-sdl-flag window-always-on-top)
(define-sdl-flag window-utility)
(define-sdl-flag window-tooltip)
(define-sdl-flag window-popup-menu)
(define-sdl-flag window-keyboard-grabbed)
(define-sdl-flag window-vulkan)
(define-sdl-flag window-metal)
(define-sdl-flag window-transparent)
(define-sdl-flag window-not-focusable)
(define create-popup-window
(foreign-lambda (struct "SDL_Window") "SDL_CreatePopupWindow"
(struct "SDL_Window") int int int int unsigned-int32))