Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
x11vnc \
-forever \
-shared \
-viewonly \
-allow ~/.config/eagle/vnc/allowed-ips \
-passwdfile ~/.config/eagle/vnc/password-file \
-ncache 10
(defun flymake-scons-init ()
(list "sh" (list "-c" (format "'scons -Dc && scons buildtype=syntax %s'"
(file-relative-name
(flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace)
(file-name-directory buffer-file-name))))))
(add-to-list 'flymake-allowed-file-name-masks
'(".+\\.\\(h\\|c\\)$" flymake-scons-init))
(defun flymake-scons-init ()
(list "scons -Dc && scons" (list "-D" "buildtype=syntax"
(file-relative-name
(flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace)
(file-name-directory buffer-file-name)))))
(add-to-list 'flymake-allowed-file-name-masks
'(".+\\.\\(h\\|c\\)$" flymake-scons-init))
(defun flymake-scons-init ()
(list "scons" (list "-QD" "buildtype=syntax"
(file-relative-name
(flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace)
(file-name-directory buffer-file-name)))))
(add-to-list 'flymake-allowed-file-name-masks
'(".+\\.\\(h\\|c\\)$" flymake-scons-init))
(defun flymake-scons-init ()
(list "scons" (list "-QD" "buildtype=syntax"
(file-relative-name
(flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace)
(file-name-directory buffer-file-name)))))
(add-to-list 'flymake-allowed-file-name-masks
'(".+\\.\(h|c)$" flymake-ooc-init))
(defmacro with-gl-array-values ((var type &optional components count) values
&body body)
;; Might want to make it so component types can nest:
;; (x y z (w v x)) or whatever
(let ((once-values (gensym "VALUES")))
`(let ((,once-values ,values))
,(let ((values once-values))
`(gl:with-gl-array (,var ,type :count (or ,count (length ,values)))
(setf (get-arrays ,var ,components) ,values)
;; Might want to have something that lets us bind stuff
(defmacro with-gl-array-values ((var type &optional components count) values
&body body)
;; Might want to make it so component types can nest:
;; (x y z (w v x)) or whatever
(let ((once-values (gensym "VALUES")))
`(let ((,once-values ,values))
,(let ((values ,once-values))
`(gl:with-gl-array (,var ,type :count (or ,count (length ,values)))
(setf (get-arrays ,var ,components) ,values)
;; Might want to have something that lets us bind stuff
<Appearance>
<Material DEF="MA_Material" diffuseColor="0.8 0.8 0.8" specularColor="0.401 0.401 0.401" emissiveColor="0.0 0.0 0.0"
ambientIntensity="0.167" shininess="0.098" transparency="0.0" />
</Appearance>
(gl:polygon-mode :front-and-back :point)
(gl:enable-client-state :vertex-array)
(gl:with-gl-array (arr 'vertex :count 3)
(setf (get-arrays arr '(x y z)) '(#(10 10 0) #(5 5 5) #(0 0 0)))
(gl:bind-gl-vertex-array arr)
(gl:with-gl-array (arr :unsigned-int :count 2)
(setf (get-arrays arr) '(0 1))
(gl:draw-elements :points arr)))
(gl:polygon-mode :front-and-back :fill)
(gl:enable-client-state :vertex-array)
(gl:with-gl-array (arr 'vertex :count 4)
(setf (getverts arr) '(#(10 10 0) #(5 0 5) #(0 1 1)
#(10 5 1)))
(gl:bind-gl-vertex-array arr)
(gl:with-gl-array (index :unsigned-int :count 4)
(setf (gl:glaref index 0) 0)
(setf (gl:glaref index 1) 1)
(setf (gl:glaref index 2) 2)