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
/** | |
* Shadow 2D. | |
* License: CC0 | |
* https://creativecommons.org/publicdomain/zero/1.0/ | |
*/ | |
shader_type canvas_item; | |
render_mode blend_mix; | |
uniform vec2 deform = vec2(2.0, 2.0); | |
uniform vec2 offset = vec2(0.0, 0.0); |
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 template (text) | |
"Expand text like \"Hello <<name>>\" to (format \"Hello %s\" name)." | |
(let ((pattern "<<\\(.*?\\)>>")) | |
;; The regexp matches anything between delimiters, non-greedily | |
(with-temp-buffer | |
(save-excursion (insert text)) | |
(let ((matches '())) | |
(while (re-search-forward pattern nil t) | |
(push (match-string 1) matches) | |
(replace-match "%s" t t)) |
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
class Main { | |
static function main() { | |
Sdl.init(Sdl.INIT_EVERYTHING); | |
var win = Sdl.createWindow("Hello", 100, 100, 800, 600, Sdl.WINDOW_OPENGL); | |
var ren = Sdl.createRenderer(win, -1, Sdl.RENDERER_ACCELERATED); | |
var bmp = Sdl.loadBMP("test.bmp"); | |
var tex = Sdl.createTextureFromSurface(ren, bmp); | |
Sdl.freeSurface(bmp); | |
for (i in 0...3) { |