;;; bad-ecs --- warning: disgusting minimalist maximalism ahead -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (require 'cl-lib) (cl-pushnew "." load-path :test #'string=) (require 'luki-lisp) (defun bad-minimal-glsl (&optional no-frame-change) (cl-loop with hexa-k = 3e3 with hexa-t = [ 0.4 0.08 -5e2 ] with hexa-c = [[ 0.0 0.96 1.0 ] [ 0.0 0.88 0.96 ] [ 0.0 0.80 0.88 ]] with hz = (bad-hz) with fps = 60 with delta = (// hz fps) with frames = (** 2 9) with beg = (bad-ticks) with stops = (number-sequence (+ beg delta) (+ beg (* frames delta)) delta) with run = t initially (ecs-init) (ecs-init-interface nil nil no-frame-change) (sdl_glsl_init) (setf inhibit-redisplay t) for R = (ecs-rotation-matrix-alternative) for V = (ecs-view-matrix) for M = (ecs-world-matrix hexa-k hexa-t R) while run for next in stops do (when-let* ((evnt (& (input-pending-p) (read-event)))) (setf run (! (= evnt 113))) (ecs-camera-input evnt)) (sdl_glsl_clear) (sdl_glsl_update ecs-proj V M) (mapc (L (e) (ecs-draw-triangle e hexa-c)) bad-meshes-hexahedron) (sdl_glsl_swap) (sleep-for (// (- next (bad-ticks)) hz)) finally (setf inhibit-redisplay nil) (sdl_glsl_quit))) ; (progn (eval-buffer) (bad-glsl t))