sucle

API Reference

aabbcc

a blocky axis aligned physics engine

AABBCC

  • Function TYPE-COLLAPSER (dx dy dz xyz? xy? xz? yz? x? y? z?)
  • Function AABB-MINX (instance)
  • Function (setf AABB-MINX) (value instance)
  • Function AABB-MINY (instance)
  • Function (setf AABB-MINY) (value instance)
  • Function AABB-MINZ (instance)
  • Function (setf AABB-MINZ) (value instance)
  • Function AABB-MAXX (instance)
  • Function (setf AABB-MAXX) (value instance)
  • Function AABB-MAXY (instance)
  • Function (setf AABB-MAXY) (value instance)
  • Function AABB-MAXZ (instance)
  • Function (setf AABB-MAXZ) (value instance)
  • Function MAKE-AABB (&key ((minx minx) 0.0) ((miny miny) 0.0) ((minz minz) 0.0) ((maxx maxx) 0.0) ((maxy maxy) 0.0) ((maxz maxz) 0.0))
  • Function AABB-COLLIDE (aabb0 px0 py0 pz0 aabb1 px1 py1 pz1 vx vy vz)
  • Function AABB-CONTACT (x0 y0 z0 aabb0 x1 y1 z1 aabb1)

application

Bring the components together for a desktop app

APPLICATION

  • Variable *MAIN-SUBTHREAD-P*
    t
  • Variable *THREAD*
    nil
  • Function MAIN (start-fun &rest rest)
  • Variable *QUIT-TOKEN*
    nil
  • Macro ON-SESSION-CHANGE (session-place &body body &environment env)
  • Function POLL-APP

Also exports

  • DEFLAZY:DEFLAZY
  • DEFLAZY:GETFNC

camera-matrix

projection matrices for 3d rendering

