This repository has been archived by the owner on Jun 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
;; Graphics operations | ||
;; Graphics operations. | ||
|
||
(ns enoki.graphics) | ||
|
||
(defprotocol Context | ||
;; (bg! [this colour] | ||
;; "Set background colour") | ||
;; (fg! [this colour] | ||
;; "Set foreground colour") | ||
|
||
(clear! [this] | ||
"Fill the display with the current background-colour. Returns `this'.") | ||
"Fill the display with the current background colour and return `this`.") | ||
|
||
(draw-text! [this s x y] | ||
"Draw string `s' at location [x, y]")) | ||
"Draw string `s' at location `(x, y)` and return `this`.")) | ||
|
||
(defprotocol Display | ||
|
||
(init-display! [this] | ||
"Do any required initialisation, e.g. make frame visible") | ||
"Do any required initialisation, e.g. make frame visible.") | ||
|
||
(display-width [this] | ||
"Return the display width in pixels") | ||
"Return the display width in pixels.") | ||
|
||
(display-height [this] | ||
"Return the display height in pixels") | ||
"Return the display height in pixels.") | ||
|
||
(render [this ctx] | ||
"Draws to the display using a function (fn [g])")) | ||
"Draws to the display using a function `(fn [g])`, where `g` is a `Context`.")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters