-
Notifications
You must be signed in to change notification settings - Fork 0
/
lire.lisp
60 lines (46 loc) · 1.42 KB
/
lire.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
48
49
50
51
52
53
54
55
56
57
58
59
;;
;; Lire - launch
;;
(setf sb-impl::*default-external-format* :utf-8) ; can be userful with Windows
(ql:quickload '(:swank :bordeaux-threads
:cl-opengl :cl-glut
:sdl2-ttf
:cl-anonfun))
(load (merge-pathnames (pathname "contrib/swank-fuzzy.lisp")
swank-loader:*source-directory*))
(defpackage :lire-user
(:use :cl :anonfun))
(defpackage :lire
(:shadowing-import-from :cl-glut width height)
(:use :cl))
(in-package :lire)
(defparameter *lire* nil)
(defparameter *lire-ui-thread* nil)
(dolist (file '("settings"
"utils"
"shapes"
"text"
"node"
"new-node"
"evaluation"
"writer"
"file-dialog"
"widget"
"canvas"
"window"
"menu"))
(load file))
(defun start-lire ()
(in-package :lire-user)
(glut:display-window *lire*))
(defun run-lire (&key (threaded t))
(format t "Running lire..~%")
(setf *lire* (make-instance 'lire-window)
*lire-ui-thread* (if threaded
(bordeaux-threads:make-thread
#'start-lire
:name "Lire-UI-thread")
(and (start-lire)
(sb-thread:main-thread)))))
(run-lire)
; (save-lisp)