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
(defmacro timeit2 | |
``` | |
Time the execution of `form` using `os/clock` before and after, | |
and print the result to stdout. returns: result of executing `form`. | |
Uses `tag` (default "Elapsed time:") to tag the printout. | |
``` | |
[form &opt tag] | |
(default tag "Elapsed time:") | |
(with-syms [start result end] | |
~(do |
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
(defonce pushers @[]) | |
(defonce pullers @[]) | |
(array/clear pushers) | |
(array/clear pullers) | |
(defonce click-buffer @[]) | |
(array/clear click-buffer) | |
(defonce move-buffer @[]) |
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
(def mario @{:x 0 :y 0 :vx 0 :vy 0}) | |
(defn physics | |
[dt mario] | |
(-> mario | |
(update :x + (* (mario :vx) dt)) | |
(update :y + (* (mario :vy) dt)))) | |
(defn walk | |
[x mario] |
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
# two kinds of renders | |
(var mouse-stolen false) | |
(defn mouse-button-down? | |
[k] | |
(if ((dyn :context) :captured-mouse) | |
true | |
(and (not mouse-stolen) | |
(raylib/mouse-button-down? k)))) |
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
(defn invalidate! | |
"Invalidates the cache, i.e. forces it to rerender next `cached-render` call." | |
[& [c]] | |
(default c (dyn :cache)) | |
(put c :valid false)) | |
(defn update! | |
"Like update, but also runs invalidate!" | |
[& args] | |
(update ;args) |
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
41.09 How to handle focus | |
Kinds of focus | |
- Mouse clicks | |
- Hover | |
- Drag | |
- Keyboard handling | |
- (Re)rendering | |
How to detect focus |
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
(use ./build/jaylib) | |
(set-config-flags | |
:msaa-4x-hint) | |
(init-window 800 600 "Chart") | |
(init-audio-device) | |
(set-target-fps 60) | |
(def current-animations @{}) |
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
{:deps {seancorfield/next.jdbc {:mvn/version "1.0.13"} | |
org.clojure/data.csv {:mvn/version "1.0.0"} | |
clojure.java-time {:mvn/version "0.3.2"} | |
com.microsoft.sqlserver/mssql-jdbc {:mvn/version "8.2.0.jre8"}}} |
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
/******************************************************************************************* | |
* | |
* raylib [core] example - Basic window | |
* | |
* Welcome to raylib! | |
* | |
* To test examples, just press F6 and execute raylib_compile_execute script | |
* Note that compiled executable is placed in the same folder as .c file | |
* | |
* You can find all basic examples on C:\raylib\raylib\examples folder or |
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
/******************************************************************************************* | |
* | |
* raylib [core] example - Basic window | |
* | |
* Welcome to raylib! | |
* | |
* To test examples, just press F6 and execute raylib_compile_execute script | |
* Note that compiled executable is placed in the same folder as .c file | |
* | |
* You can find all basic examples on C:\raylib\raylib\examples folder or |