aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/protocol.lisp
blob: 52d25252557de7f7e49a5f0c69f5f9c2faa6fd10 (plain)
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
;;;; protocol.lisp

(in-package #:wheelwork)

(defgeneric boot (app)
  (:documentation "Specialized for each subclass of
  APPLICATION. Responsble for setting the app up once the system
  resoruces are avaialble."))

(defgeneric shutdown (app)
  (:documentation "Specialzied for each subclass of
  APPLICATION. Called just before cleanup.")
  (:method ((any t)) nil))

(defgeneric cleanup (thing)
  (:documentation "Clean up applications, textures, and other foreign
  resources. Called after shutodown.")
  (:method ((any t)) nil))

(defgeneric drop-unit (unit)
  (:documentation "Removes a unit from a container."))
(defgeneric add-unit (container unit)
  (:documentation "Adds a unit to a container, removing it from its
  current container first, if necessary."))

(defgeneric unit-width (unit))
(defgeneric unit-height (unit)) 
(defgeneric (setf unit-width) (newval unit))
(defgeneric (setf unit-height) (newval unit))

(defgeneric render (thing)
  (:documentation "Renders thing for visual display."))

(defgeneric model-matrix (thing)
  (:documentation "Returns the model matrix for THING, representing
  its position, scale, and orientation in the scene"))

(defgeneric projected-matrix (thing)
  (:documentation "Returns the raw array of the model matrix after it
  has been prjected by the application's projecion matrix. Used to
  pass to GLSL shader programs."))

(defgeneric ensure-loaded (asset)
  (:documentation "Ensures that the asset is loaded into memory and
  ready for use. Returns the asset."))