CAMERA-MATRIX

  • Function CAMERA-VEC-POSITION (instance)
  • Function (setf CAMERA-VEC-POSITION) (value instance)
  • Function CAMERA-VEC-FORWARD (instance)
  • Function (setf CAMERA-VEC-FORWARD) (value instance)
  • Function CAMERA-VEC-NOITISOP (instance)
  • Function (setf CAMERA-VEC-NOITISOP) (value instance)
  • Function CAMERA-MATRIX-PROJECTION-VIEW-PLAYER (instance)
  • Function (setf CAMERA-MATRIX-PROJECTION-VIEW-PLAYER) (value instance)
  • Function CAMERA-FOV (instance)
  • Function (setf CAMERA-FOV) (value instance)
  • Function CAMERA-ASPECT-RATIO (instance)
  • Function (setf CAMERA-ASPECT-RATIO) (value instance)
  • Function CAMERA-FRUSTUM-NEAR (instance)
  • Function (setf CAMERA-FRUSTUM-NEAR) (value instance)
  • Function CAMERA-FRUSTUM-FAR (instance)
  • Function (setf CAMERA-FRUSTUM-FAR) (value instance)
  • Function MAKE-CAMERA (&key ((vec-position vec-position) (sb-cga:vec 0.0 0.0 0.0)) ((vec-up vec-up) (sb-cga:vec 0.0 1.0 0.0)) ((vec-forward vec-forward) (sb-cga:vec 1.0 0.0 0.0)) ((vec-noitisop vec-noitisop) (sb-cga:vec 0.0 0.0 0.0)) ((matrix-player matrix-player) (sb-cga:identity-matrix)) ((matrix-view matrix-view) (sb-cga:identity-matrix)) ((matrix-projection matrix-projection) (sb-cga:identity-matrix)) ((matrix-projection-view matrix-projection-view) (sb-cga:identity-matrix)) ((matrix-projection-view-player matrix-projection-view-player) (sb-cga:identity-matrix)) ((fov fov) (coerce (/ pi 2.0) 'single-float)) ((aspect-ratio aspect-ratio) 1.0) ((frustum-near frustum-near) 0.0078125) ((frustum-far frustum-far) 128.0))
  • Function UPDATE-MATRICES (camera)

clock

a millisecond or microsecond timer

CLOCK

  • Function MICROSECONDS (&optional (offset *seconds-offset*))

control

keyboard input, like wasd, and terminal emulator codes

CONTROL

  • Function WASD-MOVER (w? a? s? d?)
  • Function NUM-KEY-JP (&optional (control-state window::*control-state*))
  • Variable *TERMINAL-EMULATOR-P*
    t
  • Function GET-INPUT-CHARACTERS (&optional (command-buffer *command-buffer*))

deflazy

lazy loading reloading on changes

DEPENDENCY-GRAPH

No exported symbols.

DEFLAZY

  • Macro DEFLAZY (name (&rest deps) &rest gen-forms)
  • Function REFRESH (name &optional (main-thread nil))
  • Function FLUSH-REFRESHES
  • Function GETFNC (name)

fps-independent-timestep

do physics simulations without worrying about frames per second

FPS-INDEPENDENT-TIMESTEP

  • Function TICKER-DT (instance)
  • Function (setf TICKER-DT) (value instance)
  • Function TICKER-ACCUMULATOR (instance)
  • Function (setf TICKER-ACCUMULATOR) (value instance)
  • Function TICKER-AUX (instance)
  • Function (setf TICKER-AUX) (value instance)
  • Function MAKE-TICKER (dt time &optional (bailout (floor 1000000 4)))
  • Macro TICK-PHYSICS (ticker &body body)
  • Function TICK-UPDATE (ticker new-time)

glhelp

Generate GLSL that runs on all versions but leaves out features that are backwards incompatible and All OpenGL code utilities I've written.

GLHELP

  • Function PIC-TEXTURE (thepic &optional type)
  • Function APPLY-TEX-PARAMS (tex-parameters)
  • Function MAKE-SHADER-PROGRAM-FROM-STRINGS (vs-string fs-string attribs)
  • Function ALIVE-P (obj)
  • Function CACHE-PROGRAM-UNIFORMS (program uniforms)
  • Function GETUNIFORM (shader-info name)
  • Macro WITH-UNIFORMS (name program-object &body body)
  • Macro WITH-GL-LIST (&body body)
  • Macro DEFLAZY-GL (name (&rest deps) &rest gen-forms)
    for objects that should be forgotten because they were not made in the current OpenGL context, so they are garbage
  • Macro WITH-GL-CONTEXT ((gl-proc-address) &body body)
  • Function SET-RENDER-AREA (x y width height)

image-utility

Load an image and/or flip it

IMAGE-UTILITY

  • Function FLIP-IMAGE (image)
  • Variable *FLIP-IMAGE-P*
    nil
  • Function WRITE-PNG-FILE (pathname image)

matrix

its a math matrix

MATRIX

  • Macro ROW-VECTOR (&rest args)
  • Macro COLUMN-VECTOR (&rest args)
  • Function MATRIX-MULTIPLY (matrix-a matrix-b)

nsb-cga

adds destructive matrix functions to sb-cga

NSB-CGA

  • Function %MATRIX (result m11 m12 m13 m14 m21 m22 m23 m24 m31 m32 m33 m34 m41 m42 m43 m44)
    Construct MATRIX with the given elements (arguments are provided in row major order.)
  • Function %ZERO-MATRIX (result)
    Construct a zero matrix.
  • Function %IDENTITY-MATRIX (result)
    Construct an identity matrix.
  • Function %MATRIX* (result left right)
    Multiply MATRICES. The result might not be freshly allocated if all, or all but one multiplicant is an identity matrix.
  • Function %TRANSLATE* (result x y z)
    Construct a translation matrix from translation factors X, Y and Z.
  • Function %TRANSLATE (result vec)
    Construct a translation matrix using first three elements of VEC as the translation factors.
  • Function %SCALE* (result x y z)
    Construct a scaling matrix from scaling factors X, Y, and Z.
  • Function %SCALE (result vec)
    Construct a scaling matrix using first threee elements of VEC as the scaling factors.
  • Function %ROTATE* (result x y z)
    Construct a rotation matrix from rotation factors X, Y, Z.
  • Function %ROTATE (result vec)
    Construct a rotation matrix using first three elements of VEC as the rotation factors.
  • Function %ROTATE-AROUND (result v radians)
    Construct a rotation matrix that rotates by RADIANS around VEC V. 4th element of V is ignored.
  • Function %ROTATE-AROUND* (result x y z radians)
    Construct a rotation matrix that rotates by RADIANS around VEC V. 4th element of V is ignored.
  • Function %REORIENT (result v1 v2)
    Construct a transformation matrix to reorient V1 with V2.
  • Function %TRANSPOSE-MATRIX (result matrix)
    Transpose of MATRIX.
  • Function %INVERSE-MATRIX (result matrix)
    Inverse of MATRIX. Signals an error if there is no inverse.

Also exports

  • SB-CGA:+DEFAULT-EPSILON+
  • SB-CGA:%VEC+
  • SB-CGA:ADJUST-VEC
  • SB-CGA:SCALE
  • SB-CGA:SXHASH-VEC
  • SB-CGA:%VEC/
  • SB-CGA:VEC~
  • SB-CGA:CUBIC-ROOTS-ABOVE
  • SB-CGA:%HADAMARD-PRODUCT
  • SB-CGA:VEC-LENGTH
  • SB-CGA:MATRIXP
  • SB-CGA:TRANSLATE
  • SB-CGA:VEC-MAX
  • SB-CGA:%ADJUST-VEC
  • SB-CGA:QUADRATIC-ROOTS
  • SB-CGA:TRANSFORM-DIRECTION
  • SB-CGA:IDENTITY-MATRIX
  • SB-CGA:VEC=
  • SB-CGA:%TRANSFORM-DIRECTION
  • SB-CGA:%VEC-
  • SB-CGA:COPY-VEC
  • SB-CGA:VEC-
  • SB-CGA:VEC*
  • SB-CGA:TRANSLATE*
  • SB-CGA:MATRIX-DETERMINANT
  • SB-CGA:%NORMALIZE
  • SB-CGA:SCALE*
  • SB-CGA:ROTATE-AROUND
  • SB-CGA:ROTATE*
  • SB-CGA:ALLOC-VEC
  • SB-CGA:+IDENTITY-MATRIX+
  • SB-CGA:VEC-LERP
  • SB-CGA:MATRIX=
  • SB-CGA:TRANSFORM-BOUNDS
  • SB-CGA:TRANSPOSE-MATRIX
  • SB-CGA:%VEC-LERP
  • SB-CGA:INVERSE-MATRIX
  • SB-CGA:NORMALIZE
  • SB-CGA:%TRANSFORM-POINT
  • SB-CGA:%VEC*
  • SB-CGA:MATRIX*
  • SB-CGA:REORIENT
  • SB-CGA:ROTATE
  • SB-CGA:CBRT
  • SB-CGA:CROSS-PRODUCT
  • SB-CGA:ZERO-MATRIX
  • SB-CGA:HADAMARD-PRODUCT
  • SB-CGA:%VEC-MIN
  • SB-CGA:TRANSFORM-POINT
  • SB-CGA:%COPY-VEC
  • SB-CGA:MATRIX~
  • SB-CGA:CUBIC-ROOTS
  • SB-CGA:MATRIX
  • SB-CGA:%VEC-MAX
  • SB-CGA:VEC+
  • SB-CGA:VEC-MIN
  • SB-CGA:QUADRATIC-ROOTS-ABOVE
  • SB-CGA:VEC
  • SB-CGA:DOT-PRODUCT
  • SB-CGA:%CROSS-PRODUCT
  • SB-CGA:VEC/
  • SB-CGA:MREF

opengl-glfw3

glfw3 opengl context creation, windowing and input

WINDOW

  • Function SKEY-P (value &optional (state *control-state*))
  • Function SKEY-J-P (value &optional (state *control-state*))
  • Function SKEY-J-R (value &optional (state *control-state*))
  • Variable *SCROLL-X*
    0
  • Variable *SCROLL-Y*
    0
  • Variable *MOUSE-X*
    0.0d0
  • Variable *MOUSE-Y*
    0.0d0
  • Variable *WIDTH*
    nil
  • Variable *HEIGHT*
    nil
  • Variable *RESIZE-HOOK*
    (constantly nil)
  • Variable *STATUS*
    nil
  • Function INIT
  • Function POLL
  • Function WRAPPER (func &optional (params '(:title "window" :width 1 :height 1 :resizable nil)))
  • Function GET-MOUSE-OUT
  • Function TOGGLE-MOUSE-CAPTURE
  • Function MICE-LOCKED-P
  • Function MICE-FREE-P
  • Function PUSH-DIMENSIONS (width height)
  • Function SET-CAPTION (caption)
  • Function UPDATE-DISPLAY
  • Function SET-VSYNC (bool)
  • Function GET-MOUSE-POSITION (&optional (window *window*))

opengl-immediate

Draw coordinates like OpenGL immediate, even if unsupported

OPENGL-IMMEDIATE

  • Function VERTEX (&optional (x 0.0) (y 0.0) (z 0.0) (w 1.0))
  • Function TEX-COORD (&optional (x 0.0) (y 0.0) (z 0.0) (w 1.0))
  • Function COLOR (&optional (x 0.0) (y 0.0) (z 0.0) (w 1.0))
  • Function MESH-VERTEX
  • Function MESH-VERTEX-COLOR
  • Function MESH-VERTEX-TEX-COORD
  • Function MESH-VERTEX-TEX-COORD-COLOR
  • Macro WITH-PRIMITIVES (mode meshing-fun &body body)

quads

quads, as in shapes with 4 vertices

RECTANGULAR-TILEMAP

  • Function SEQUENTIAL-INDEX-GENERATOR (width height num)
  • Function REGULAR-ENUMERATION (width height &key (flip-y t))
  • Function INDEX-QUAD-LOOKUP (array code)

AXIS-ALIGNED-QUADS

  • Function DUAQ (start clockwise-winding form)
  • Function AALGNQD (start value subform)
  • Function QUADI+ (i form)
  • Function QUADI- (i form)
  • Function QUADJ+ (j form)
  • Function QUADJ- (j form)
  • Function QUADK+ (k form)
  • Function QUADK- (k form)

RECTANGLE

  • Class RECTANGLE
    X0   Accessor: RECTANGLE-X0
    Y0   Accessor: RECTANGLE-Y0
    X1   Accessor: RECTANGLE-X1
    Y1   Accessor: RECTANGLE-Y1
  • Function COORDINATE-INSIDE-RECTANGLE-P (x y rectangle)
  • Function R-INTERSECT (ax0 ay0 ax1 ay1 bx0 by0 bx1 by1)

reverse-array-array

a highly optimized data structure for fast writing and ok n(1) random access

REVERSE-ARRAY-ARRAY

  • Type RAA
  • Function RAA-LENGTH (construct)
  • Function (setf RAA-LENGTH) (value construct)
  • Function RAA-DATA (construct)
  • Function (setf RAA-DATA) (value construct)
  • Function MAKE-RAA (&optional (length 1))
  • Function XELT (raa n)
  • Function (setf XELT) (value raa n)
  • Function REVERSE-FIT-RESIZE (raa leaf-capacity)
  • Function MAKE-RAA-ITERATOR (raa)
  • Macro WITH-RAA-ITERATOR ((next-fun value-place raa) &body body)
  • Function RELOCATE-ITERATOR (value-iter n)
  • Function RESET-ITERATOR (value-iter)
  • Function ITERATOR-POSITION (value-iter)

reverse-array-iterator

highly optimized iterator for writing to the reverse-array-array

REVERSE-ARRAY-ITERATOR

  • Struct ITERATOR
    INDEX
    ARRAY
    DATA
    FUNC
  • Function P-INDEX (instance)
  • Function (setf P-INDEX) (value instance)
  • Function P-ARRAY (instance)
  • Function (setf P-ARRAY) (value instance)
  • Function P-DATA (instance)
  • Function (setf P-DATA) (value instance)
  • Function P-FUNC (instance)
  • Function (setf P-FUNC) (value instance)
  • Function MAKE-ITERATOR (index array data func)
  • Function MAKE-DEFAULT-ITERATOR
  • Function MAKE-ZEROED-ITERATOR (func data)
  • Macro WITH-BOUND-ITERATOR ((next place (array &optional (array-type '(or null simple-vector))) (index &optional (index-type 'fixnum))) iterator &body body)
  • Macro WITH-SIMPLY-BOUND-ITERATOR ((next place &optional (type t)) iterator &body body)
  • Macro BIND-ITERATOR-OUT ((emit &optional (type t)) iterator &rest body)
  • Macro BIND-ITERATOR-IN ((deref &optional (type t)) iterator &rest body)

REVERSE-ARRAY-ITERATOR-USER

  • Function ITERATOR-VALUE (&optional (iterator *iterator*))
  • Function (setf ITERATOR-VALUE) (value &optional (iterator *iterator*))
  • Function ITERATOR-NEXT (&optional (iterator *iterator*))
  • Function ITERATOR-READ (&optional (iterator *iterator*))
  • Function ITERATOR-EMIT (item &optional (iterator *iterator*))

Also exports

  • REVERSE-ARRAY-ITERATOR:BIND-ITERATOR-IN
  • REVERSE-ARRAY-ITERATOR:BIND-ITERATOR-OUT

sandbox

The voxel backend for testbed

QUEUE

  • Function MAKE-UNIQ-Q (&key ((q q) (lparallel.queue:make-queue)) ((hash hash) (make-hash-table :test 'equal)))
  • Function UNIQ-PUSH (item uniq)
  • Function UNIQ-POP (uniq)

SANDBOX.SERIALIZE

No exported symbols.

SANDBOX.MULTIPROCESSING

No exported symbols.

SANDBOX

No exported symbols.

WORLD

  • Function UNHASHFUNC (chunk-key)
  • Function CLEARWORLD
  • Function (setf GETBLOCK) (new i j k)
  • Function GETBLOCK (i j k)
  • Function (setf GETLIGHT) (new i j k)
  • Function GETLIGHT (i j k)
  • Function (setf SKYGETLIGHT) (new i j k)
  • Function SKYGETLIGHT (i j k)

BLOCK-DATA

  • Variable *NAMES*
    (make-array 256 :element-type 't :initial-element (coerce 0 't))
  • Variable *OPAQUECUBELOOUKUP*
    (make-array 256 :element-type 't :initial-element (coerce 0 't))
  • Variable *LIGHTOPACITY*
    (make-array 256 :element-type 'fixnum :initial-element (coerce 0 'fixnum))
  • Variable *LIGHTVALUE*
    (make-array 256 :element-type '(unsigned-byte 4) :initial-element
                (coerce 0 '(unsigned-byte 4)))
  • Variable *BLOCKINDEXINTEXTURE*
    (make-array 256 :element-type '(unsigned-byte 8) :initial-element
                (coerce 0 '(unsigned-byte 8)))
  • Variable *ISCOLLIDABLE*
    (make-array 256 :element-type 't :initial-element (coerce 0 't))

scratch-buffer

fast write to a buffer, like vector-push-extend

SCRATCH-BUFFER

  • Function MY-ITERATOR
  • Function FREE-MY-ITERATOR-MEMORY (iterator)
  • Macro FLUSH-MY-ITERATOR (a &body body)
  • Function ITERATOR-FILL-POINTER (iterator)

sketch-sucle

Sketch is a Common Lisp framework for the creation of electronic art, computer graphics, visual design, game making and more. It is inspired by Processing and OpenFrameworks.

SKETCH-UTIL

No exported symbols.

sketch-sucle-examples

Sketch examples

SKETCH-SUCLE-EXAMPLES

  • Class SINEWAVE  (SKETCH)
    STEPS   Accessor: SINEWAVE-STEPS
    XS   Accessor: SINEWAVE-XS
    R   Accessor: SINEWAVE-R
  • Class LIFE  (SKETCH)
    COLUMNS   Accessor: LIFE-COLUMNS
    ROWS   Accessor: LIFE-ROWS
    CELL-SIZE   Accessor: LIFE-CELL-SIZE
    CELLS   Accessor: LIFE-CELLS
    FRONT   Accessor: LIFE-FRONT
    COLOR-BG   Accessor: LIFE-COLOR-BG
    PEN-DEAD   Accessor: LIFE-PEN-DEAD
    PEN-ALIVE   Accessor: LIFE-PEN-ALIVE
    RUNNING   Accessor: LIFE-RUNNING
  • Class BROWNIAN  (SKETCH)
    POS   Accessor: BROWNIAN-POS
    DIR   Accessor: BROWNIAN-DIR
    PEN   Accessor: BROWNIAN-PEN
    LINE-LENGTH   Accessor: BROWNIAN-LINE-LENGTH
    POINTS   Accessor: BROWNIAN-POINTS
    POINTS-POINTER   Accessor: BROWNIAN-POINTS-POINTER
  • Class HELLO-WORLD  (SKETCH)
    UNIT   Accessor: HELLO-WORLD-UNIT
  • Class LENNA  (SKETCH)
    PICTURE   Accessor: LENNA-PICTURE

sprite-chain

A data structure for sprites like how it works in the Scratch programming system

SPRITE-CHAIN

  • Function MAKE-SPRITE-CHAIN (&key (chain nil chain0) (hash nil hash1))
  • Function ADD-SPRITE (sprite &optional (sprite-chain *sprites*))
  • Function REMOVE-SPRITE (sprite &optional (sprite-chain *sprites*))
  • Function TOPIFY-SPRITE (sprite &optional (sprite-chain *sprites*))
  • Macro DO-SPRITE-CHAIN ((var &optional (backwards-p nil)) (&optional (chain '*sprites*)) &body body)

sucle

Cube Demo Game

SUCLE

  • Function START

sucle-doubly-linked-list

implementation of doubly-linked list

DOUBLY-LINKED-LIST

  • Function NODE-PREV (instance)
  • Function (setf NODE-PREV) (value instance)
  • Function NODE-NEXT (instance)
  • Function (setf NODE-NEXT) (value instance)
  • Function NODE-PAYLOAD (instance)
  • Function (setf NODE-PAYLOAD) (value instance)
  • Function MAKE-NODE (&key ((prev prev) nil) ((next next) nil) ((payload payload) nil))
  • Function INSERT-NEXT (link new)
  • Function INSERT-PREV (new link)
  • Function DETACH (link)
  • Function LINK (prev next)
  • Function ATTACH-NEXT (item next)
  • Function ATTACH-PREV (item next)
  • Function CIRCULAR (&optional (payload nil))
  • Macro DO-CIRCULAR-DOUBLY-LINKED-LIST ((object &optional (forward-p t)) start &body body)

sucle2

A very simple usage of application to open an OpenGL window with input

SUCLE2

  • Function START

text-subsystem

Draw a grid of characters with bold or underline really fast in OpenGL

TEXT-SUB

No exported symbols.

uncommon-lisp

Trivially convert from a struct form to an equivalent defclass

STRUCT-TO-CLOS

  • Macro STRUCT->CLASS ((defstruct name &body slots))

window

Stub .asd file for selecting the backend

No packages.