-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbackend.lisp
47 lines (42 loc) · 1.38 KB
/
backend.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
(defpackage :ulubis-backend
(:use :common-lisp :cffi :xkb)
(:export
backend
backend-name
initialise-backend
process-events
get-fd
register-keyboard-handler
register-mouse-motion-handler
register-mouse-button-handler
register-window-event-handler
swap-buffers
destroy-backend
event-loop-add-drm-fd
set-scheduled
get-scheduled
init-egl
egl-supported?
egl-surface?
egl-get-dimensions
egl-texture-from-image
))
(in-package :ulubis-backend)
(defparameter backend-name nil)
(defgeneric initialise-backend (backend width height devices))
(defgeneric process-events (backend))
(defgeneric register-keyboard-handler (backend keyboard-handler))
(defgeneric register-mouse-motion-handler (backend mouse-motion-handler))
(defgeneric register-mouse-button-handler (backend mouse-button-handler))
(defgeneric register-window-event-handler (backend keyboard-handler)) ;; Useful if running on X
(defgeneric swap-buffers (backend))
(defgeneric destroy-backend (backend))
(defgeneric init-egl (backend wl-display))
(defgeneric egl-supported? (backend))
(defgeneric egl-surface? (backend buffer))
(defgeneric egl-get-dimensions (backend buffer))
(defgeneric egl-texture-from-image (backend buffer width height))
;; DRM backend only
(defgeneric event-loop-add-drm-fd (backend event-loop))
(defgeneric set-scheduled (backend value))
(defgeneric get-scheduled (backend))