Giter Site home page Giter Site logo

cepl's Introduction

CEPL (Code Evaluate Play Loop) - [Beta]

CEPL is a lispy and REPL-friendly Common Lisp library for working with OpenGL.

Its definition of success is making the user feel that GPU programming has always been part of the languages standard.

The usual approach to using CEPL is to start it at the beginning of your Lisp session and leave it open for the duration of your work. You can then treat the window it creates as just another output for your graphics, analogous to how *standard-output* is treated for text.

CEPL is in beta. The API is close to what it needs to be but there are still many bugs to fix, features to add, and experiences to smooth out.

See the cepl.examples repository for some examples of how CEPL can be used

Videos: http://www.youtube.com/playlist?list=PL2VAYZE_4wRKKr5pJzfYD1w4tKCXARs5y

Installing

Run (ql:quickload :cepl) at your REPL.

Cloning

Whilst it is recommended to get CEPL from quicklisp, if you clone please note that master is not the stable branch. Please use release-quicklisp for the stable code that will be in the next CEPL release.

Documentation

Currently we have full documentation of every exported symbol in the CEPL package. You can find this here: CEPL API Docs

Guides will be provided in future, however these take much longer to write.

I can also be reached by my email (techsnuffle [at] gmail · com) and sometimes on #lispgames IRC. Come to #lispgames anyway though, there are some lovely folks, all lispy dialects welcome!

Requirements

All of the following will be downloaded automatically by quicklisp

  • cffi
  • cl-opengl
  • cl-plus-c
  • cl-ppcre
  • documentation-utils
  • ieee-floats
  • float-features
  • named-readtables
  • varjo
  • bordeaux-threads

C Library dependency

CEPL uses OpenGL ( version >= 3.1 ) so you need to make sure it is available on your machine. Installing your GPU drivers will usually handle this.

CEPL's Host

CEPL abstracts working with OpenGL but is not responsible for creating a window or GL context; this is handled by a Host. Right now the only supported host is SDL2; the system to load is called cepl.sdl2, you can find it here: cepl.sdl2

Getting Started

Note: On macOS, slime users will need to read docs/single-thread-swank.md to deal with a complication specific to projects interacting with the window manager. You can then follow the rest of this guide as usual.

To load CEPL and the default host (sdl2) do the following:

  • (ql:quickload :cepl.sdl2)
  • (cepl:repl)

You should see an empty window appear, OpenGL is now initialized, and you can use CEPL as you like.

Making a CEPL Project

The best way to get started is to make a new project that uses CEPL. Do the following in your REPL to get set up:

  • First, run (ql:quickload :cepl)
  • Then run (ql:quickload :quickproject). CEPL uses this to create a lisp project using its own templates
  • Then run (cepl:make-project "my-proj"). This will use quickproject to make a new project with all the correct dependencies. Remember that cepl does not handle window managers or input so by default your new project will use the following
  • cepl for the graphics
  • cepl.sdl2 for the host
  • skitter for handling input and events
  • dirt for loading images There are many good event systems & image loaders out there so browse around. But here are two :)

You are now ready to get started. Simply run:

  • (ql:quickload "my-proj")
  • (in-package :my-proj)
  • and finally (if you havent already) (cepl:repl)

Windows C Library Hack

If you are having issues getting the C libraries to load and just need to rule out whether Lisp can find them, try putting them in the same folder as the lisp exe. For example C:\Program Files\sbcl\.

CHANGELOG

This mainly covers features & news rather than individual bugfixes. When we are out of beta these will be covered more often

2019-05-05

  • Added #'clear-attachments
  • clear-fbo now let's you specify attachments to clear
  • Added with-outputs-to-attachments which lets you rebind which outputs from your pipelines map to which of the currently bound fbo attachments
  • Deprecated attachment-pattern in favor of color-attachments
  • Can now specify a discarded attachment in color-attachments with +discard-attachment+

2019-04-XX

  • stability work on with-context-state-restored. More coming to this soon.

2019-02-XX

  • Add #'default-fbo accessor

2019-01-20

  • Return from work crunch to add anisotropy support to samplers :)

2018-09-29

  • Added support for MultiDrawIndirect using multi-draw-g
  • Added support for base-vertex in buffer-streams

2018-08-10

  • wait-on-gpu-fence now expects an (unsigned-byte 64) or nil. nil is used to indicate no timeout and anything else is the timeout in nanoseconds
  • added copy-g as an more general alternative to push-g & pull-g for moving data.
  • exported the many typed functions copy-g, push-g & pull-g use behind the scenes for transfers
  • fixed serious bug in clear which, when passed no fbo, would try to clear both the read & draw fbo attachments. Now only clears draw as per the gl spec.
  • make-texture can now take gpu-arrays as the 'initial-contents' argument.
  • transfers between buffer & texture backed gpu arrays now work
  • c-arrays & gpu-arrays now accept a row-alignment value on creation. This defaults to 1 but can be 1, 2, 4 or 8
  • texture uploads/downloads now correctly take row alignment into account.
  • Fixes to ensure mutable textures are 'complete' on creation
  • fix issues when creating c-arrays from lisp arrays that stemed from specification of dimensions being (x-size y-size) in CEPL/GL and (column-size row-size) in lisp.

2018-07-15

  • added make-gpu-arrays-from-buffer-id which lets you speicify a gl buffer-id and layouts of the data and get a CEPL gpu-buffer in return
  • added make-gpu-array-from-buffer-id which in shorthand for the above when you only need one gpu-array.
  • added option to make-gpu-buffer-from-id so you can pass layouts instead of initial-contents. This is handy when you allocate and layout out the buffer storage without providing new data.
  • add a keep-data argument, to a bunch of buffer related functions which take layouts. This lets you create the buffer object, specifying the content layout without replacing the data.
  • added make-buffer-stream-from-id-and-layouts. Makes it possible to make streams out of vaos without having gpu-arrays.
  • print-object for gpu-buffers
  • misc bug fixes

2018-04-02

Headlines:

The most important change this release is that lambda pipelines now recompile when the functions they use as stages are recompiled. This change comes with a performance cost of course so if you wish to opt out of this (recommended for when you ship your project) then pass :static in the context argument to pipeline-g

Also if you are using GL>=4.3 you can now create empty fbos, which are handy if you want to use the fragment stage without writing data to bound textures (compute-type fun to be had here)

Other important changes:

  • viewport-resolution-x & viewport-resolution-y had been documented as returning single-floats but were returning unsigned ints, this now fixed.
  • I'm an idiot that didn't know about ~/.swank.lisp, please see the new 'single-thread-swank' advice above if running on macOS.

2018-02-17

BREAKING CHANGES

Due to the changes listed below you will now want to change your current asd's to require :rtg-math.vari and to change your packages to :use :rtg-math.

Some folks were asking for the ability to use their own math libraries rather than rtg-math which CEPL has depended on up until now. I have made this change but this means that this is something users will have to add themselves from now on.

For those picking a library cepl expects vectors & matrices to be sized simple-arrays of single-floats e.g. (make-array 3 :element-type 'single-float) for 3 component vectors.

We have also removed the dependency on fn & cl-fad.

Other Changes:

  • added the remove-surface function
  • closing primary window no longer quits cepl
  • removed interactive from lifecycle events (will add surface lifecycle events in future release)

2018-01-11

*I am terrible at changelogs. I am retroactively making the updates for everything between june 2017 and jan 2018

  • Added support for using gpu-lambdas inline in defpipeline-g forms
  • Lots of work on the cepl.tests project resulting in fixes for:
  • gpu-lambdas
  • lambda-pipelines
  • struct uniforms
  • uniform baking

2017-12-??

  • Add render-buffer support
  • Fix struct layout bugs. SSBOS work correctly now
  • Add funcall-g (limited support for calling gpu-functions from cpu directly)
  • Remove the deprecated g->, def-g-> & glambda macros

2017-11-??

  • Add compute support
  • Add SSBO support (though currently hobbled by struct layout bug)
  • Add single stage pipeline support
  • Add transform feedback support
  • Add shared context support
  • Add gpu-fence support
  • Add gl query support
  • Complete rewrite of pipeline state cache (now faster and safer)
  • Avoid recompilation of pipelines where dependencies have not changed
  • Rewrite struct code to get away from some dependencies

2017-10-??

  • Multiple (non-shared) context support

2017-09-??

  • Add border-color support

2017-08-??

  • Mostly bugfixes

2017-07-??

  • Add instance array support (per instance data in pipelines)
  • Add stencil support
  • Add scissor support
  • Add color-mask support
  • Add multisample support
  • renaming macros with confusing/inconsistent naming
  • blending param caching on context (not optimized yet)
  • Make #'free work with pipelines

2017-06-??

  • You can now modify a buffer-stream's primitive type after creation

  • experimental profiler

  • Huge improvements to per-frame performance through:

  • typing of functions & inlining where it made sense

  • fixing bug where uniforms ids queried too often

  • macros to reduce frequency of fetching the context object

  • much better state caching in context object

  • avoiding cffi enum conversion when lookup functions are faster

  • precompute & cache more size info in wrapper types

  • attachments have their own viewports, no more computing of viewport during draw

  • dont set viewport on every map-g (this was unnecessary)

  • remove some of the 'with-*' macros whos contract forced us to do more state changes/caching that we would otherwise like.

  • pipelines can be declared static. This tells cepl to type the generated functions.

  • a huge pile of other small changes

2017-06-04

  • pipelines can take :dynamic as their draw mode. This means they will take the draw-mode from the buffer-stream they are mapped over. This only works for pipelines with vertex & fragment stages.

  • buffer-streams now hold the primitive type of their data. Defaults to :triangles

  • Fix bug that was stopping g-structs contain matrices

  • Cache more values in buffer-stream to save time during rendering

  • Add surface-dimensions, surface-resolution, surface-title & surface-fullscreen-p

  • add adjust-gpu-array (pretty basic right now)

  • Remove cepl.spaces, It is now a seperate project (and will be in quicklisp in the next cycle)

  • Remove cepl.misc. If you were using the draw-texture function then please consider Nineveh (which will be in quicklisp in the next cycle)

  • make-project now uses dirt instead of devil. dirt uses cl-soil which ships with binaries for multiple paltforms so has a better 'out of the box' experience (plus also supports more formats)

2017-05-16

I missed some logs here so this is a recap of everything since 2017-02-19

  • Geometry & Tessellation fully supported (including for inline glsl stages)

  • Draw mode can now be specified for pipelines

  • fixes for pull-g with gpu-functions & pipelines

  • add with-gpu-array-range-as-pointer & with-gpu-array-range-as-c-array. These still feel experimental to me.

  • add reallocate-gpu-array & reallocate-buffer

  • buffer-streams always hold on to their gpu-arrays by default

  • Refactoring based on changes in Varjo

  • Added bordeux-threads as a dependency. Will be needed for some context related things

  • Very basic support for multiple surfaces (windows)

  • New 'host' api. Is versioned so old hosts are still supported

  • remove run-session. All of these attempts at thread hackery felt bad. I'm sticking with slime-style until we have a better fix

2017-02-19

  • Removed the continuable macro. The macro can be found in the livesupport project. Simply (ql:quickload :livesupport)

cepl's People

Contributors

benjamin-asdf avatar cbaggers avatar cpin avatar d4ryus avatar djeis97 avatar graysoncroom avatar jkordani avatar jobez avatar nja avatar puercopop avatar stacksmith avatar tsandstr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cepl's Issues

OpenGL signalled (1280 . INVALID-ENUM) from GET-STRING in (cepl:repl)

CEPL errors with backtrace

Steps to reproduce
I'm running on (arch) linux with sbcl. My gpu is AMD/ATI Richland's Radeon HD 8650G. I snuck a "core" in varjo's gen-shader-string and modified cepl-backend to request a context for OpenGL 3.3 core. I will attach diffs.

Crash description
Anyway, (cepl:repl) crashes with backtrace

OpenGL signalled (1280 . INVALID-ENUM) from GET-STRING.
[Condition of type CL-OPENGL-BINDINGS:OPENGL-ERROR]

Restarts:
0: [CONTINUE] Continue
1: [RETRY] Retry SLIME REPL evaluation request.
2: [*ABORT] Return to SLIME's top level.
3: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1004388033}>)

Backtrace:
0: (CL-OPENGL-BINDINGS:CHECK-ERROR #)
[No Locals]
1: (CEPL-GL:HAS-FEATURE "GL_ARB_texture_storage")
Locals:
SB-DEBUG::ARG-0 = "GL_ARB_texture_storage"
2: (CEPL-GL::TEXTURE-FEATURE-CHECK #)
[No Locals]
3: (CEPL.EVENTS::|context| #<CEPL.EVENTS:CONTEXT-CREATED {1003C0DFD3}>)
Locals:
SB-DEBUG::ARG-0 = #<CEPL.EVENTS:CONTEXT-CREATED {1003C0DFD3}>
4: (CEPL.EVENTS::|all-events| #<CEPL.EVENTS:CONTEXT-CREATED {1003C0DFD3}>)
Locals:
SB-DEBUG::ARG-0 = #<CEPL.EVENTS:CONTEXT-CREATED {1003C0DFD3}>
5: (CEPL:REPL 320 240 :SDL)
Locals:
BACKEND = :SDL
HEIGHT = 240
WIDTH = 320
6: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CEPL:REPL) #)
Locals:
SB-DEBUG::ARG-0 = (CEPL:REPL)
SB-DEBUG::ARG-1 = #
7: (EVAL (CEPL:REPL))
Locals:
SB-DEBUG::ARG-0 = (CEPL:REPL)
...

cepl.diff.txt
varjo.diff.txt
slime backtrace
lspci output

OpenGL signalled (1282 . INVALID-OPERATION) from ATTACH-SHADER.

CEPL> (ql:quickload :cepl)
To load "cepl":
  Load 1 ASDF system:
    cepl
; Loading "cepl"

(:CEPL)
CEPL> (ql:quickload :cepl-backend-sdl)
To load "cepl-backend-sdl":
  Load 1 ASDF system:
    cepl-backend-sdl
; Loading "cepl-backend-sdl"

(:CEPL-BACKEND-SDL)
CEPL> (cepl:repl)

"Setting default options" 
-----------------
    CEPL-REPL    
-----------------
NIL
CEPL> (in-package :cepl)
#<Package "CEPL">
;Compiling "e:/home/src/moving-triangles.lisp"...
CEPL> (run-loop)
; uploading (PROG-1 ...)

OpenGL signalled (1282 . INVALID-OPERATION) from ATTACH-SHADER.
   [Condition of type CL-OPENGL-BINDINGS:OPENGL-ERROR]

Restarts:
 0: [CONTINUE] Continue
 1: [CONTINUE] CEPL Continue
 2: [RETRY] Retry SLIME REPL evaluation request.
 3: [*ABORT] Return to SLIME's top level.
 4: [ABORT-BREAK] Reset this thread
 5: [ABORT] Kill this thread

Backtrace:
  0: (CL-OPENGL-BINDINGS:CHECK-ERROR CL-OPENGL-BINDINGS:ATTACH-SHADER)
  1: (CL-OPENGL-BINDINGS:ATTACH-SHADER 1 1)
  2: (CEPL-GL::LINK-SHADERS (1 2) 1 (#<VARJO::VARJO-COMPILE-RESULT #xE10FB2E> #<VARJO::VARJO-COMPILE-RESULT #xE101DEE>))
  3: (CEPL-GL::%COMPILE-LINK-AND-UPLOAD PROG-1 1 ((:VERTEX . VERT) (:FRAGMENT . FRAG)))
  4: (#:|init14979|)
  5: (PROG-1 #S(CEPL-GL::VERTEX-STREAM :VAO 1 :START 0 :LENGTH ...) :LOOP 0.004 :I 0.0)
  6: (STEP-DEMO)
  7: (RUN-LOOP)
  8: (CCL::CALL-CHECK-REGS RUN-LOOP)
  9: (CCL::CHEAP-EVAL (RUN-LOOP))
 10: (SWANK::EVAL-REGION "(run-loop)\n")
      Locals:
        STRING = "(run-loop)\n"
        STREAM = #<STRING-INPUT-STREAM  #xE081FB6>
        VALUES = NIL
        - = (RUN-LOOP)
        FORM = (RUN-LOOP)
 11: ((:INTERNAL SWANK-REPL::REPL-EVAL))
 12: (SWANK-REPL::TRACK-PACKAGE #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK-REPL::REPL-EVAL) #xE081FCE>)
 13: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK-REPL::REPL-EVAL) #xE08201E>)
 14: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK-REPL::REPL-EVAL) #xE082046>)
 15: (SWANK-REPL::REPL-EVAL "(run-loop)\n")
 16: (CCL::CALL-CHECK-REGS SWANK-REPL:LISTENER-EVAL "(run-loop)\n")
 17: (CCL::CHEAP-EVAL (SWANK-REPL:LISTENER-EVAL "(run-loop)\n"))
 18: (SWANK:EVAL-FOR-EMACS (SWANK-REPL:LISTENER-EVAL "(run-loop)\n") "CEPL" 53)
 19: (SWANK::PROCESS-REQUESTS NIL)
 20: ((:INTERNAL SWANK::HANDLE-REQUESTS))
 21: ((:INTERNAL SWANK::HANDLE-REQUESTS))
 22: (SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK #<Compiled-function SWANK:SWANK-DEBUGGER-HOOK #xC665B56> #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::HANDLE-REQUESTS) #xC79DEBE>)
 23: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #<SWANK/GRAY::SLIME-OUTPUT-STREAM #xC79A0DE>) (*STANDARD-INPUT* . #<SWANK/GRAY::SLIME-INPUT-STREAM #xC79A2EE>) ..))) #<CCL:COMPILED-LEXICAL-CLOSURE (:I..
 24: (SWANK::HANDLE-REQUESTS #<MULTITHREADED-CONNECTION #xC6BE22E> NIL)
 25: (CCL::RUN-PROCESS-INITIAL-FORM #<PROCESS repl-thread(12) [Active] #xC789C3E> (#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xC789AF6>))
 26: ((:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (CCL:PROCESS))) #<PROCESS repl-thread(12) [Active] #xC789C3E> (#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xC789AF6>))
 27: ((:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION))

Dependence on cee code.

Error compiling vertex-shader: 
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES



#version 330

layout(location = 0) in vec4 position;

uniform vec4 offset;
uniform int i;
uniform float loop;

vec4 calc_offset_8v(float i_5v, float loop_6v);

vec4 calc_offset_8v(float i_5v, float loop_6v) {
float i_7v = (i_5v / 2);
return vec4(sin((cos(i_7v) + loop_6v)),cos((tan(i_7v) + loop_6v)),0.0f,0.0f);
}

void main() {
gl_Position = (offset + (position + calc_offset_8v(float(i),loop)));
}
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [CONTINUE] CEPL Continue
 1: [RETRY] Retry SLIME REPL evaluation request.
 2: [*ABORT] Return to SLIME's top level.
 3: [ABORT] Abort thread (#<THREAD "repl-thread" RUNNING {100930B313}>)

Backtrace:
  0: (CEPL-GL::MAKE-SHADER :VERTEX-SHADER "#version 330 ..)
      Locals:
        SHADER-ID = 1
        SHADER-TYPE = :VERTEX-SHADER
        SOURCE-STRING = "#version 330\n\nlayout(location = 0) in vec4 position;\n\nuniform vec4 offset;\nuniform int i;\nuniform float loop;\n\nvec4 calc_offset_8v(float i_5v, float loop_6v);\n\nvec4 calc_offset_8v(float i_5..
  1: (CEPL-GL::%%-PROG-1)
      [No Locals]
  2: (PROG-1 #S(CEPL-GL::VERTEX-STREAM :VAO 1 :START 0 :LENGTH 3 :INDEX-TYPE NIL :MANAGED T) :OFFSET #(0.0 0.0 0.0 0.0) :I 0.0 :LOOP 0.01)
      Locals:
        #:I-DEFAULTING-TEMP = 0.0
        #:LOOP-DEFAULTING-TEMP = 0.01
        #:OFFSET-DEFAULTING-TEMP = #(0.0 0.0 0.0 0.0)
        STREAM = #S(CEPL-GL::VERTEX-STREAM :VAO 1 :START 0 :LENGTH 3 :INDEX-TYPE NIL :MANAGED T)
  3: (DRAW #S(CEPL-GL::VERTEX-STREAM :VAO 1 :START 0 :LENGTH 3 :INDEX-TYPE NIL :MANAGED T))
      Locals:
        SB-DEBUG::ARG-0 = #S(CEPL-GL::VERTEX-STREAM :VAO 1 :START 0 :LENGTH 3 :INDEX-TYPE NIL :MANAGED T)
  4: (RUN-DEMO)
      [No Locals]
  5: (SB-INT:SIMPLE-EVAL-IN-LEXENV (RUN-DEMO) #<NULL-LEXENV>)
      Locals:
        SB-DEBUG::ARG-0 = (RUN-DEMO)
        SB-DEBUG::ARG-1 = #<NULL-LEXENV>
  6: (EVAL (RUN-DEMO))
      Locals:
        SB-DEBUG::ARG-0 = (RUN-DEMO)
  7: (SWANK::EVAL-REGION "(run-demo) ..)
      Locals:
        SB-DEBUG::ARG-0 = "(run-demo)\n"
  8: ((LAMBDA NIL :IN SWANK::REPL-EVAL))
      [No Locals]
  9: (SWANK::TRACK-PACKAGE #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {100B758F1B}>)
      Locals:
        SB-DEBUG::ARG-0 = #<CLOSURE (LAMBDA () :IN SWANK::REPL-EVAL) {100B758F1B}>
 10: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {100B758E5B}>)
      Locals:
        SB-DEBUG::ARG-0 = "Retry SLIME REPL evaluation request."
        SB-DEBUG::ARG-1 = #<CLOSURE (LAMBDA () :IN SWANK::REPL-EVAL) {100B758E5B}>
 11: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {100B758E3B}>)
      Locals:
        SB-DEBUG::ARG-0 = NIL
        SB-DEBUG::ARG-1 = #<CLOSURE (LAMBDA () :IN SWANK::REPL-EVAL) {100B758E3B}>
 12: (SWANK::REPL-EVAL "(run-demo) ..)
      Locals:
        SB-DEBUG::ARG-0 = "(run-demo)\n"
 13: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:LISTENER-EVAL "(run-demo) ..)
      Locals:
        SB-DEBUG::ARG-0 = (SWANK:LISTENER-EVAL "(run-demo)\n")
        SB-DEBUG::ARG-1 = #<NULL-LEXENV>
 14: (EVAL (SWANK:LISTENER-EVAL "(run-demo) ..)
      Locals:
        SB-DEBUG::ARG-0 = (SWANK:LISTENER-EVAL "(run-demo)\n")
 15: (SWANK:EVAL-FOR-EMACS (SWANK:LISTENER-EVAL "(run-demo) ..)
      Locals:
        SB-DEBUG::ARG-0 = (SWANK:LISTENER-EVAL "(run-demo)\n")
        SB-DEBUG::ARG-1 = "CEPL"
        SB-DEBUG::ARG-2 = 2535
 16: (SWANK::PROCESS-REQUESTS NIL)
      Locals:
        SB-DEBUG::ARG-0 = NIL
 17: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
      [No Locals]
 18: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
      [No Locals]
 19: (SWANK-BACKEND::CALL-WITH-BREAK-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL :IN SWANK::HANDLE-REQUESTS) {10093100EB}>)
      Locals:
        CONTINUATION = #<CLOSURE (LAMBDA () :IN SWANK::HANDLE-REQUESTS) {10093100EB}>
        HOOK = #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK>
 20: ((FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/francis/quicklisp/dists/quicklisp/software/slime-2.5/swank-sbcl.lisp") #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL :IN SWANK::HA..
      Locals:
        SWANK-BACKEND::FUN = #<CLOSURE (LAMBDA () :IN SWANK::HANDLE-REQUESTS) {10093100EB}>
        SWANK-BACKEND::HOOK = #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK>
 21: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #1=#<SWANK-BACKEND::SLIME-OUTPUT-STREAM {10092EB8F3}>) (*STANDARD-INPUT* . #2=#<SWANK-BACKEND::SLIME-INPUT-STREAM {1005850003}>) (*TRACE-OUTPUT* . #1#)..
      Locals:
        SB-DEBUG::ARG-0 = ((*STANDARD-OUTPUT* . #<SWANK-BACKEND::SLIME-OUTPUT-STREAM {10092EB8F3}>) (*STANDARD-INPUT* . #<SWANK-BACKEND::SLIME-INPUT-STREAM {1005850003}>) ..)
        SB-DEBUG::ARG-1 = #<CLOSURE (LAMBDA () :IN SWANK::HANDLE-REQUESTS) {100931010B}>
 22: (SWANK::HANDLE-REQUESTS #<SWANK::MULTITHREADED-CONNECTION {1006F4FB73}> NIL)
      Locals:
        CONNECTION = #<SWANK::MULTITHREADED-CONNECTION {1006F4FB73}>
        TIMEOUT = NIL
 23: ((FLET #:WITHOUT-INTERRUPTS-BODY-1226 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
      [No Locals]
      Catch-tags:
        SB-THREAD::%RETURN-FROM-THREAD
 24: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
      [No Locals]
      Catch-tags:
        SB-THREAD::%ABORT-THREAD
        SB-IMPL::%END-OF-THE-WORLD
        SB-INT:TOPLEVEL-CATCHER
 25: ((FLET #:WITHOUT-INTERRUPTS-BODY-660 :IN SB-THREAD::CALL-WITH-MUTEX))
      [No Locals]
 26: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFE7DAEBAB}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THR..
      Locals:
        SB-DEBUG::ARG-0 = #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFE7DAEBAB}>
        SB-DEBUG::ARG-1 = #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THREAD "repl-thread" RUNNING {100930B313}>>
        SB-DEBUG::ARG-2 = NIL
        SB-DEBUG::ARG-3 = T
        SB-DEBUG::ARG-4 = NIL
 27: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "repl-thread" RUNNING {100930B313}> #S(SB-THREAD:SEMAPHORE :NAME "Thread setup semaphore" :%COUNT 0 :WAITCOUNT 0 :MUTEX #<SB-THREAD:MU..
      Locals:
        SB-DEBUG::ARG-0 = #<SB-THREAD:THREAD "repl-thread" RUNNING {100930B313}>
        SB-DEBUG::ARG-1 = #S(SB-THREAD:SEMAPHORE :NAME "Thread setup semaphore" :%COUNT 0 :WAITCOUNT 0 :MUTEX #<SB-THREAD:MUTEX (free) {100930B383}> :QUEUE #<SB-THREAD:WAITQUEUE  {100930B3B3}>)
        SB-DEBUG::ARG-2 = #<CLOSURE (LAMBDA () :IN SWANK::SPAWN-REPL-THREAD) {100930B29B}>
        SB-DEBUG::ARG-3 = NIL
        SB-DEBUG::ARG-4 = NIL
        SB-DEBUG::ARG-5 = NIL
        SB-DEBUG::ARG-6 = NIL
 28: ("foreign function: call_into_lisp")
      [No Locals]
 29: ("foreign function: new_thread_trampoline")
      [No Locals]

The error occurs when I attempt to run /examples/2.lisp. It's bubbling up from cl-opengl:compile-shader (ie, the underlying C code). I am, as far as I know, using the versions of everything as specified in cl-sdl2, varjo and cepl. (google "common lisp depend on a specific version of a C program") doesn't turn up a canonical way to go about this.

I currently don't understand the codebase well enough to say what should be done about the situation. (An asdf operation that indicates if you're running the supported versions of the required software? [Note: the UNIX program glxinfo appears to provide much of the information necessary for this])

Machine & Lisp information

{:os-info "Distributor ID:  Ubuntu
           Description: Ubuntu 13.10
           Release: 13.10
           Codename:    saucy"
:machine-type "X86-64"
:machine-version "Intel(R) Celeron(R) CPU B800 @ 1.50GHz"
:software-type "Linux"
:software-version "3.11.0-12-generic"
:lisp-implementation-type "SBCL"
:lisp-implementation-version "1.1.17.9-4e815e8"}

Bound is not *, a SINGLE-FLOAT or a list of a SINGLE-FLOAT: 3

Using http://ccl.clozure.com/ (1.10) on Windows 8.1

Additional Notes ;;; have not tested with SBCL yet. Originally used CLISP BUT moved to CCL as it better supports multi-threading on Windows.

CEPL> (ql:quickload :cepl-backend-sdl)
To load "cepl-backend-sdl":
Load 1 ASDF system:
cepl-backend-sdl
; Loading "cepl-backend-sdl"

Bound is not *, a SINGLE-FLOAT or a list of a SINGLE-FLOAT: 3
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [RETRY-COMPILE-FILE] Retry compiling #P"C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp"
 1: [SKIP-COMPILE-FILE] Skip compiling #P"C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp"
 2: [RETRY] Retry compiling #<CL-SOURCE-FILE "cepl" "core/events/event-classes">.
 3: [ACCEPT] Continue, treating compiling #<CL-SOURCE-FILE "cepl" "core/events/event-classes"> as having been successful.
 4: [RETRY] #<error printing RESTART #x445A166E>
 5: [CLEAR-CONFIGURATION-AND-RETRY] #<error printing RESTART #x445A1696>
 --more--

Backtrace:
  0: (CCL::VALUES-SPECIFIER-TYPE (SIMPLE-ARRAY (SINGLE-FLOAT 3)) #<CCL::LEXICAL-ENVIRONMENT #xE325B8E>)
  1: (CCL::SPECIFIER-TYPE (SIMPLE-ARRAY (SINGLE-FLOAT 3)) #<CCL::LEXICAL-ENVIRONMENT #xE325B8E>)
  2: ((:INTERNAL CCL::CANONICALIZE-SLOT-SPEC DEFCLASS) (VEC :INITARG :VEC :TYPE (SIMPLE-ARRAY (SINGLE-FLOAT 3))))
  3: (DEFCLASS (DEFCLASS MOUSE-SCROLL (CEPL.EVENTS::CEPL-EVENT) ((SOURCE-ID :INITARG :SOURCE-ID :INITFORM 0 :READER ...) (VEC :INITARG :VEC :TYPE (SIMPLE-ARRAY #)))) #<CCL::LEXICAL-ENVIRONMENT #xE325B8E>)
  4: (FUNCALL #<Compiled-function DEFCLASS Macroexpander #x484A346> (DEFCLASS MOUSE-SCROLL (CEPL.EVENTS::CEPL-EVENT) ..) #<CCL::LEXICAL-ENVIRONMENT #xE325B8E>)
  5: (MACROEXPAND-1 (DEFCLASS MOUSE-SCROLL (CEPL.EVENTS::CEPL-EVENT) ((SOURCE-ID :INITARG :SOURCE-ID :INITFORM 0 :READER ...) (VEC :INITARG :VEC :TYPE (SIMPLE-ARRAY #)))) #<CCL::LEXICAL-ENVIRONMENT #xE325B..
  6: (CCL::FCOMP-MACROEXPAND-1 (DEFCLASS MOUSE-SCROLL (CEPL.EVENTS::CEPL-EVENT) ((SOURCE-ID :INITARG :SOURCE-ID :INITFORM 0 :READER ...) (VEC :INITARG :VEC :TYPE (SIMPLE-ARRAY #)))) #<CCL::LEXICAL-ENVIRONM..
  7: (CCL::FCOMP-FORM-1 (DEFCLASS MOUSE-SCROLL (CEPL.EVENTS::CEPL-EVENT) ((SOURCE-ID :INITARG :SOURCE-ID :INITFORM 0 :READER ...) (VEC :INITARG :VEC :TYPE (SIMPLE-ARRAY #)))) #<CCL::LEXICAL-ENVIRONMENT #xE..
  8: (CCL::FCOMP-FORM (DEFCLASS MOUSE-SCROLL (CEPL.EVENTS::CEPL-EVENT) ((SOURCE-ID :INITARG :SOURCE-ID :INITFORM 0 :READER ...) (VEC :INITARG :VEC :TYPE (SIMPLE-ARRAY #)))) #<CCL::LEXICAL-ENVIRONMENT #xE32..
  9: (CCL::FCOMP-READ-LOOP "C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp" "C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp" 0 #<CCL::LEXICAL-ENVIRONMENT #xE..
 10: (CCL::FCOMP-FILE "C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp" "C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp" 0 #<CCL::LEXICAL-ENVIRONMENT #xE325B8..
 11: (CCL::%COMPILE-FILE "C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp" "C:/Users/Ay/AppData/Local/common-lisp/cache/ccl-1.10-f96-win-x86/C/quicklisp/local-projects/cepl-master/co..
 12: (COMPILE-FILE #P"C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp" :OUTPUT-FILE #P"C:/Users/Ay/AppData/Local/common-lisp/cache/ccl-1.10-f96-win-x86/C/quicklisp/local-projects/cep..
 13: (UIOP/UTILITY:CALL-WITH-MUFFLED-CONDITIONS #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL UIOP/LISP-BUILD:COMPILE-FILE*) #xE3221AE> NIL)
 14: (UIOP/PATHNAME:CALL-WITH-ENOUGH-PATHNAME #P"C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp" NIL #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL ..))
 15: (UIOP/LISP-BUILD:COMPILE-FILE* #P"C:/quicklisp/local-projects/cepl-master/core/events/event-classes.lisp" :OUTPUT-FILE #P"C:/Users/Ay/AppData/Local/common-lisp/cache/ccl-1.10-f96-win-x86/C/quicklisp/l..
 16: (FUNCALL #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL ASDF/LISP-ACTION:PERFORM-LISP-COMPILATION) #xE3222B6>)
 17: (ASDF/LISP-ACTION:PERFORM-LISP-COMPILATION #<COMPILE-OP > #<CL-SOURCE-FILE "cepl" "core/events/event-classes">)
 18: (CCL::%%BEFORE-AND-AFTER-COMBINED-METHOD-DCODE (NIL #<STANDARD-METHOD ASDF/ACTION:PERFORM (ASDF/LISP-ACTION:COMPILE-OP ASDF/LISP-ACTION:CL-SOURCE-FILE)> . 286516542))
 19: (CCL::%%STANDARD-COMBINED-METHOD-DCODE ((#<STANDARD-METHOD ASDF/ACTION:PERFORM :BEFORE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)>) ..))) 286516542)
 20: (NIL #<Unknown Arguments>)
 21: (CCL::%CALL-NEXT-METHOD (NIL #<STANDARD-METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS (T T)> . 286516583))
 22: (#<STANDARD-METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)> #<COMPILE-OP > #<CL-SOURCE-FILE "cepl" "core/events/event-classes">)
 23: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<STANDARD-METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)> #<STANDARD-METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS (T T)>) 286516583)
 24: (NIL #<Unknown Arguments>)
 25: (#<STANDARD-METHOD ASDF/PLAN:PERFORM-PLAN (LIST)> ((#<COMPILE-OP > . #<SYSTEM "alexandria">) (#<PREPARE-OP > . #<SYSTEM "uiop">) (#<COMPILE-OP > . #<SYSTEM "uiop">) ..))) :FORCE NIL)
 26: (CCL::%CALL-NEXT-METHOD (NIL #<STANDARD-METHOD ASDF/PLAN:PERFORM-PLAN (LIST)> . 286516644))
 27: (CCL::CALL-WITH-COMPILATION-UNIT #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::WITH-COMPILATION-UNIT-BODY (ASDF/PLAN:PERFORM-PLAN :AROUND (T))) #x445A148E> :OVERRIDE NIL)
 28: (#<STANDARD-METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)> ((#<COMPILE-OP > . #<SYSTEM "alexandria">) (#<PREPARE-OP > . #<SYSTEM "uiop">) (#<COMPILE-OP > . #<SYSTEM "uiop">) ..))))
 29: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<STANDARD-METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)> #<STANDARD-METHOD ASDF/PLAN:PERFORM-PLAN (LIST)>) 286516644)
 30: (NIL #<Unknown Arguments>)
 31: (CCL::%CALL-NEXT-METHOD (NIL #<STANDARD-METHOD ASDF/PLAN:PERFORM-PLAN (T)> . 286516697))
 32: (CCL::CALL-WITH-COMPILATION-UNIT #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::WITH-COMPILATION-UNIT-BODY (ASDF/PLAN:PERFORM-PLAN :AROUND (T))) #x445A151E> :OVERRIDE NIL)
 33: (#<STANDARD-METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)> #<ASDF/PLAN:SEQUENTIAL-PLAN #xE26B68E>)
 34: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<STANDARD-METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)> #<STANDARD-METHOD ASDF/PLAN:PERFORM-PLAN (T)>) 286516697)
 35: (NIL #<Unknown Arguments>)
 36: (#<STANDARD-METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)> #<LOAD-OP :VERBOSE NIL> #<SYSTEM "cepl-backend-sdl"> :VERBOSE NIL)
 37: (CCL::%CALL-NEXT-METHOD ((NIL) #<STANDARD-METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)> #<LOAD-OP :VERBOSE NIL> #<SYSTEM "cepl-backend-sdl"> :VERBOSE NIL))
 38: ((:INTERNAL (ASDF/OPERATE:OPERATE :AROUND (T T))))
 39: (#<STANDARD-METHOD ASDF/OPERATE:OPERATE :AROUND (T T)> #<LOAD-OP :VERBOSE NIL> #<SYSTEM "cepl-backend-sdl"> :VERBOSE NIL)
 40: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<STANDARD-METHOD ASDF/OPERATE:OPERATE :AROUND (T T)> (#<STANDARD-METHOD ASDF/OPERATE:OPERATE :BEFORE #> #<#>) NIL ..))) 286516769)
 41: (NIL #<Unknown Arguments>)
 42: (CCL::%CALL-NEXT-METHOD ((NIL) #<STANDARD-METHOD ASDF/OPERATE:OPERATE (SYMBOL T)> ASDF/LISP-ACTION:LOAD-OP "cepl-backend-sdl" :VERBOSE NIL))
 43: ((:INTERNAL (ASDF/OPERATE:OPERATE :AROUND (T T))))
 44: (ASDF/CACHE:CALL-WITH-ASDF-CACHE #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL (ASDF/OPERATE:OPERATE :AROUND (T T))) #xE26BA7E> :OVERRIDE NIL :KEY NIL)
 45: (#<STANDARD-METHOD ASDF/OPERATE:OPERATE :AROUND (T T)> ASDF/LISP-ACTION:LOAD-OP "cepl-backend-sdl" :VERBOSE NIL)
 46: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<STANDARD-METHOD ASDF/OPERATE:OPERATE :AROUND (T T)> (#<STANDARD-METHOD ASDF/OPERATE:OPERATE :BEFORE #>) NIL ..) 286516852)
 47: (NIL #<Unknown Arguments>)
 48: (#<STANDARD-METHOD ASDF/OPERATE:OPERATE :AROUND (T T)> ASDF/LISP-ACTION:LOAD-OP "cepl-backend-sdl" :VERBOSE NIL)
 49: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<STANDARD-METHOD ASDF/OPERATE:OPERATE :AROUND (T T)> (#<STANDARD-METHOD ASDF/OPERATE:OPERATE :BEFORE #>) NIL ..) 286516887)
 50: (NIL #<Unknown Arguments>)
 51: (QUICKLISP-CLIENT::CALL-WITH-MACROEXPAND-PROGRESS #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL QUICKLISP-CLIENT::APPLY-LOAD-STRATEGY) #xE269B5E>)
 52: (QUICKLISP-CLIENT::AUTOLOAD-SYSTEM-AND-DEPENDENCIES "cepl-backend-sdl" :PROMPT NIL)
 53: (#<STANDARD-METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION (T T)> #<QL-IMPL:CCL #xC45DFE6> #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL QUICKLISP-CLIENT::QL ..))
 54: (#<STANDARD-METHOD QUICKLISP-CLIENT:QUICKLOAD (T)> (:CEPL-BACKEND-SDL) :PROMPT NIL :SILENT NIL :VERBOSE NIL)
 55: (CCL::%CALL-NEXT-METHOD ((NIL) #<STANDARD-METHOD QUICKLISP-CLIENT:QUICKLOAD (T)> :CEPL-BACKEND-SDL))
 56: (QL-DIST::CALL-WITH-CONSISTENT-DISTS #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL (QUICKLISP-CLIENT:QUICKLOAD :AROUND (T))) #xE26A95E>)
 57: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<STANDARD-METHOD QUICKLISP-CLIENT:QUICKLOAD :AROUND (T)> #<STANDARD-METHOD QUICKLISP-CLIENT:QUICKLOAD (T)>) 286516999)
 58: (NIL #<Unknown Arguments>)
 59: (CCL::CALL-CHECK-REGS QUICKLISP-CLIENT:QUICKLOAD :CEPL-BACKEND-SDL)
 60: (CCL::CHEAP-EVAL (QUICKLISP-CLIENT:QUICKLOAD :CEPL-BACKEND-SDL))
      Locals:
        FORM = (QUICKLISP-CLIENT:QUICKLOAD :CEPL-BACKEND-SDL)
        *NX-SOURCE-NOTE-MAP* = NIL
 61: (SWANK::EVAL-REGION "(ql:quickload :cepl-backend-sdl)\n")
 62: ((:INTERNAL SWANK-REPL::REPL-EVAL))
 63: (SWANK-REPL::TRACK-PACKAGE #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK-REPL::REPL-EVAL) #xE26AAAE>)
 64: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK-REPL::REPL-EVAL) #xE26AAFE>)
 65: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK-REPL::REPL-EVAL) #xE26AB26>)
 66: (SWANK-REPL::REPL-EVAL "(ql:quickload :cepl-backend-sdl)\n")
 67: (CCL::CALL-CHECK-REGS SWANK-REPL:LISTENER-EVAL "(ql:quickload :cepl-backend-sdl)\n")
 68: (CCL::CHEAP-EVAL (SWANK-REPL:LISTENER-EVAL "(ql:quickload :cepl-backend-sdl)\n"))
 69: (SWANK:EVAL-FOR-EMACS (SWANK-REPL:LISTENER-EVAL "(ql:quickload :cepl-backend-sdl)\n") "CEPL" 22)
 70: (SWANK::PROCESS-REQUESTS NIL)
 71: ((:INTERNAL SWANK::HANDLE-REQUESTS))
 72: ((:INTERNAL SWANK::HANDLE-REQUESTS))
 73: (SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK #<Compiled-function SWANK:SWANK-DEBUGGER-HOOK #xC6A840E> #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::HANDLE-REQUESTS) #xC7EB1DE>)
 74: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #<SWANK/GRAY::SLIME-OUTPUT-STREAM #xC7DE4BE>) (*STANDARD-INPUT* . #<SWANK/GRAY::SLIME-INPUT-STREAM #xC7DE6CE>) ..))) #<CCL:COMPILED-LEXICAL-CLOSURE (:I..
 75: (SWANK::HANDLE-REQUESTS #<MULTITHREADED-CONNECTION #xC700B76> NIL)
 76: (CCL::RUN-PROCESS-INITIAL-FORM #<PROCESS repl-thread(12) [Active] #xC7DE8C6> (#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xC7DE77E>))
 77: ((:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (CCL:PROCESS))) #<PROCESS repl-thread(12) [Active] #xC7DE8C6> (#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xC7DE77E>))
 78: ((:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION))

x is not list

(defun-g test ()
  (let ((x (v! 0 0 0 0)))
    x))

Ugh this is a dumb bug which is the fault of the 'external function finder'
we NEED a better solution for that

Example 1b Compilation fails

Hi,
I'm trying to run the example with sbcl and sdl2 from the Ubuntu 13.10 repository. When I compile it I get the following error. Example 1 does not work either

CL-USER> (ql:quickload :cepl)
To load "cepl":
Load 1 ASDF system:
cepl
; Loading "cepl"
...................
(:CEPL)

CL-USER> (cepl:repl)

CEPL-REPL    

NIL
CEPL>
; compiling file "~/quicklisp/local-projects/cepl/examples/1b.lisp" (written 22 MAR 2014 11:42:59 AM):

; file: ~/quicklisp/local-projects/cepl/examples/1b.lisp
; in: DEFPIPELINE PROG-1
; ((VERT VERT-DATA))
;
; caught ERROR:
; illegal function call

; (LET ((LERP-VALUE (/ (Y GL-FRAG-COORD) 500.0)))
; (OUT OUTPUTCOLOR (MIX THE-COLOR (VEC4 0.2 0.2 0.2 1.0) LERP-VALUE)))
;
; note: deleting unreachable code

; (:FRAGMENT
; (LET ((LERP-VALUE (/ # 500.0)))
; (OUT OUTPUTCOLOR (MIX THE-COLOR (VEC4 0.2 0.2 0.2 1.0) LERP-VALUE))))
;
; note: deleting unreachable code

; (POS VERT)
;
; note: deleting unreachable code

;
; caught ERROR:
; READ error during COMPILE-FILE:
;
; Symbol "COLLECT-EVENT-TYPES" not found in the SDL2 package.
;
; Line: 27, Column: 52, File-Position: 1090
;
; Stream: #<SB-SYS:FD-STREAM
; for "file /home/jonas/quicklisp/local-projects/cepl/examples/1b.lisp"
; {1004CE2603}>
;
; compilation unit aborted
; caught 1 fatal ERROR condition
; caught 2 ERROR conditions
; printed 3 notes
; compilation aborted after 0:00:00.015

5 compiler notes:

/home/jonas/quicklisp/local-projects/cepl/examples/1b.lisp:228
error: illegal function call

/home/jonas/quicklisp/local-projects/cepl/examples/1b.lisp:350
note: deleting unreachable code

/home/jonas/quicklisp/local-projects/cepl/examples/1b.lisp:339
note: deleting unreachable code

/home/jonas/quicklisp/local-projects/cepl/examples/1b.lisp:276
note: deleting unreachable code

/home/jonas/quicklisp/local-projects/cepl/examples/1b.lisp:1091
read-error: READ error during COMPILE-FILE:

Symbol "COLLECT-EVENT-TYPES" not found in the SDL2 package.

Line: 27, Column: 52, File-Position: 1090

Stream: #<SB-SYS:FD-STREAM
          for "file /home/jonas/quicklisp/local-projects/cepl/examples/1b.lisp"
          {1004CE2603}>

Making rectangle

I have very little experience with "modern opengl" and it's kind of long time time but if I take your triangle.lisp and add one point more to the vertices shouldn't it draw rectangle?

(make-gpu-array (list 
(v! -1 -1 0) (v! 1 0 0 1)
(v! -1 0 0) (v! 1 0 0 1)
(v! 0 0 0) (v! 1 0 0 1)
(v! 0 -1 0) (v! 1 0 0 1))
:dimensions 4 :element-type 'pos-col)

For me that draws only triangle, I also tried doing it using indices like in the basic-3d-objects.lisp but either it did not draw anything or it draw just triangle.

Maybe I'm just doing it wrong?

Also you could add small paragraph in the README to explain what your math functions do.
Some are kind of clear but for example this from moving-triangles.lisp

(s~ position :xyz)

It returns array of first 3 values of position but looks kind of spooky.

matrix math library suggestion

Hi

Not sure if you have checked this out before but there is a matrix math library available called sb-cga.

While you own implementation are more than likely spot on the sb-cga library has the interesting property of making use of some low level SSE optimization when used with SBCL.

The library is available here https://github.com/nikodemus/sb-cga and via quicklisp.

It does have some draw backs though; it supports only vec3 and mat4x4 and only floats.

But might be worth checking out if you are interested in low level optimisation.

Cheers,

OpenGL signalled (1282 . INVALID-OPERATION) from BUFFER-DATA.

Might be of importance, I had to run (cepl:repl) twice before the 'CEPL REPL' window displayed.
Also, not mentioned in the 'Running Example steps', had to run (ql:quickload :cepl-backend-sdl) before calling (cepl:repl)

CL-USER> (ql:quickload :cepl-backend-sdl)
To load "cepl-backend-sdl":
  Load 1 ASDF system:
    cepl-backend-sdl
; Loading "cepl-backend-sdl"

(:CEPL-BACKEND-SDL)
CL-USER> (cepl:repl)

"Setting default options" 
-----------------
    CEPL-REPL    
-----------------
NIL
CL-USER> (cepl:repl)

"Setting default options" 
-----------------
    CEPL-REPL    
-----------------
NIL
CL-USER> (in-package :cepl)
#<Package "CEPL">
;Compiling "e:/home/src/triangles.lisp"...
CEPL> (run-loop)
OpenGL signalled (1282 . INVALID-OPERATION) from BUFFER-DATA.
   [Condition of type CL-OPENGL-BINDINGS:OPENGL-ERROR]

Restarts:
 0: [CONTINUE] Continue
 1: [RETRY] Retry SLIME REPL evaluation request.
 2: [*ABORT] Return to SLIME's top level.
 3: [ABORT-BREAK] Reset this thread
 4: [ABORT] Kill this thread

Backtrace:
  0: (CL-OPENGL-BINDINGS:CHECK-ERROR CL-OPENGL-BINDINGS:BUFFER-DATA)
  1: (CL-OPENGL-BINDINGS:BUFFER-DATA :ARRAY-BUFFER 84 #<A Foreign Pointer #x1FB0440> :STATIC-DRAW)
  2: (BUFFER-DATA-RAW #<A Foreign Pointer #x1FB0440> POS-COL 84 #S(CEPL-GL::GLBUFFER :BUFFER-ID 1 :FORMAT NIL :MANAGED ...) :ARRAY-BUFFER :STATIC-DRAW 0)
  3: (#<STANDARD-METHOD MAKE-GPU-ARRAY (CEPL-GL::C-ARRAY)> #<C-ARRAY :element-type POS-COL :dimensions (3)> :ACCESS-STYLE :STATIC-DRAW)
  4: (CCL::%%CHECK-KEYWORDS #(1 #(:ALIGNMENT :ELEMENT-TYPE :DIMENSIONS :ACCESS-STYLE) #<CCL:METHOD-FUNCTION MAKE-GPU-ARRAY (CEPL-GL::C-ARRAY)>) 286566115)
  5: (NIL #<Unknown Arguments>)
  6: (#<STANDARD-METHOD MAKE-GPU-ARRAY (T)> ((#(0.5 -0.36 0.0) #(0.0 1.0 0.0 1.0)) (#(0.0 0.5 0.0) #(1.0 0.0 0.0 1.0)) (#(-0.5 -0.36 0.0) #(0.0 0.0 1.0 1.0))) :DIMENSIONS NIL :ELEMENT-TYPE POS-COL :ACCESS-..
  7: (CCL::%%CHECK-KEYWORDS #(1 #(:ALIGNMENT :ACCESS-STYLE :ELEMENT-TYPE :DIMENSIONS) #<CCL:METHOD-FUNCTION MAKE-GPU-ARRAY (T)>) 286566147)
  8: (NIL #<Unknown Arguments>)
  9: (RUN-LOOP)
 10: (CCL::CALL-CHECK-REGS RUN-LOOP)
 11: (CCL::CHEAP-EVAL (RUN-LOOP))
 12: (SWANK::EVAL-REGION "(run-loop)\n")
      Locals:
        STRING = "(run-loop)\n"
        STREAM = #<STRING-INPUT-STREAM  #xDAE42A6>
        VALUES = NIL
        - = (RUN-LOOP)
        FORM = (RUN-LOOP)
 13: ((:INTERNAL SWANK-REPL::REPL-EVAL))
 14: (SWANK-REPL::TRACK-PACKAGE #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK-REPL::REPL-EVAL) #xDAE42BE>)
 15: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK-REPL::REPL-EVAL) #xDAE430E>)
 16: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK-REPL::REPL-EVAL) #xDAE4336>)
 17: (SWANK-REPL::REPL-EVAL "(run-loop)\n")
 18: (CCL::CALL-CHECK-REGS SWANK-REPL:LISTENER-EVAL "(run-loop)\n")
 19: (CCL::CHEAP-EVAL (SWANK-REPL:LISTENER-EVAL "(run-loop)\n"))
 20: (SWANK:EVAL-FOR-EMACS (SWANK-REPL:LISTENER-EVAL "(run-loop)\n") "CEPL" 17)
 21: (SWANK::PROCESS-REQUESTS NIL)
 22: ((:INTERNAL SWANK::HANDLE-REQUESTS))
 23: ((:INTERNAL SWANK::HANDLE-REQUESTS))
 24: (SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK #<Compiled-function SWANK:SWANK-DEBUGGER-HOOK #xC672A66> #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::HANDLE-REQUESTS) #xC7A285E>)
 25: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #<SWANK/GRAY::SLIME-OUTPUT-STREAM #xC796796>) (*STANDARD-INPUT* . #<SWANK/GRAY::SLIME-INPUT-STREAM #xC7969A6>) ..))) #<CCL:COMPILED-LEXICAL-CLOSURE (:I..
 26: (SWANK::HANDLE-REQUESTS #<MULTITHREADED-CONNECTION #xC6BA676> NIL)
 27: (CCL::RUN-PROCESS-INITIAL-FORM #<PROCESS repl-thread(12) [Active] #xC796B9E> (#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xC796A56>))
 28: ((:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (CCL:PROCESS))) #<PROCESS repl-thread(12) [Active] #xC796B9E> (#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xC796A56>))
 29: ((:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION))

Inline glsl shader stages

A request from a user, to address the fact that cepl doesnt support everything yet and so being able to drop in a glsl shader and have it just work would be useful.

Reader error: No external symbol named "OBSERVE" in package #<Package "CEPL.EVENTS"> .

Updated to latest cepl, varjo and traingles.lisp. Cleaned out cached build and recompiled after getting latest...

; SLIME 2015-02-19
CL-USER> (ql:quickload :cepl)
To load "cepl":
  Load 1 ASDF system:
    cepl
; Loading "cepl"
..................................................
[package varjo]...................................
..................................................
..................................................
[package temporal-functions]......................
[package tiny-time-manager].......................
[package cepl-generics]...........................
[package cepl-backend]............................
[package cepl-utils]..............................
[package base-maths]..............................
[package maths]...................................
[package base-vectors]............................
[package base-matrices]...........................
[package vector2].................................
[package vector3].................................
[package vector4].................................
[package vectors].................................
[package matrix3].................................
[package matrix4].................................
[package matrices]................................
[package quaternions].............................
[package projection]..............................
[package base-space]..............................
[package %cgl]....................................
[package cepl-gl].................................
[package varjo-bridge-types]......................
[package cepl-camera].............................
[package primitives]..............................
[package tools]...................................
[package cepl.events].............................
[package live]....................................
[package cepl]....................................
..................................................
..................................................
..................................................
..................................................
..................................................
.....
(:CEPL)
CL-USER> (ql:quickload :cepl-backend-sdl) 
To load "cepl-backend-sdl":
  Load 1 ASDF system:
    cepl-backend-sdl
; Loading "cepl-backend-sdl"
[package cepl.events.sdl].........
(:CEPL-BACKEND-SDL)
CL-USER> (cepl:repl)

"Setting default options" 
-----------------
    CEPL-REPL    
-----------------
NIL
CL-USER> (in-package :cepl)
#<Package "CEPL">
;Compiling "e:/home/src/triangles.lisp"...
Read error between positions 1032 and 1049 in e:/home/src/triangles.lisp.
CEPL> 
Reader error: No external symbol named "OBSERVE" in package #<Package "CEPL.EVENTS"> .
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [CONTINUE] Create and use the internal symbol CEPL.EVENTS::OBSERVE
 1: [RETRY-COMPILE-FILE] Retry compiling #P"e:/home/src/triangles.lisp"
 2: [SKIP-COMPILE-FILE] Skip compiling #P"e:/home/src/triangles.lisp"
 3: [ABORT] Abort compilation.
 4: [*ABORT] Return to SLIME's top level.
 5: [ABORT-BREAK] Reset this thread
 --more--

Backtrace:
  0: (CCL::%PARSE-TOKEN #<BASIC-FILE-CHARACTER-INPUT-STREAM ("e:/home/src/triangles.lisp"/5024 UTF-8) #xDB0C27E> #\e (NIL))
  1: (CCL::%PARSE-EXPRESSION #<BASIC-FILE-CHARACTER-INPUT-STREAM ("e:/home/src/triangles.lisp"/5024 UTF-8) #xDB0C27E> #\e (NIL))
  2: (CCL::%READ-LIST-EXPRESSION #<BASIC-FILE-CHARACTER-INPUT-STREAM ("e:/home/src/triangles.lisp"/5024 UTF-8) #xDB0C27E> (NIL) #\))
  3: (CCL::READ-LIST #<BASIC-FILE-CHARACTER-INPUT-STREAM ("e:/home/src/triangles.lisp"/5024 UTF-8) #xDB0C27E> NIL #\))
  4: (CCL::%PARSE-EXPRESSION #<BASIC-FILE-CHARACTER-INPUT-STREAM ("e:/home/src/triangles.lisp"/5024 UTF-8) #xDB0C27E> #\( NIL)
  5: (CCL::%READ-FORM #<BASIC-FILE-CHARACTER-INPUT-STREAM ("e:/home/src/triangles.lisp"/5024 UTF-8) #xDB0C27E> NIL (NIL))
  6: (CCL::READ-INTERNAL #<BASIC-FILE-CHARACTER-INPUT-STREAM ("e:/home/src/triangles.lisp"/5024 UTF-8) #xDB0C27E> NIL (NIL) NIL)
  7: (CCL::READ-RECORDING-SOURCE #<BASIC-FILE-CHARACTER-INPUT-STREAM ("e:/home/src/triangles.lisp"/5024 UTF-8) #xDB0C27E> :EOFVAL (NIL) :FILE-NAME "e:/home/src/triangles.lisp" :START-OFFSET 0 :MAP #<HASH-T..
  8: (CCL::FCOMP-READ-LOOP "e:/home/src/triangles.lisp" "e:/home/src/triangles.lisp" 0 #<CCL::LEXICAL-ENVIRONMENT #xDB0C6BE> :NOT-COMPILE-TIME)
  9: (CCL::FCOMP-FILE "e:/home/src/triangles.lisp" "e:/home/src/triangles.lisp" 0 #<CCL::LEXICAL-ENVIRONMENT #xDB0C6BE>)
 10: (CCL::%COMPILE-FILE "e:/home/src/triangles.lisp" "e:/home/src/triangles.wx32fsl" T NIL T T NIL T :DEFER NIL #<BACKEND WIN32 #xC0E39D6> :DEFAULT NIL 0)
 11: (COMPILE-FILE #P"e:/home/src/triangles.lisp" :OUTPUT-FILE #P"e:/home/src/triangles.wx32fsl" :VERBOSE T :PRINT NIL :LOAD NIL :FEATURES NIL :TARGET :WIN32 :SAVE-LOCAL-SYMBOLS T :SAVE-DOC-STRINGS T :SAVE..
 12: (SWANK/BACKEND:CALL-WITH-COMPILATION-HOOKS #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK/BACKEND:SWANK-COMPILE-FILE) #xDB0C986>)
      Locals:
        FUNCTION = #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK/BACKEND:SWANK-COMPILE-FILE) #xDB0C986>
        #:G12351 = (CCL:COMPILER-WARNING SWANK/CCL::HANDLE-COMPILER-WARNING)
        CCL::%HANDLERS% = ((CCL:COMPILER-WARNING SWANK/CCL::HANDLE-COMPILER-WARNING) (SWANK/BACKEND:COMPILER-CONDITION #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::COLLECT-NOTES) #xDB0CB46>) ..)))
        CCL:*MERGE-COMPILER-WARNINGS* = NIL
 13: (SWANK::SWANK-COMPILE-FILE* #P"e:/home/src/triangles.lisp" T)
 14: ((:INTERNAL SWANK:COMPILE-FILE-FOR-EMACS))
 15: ((:INTERNAL SWANK::COLLECT-NOTES))
 16: (SWANK::MEASURE-TIME-INTERVAL #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::COLLECT-NOTES) #xDB0CB1E>)
 17: (SWANK::COLLECT-NOTES #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK:COMPILE-FILE-FOR-EMACS) #xDB0CB76>)
 18: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK:COMPILE-FILE-FOR-EMACS) #xDB0CBA6>)
 19: (CCL::CALL-CHECK-REGS SWANK:COMPILE-FILE-FOR-EMACS "e:\\home\\src\\triangles.lisp" T)
 20: (CCL::CHEAP-EVAL (SWANK:COMPILE-FILE-FOR-EMACS "e:\\home\\src\\triangles.lisp" T))
 21: (SWANK:EVAL-FOR-EMACS (SWANK:COMPILE-FILE-FOR-EMACS "e:\\home\\src\\triangles.lisp" T) ":cepl" 10)
 22: ((:INTERNAL SWANK::SPAWN-WORKER-THREAD))
 23: (SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK #<Compiled-function SWANK:SWANK-DEBUGGER-HOOK #xC667AEE> #<Compiled-function (:INTERNAL SWANK::SPAWN-WORKER-THREAD) (Non-Global)  #xC63E736>)
 24: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #<SWANK/GRAY::SLIME-OUTPUT-STREAM #xC796F7E>) (*STANDARD-INPUT* . #<SWANK/GRAY::SLIME-INPUT-STREAM #xC79718E>) ..))) #<CCL:COMPILED-LEXICAL-CLOSURE (:I..
 25: ((:INTERNAL SWANK::SPAWN-WORKER-THREAD))
 26: (CCL::RUN-PROCESS-INITIAL-FORM #<PROCESS worker(14) [Active] #xDB090F6> (#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xDB08FAE>))
 27: ((:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (CCL:PROCESS))) #<PROCESS worker(14) [Active] #xDB090F6> (#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xDB08FAE>))
 28: ((:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION))

Problem with non-square texture

The following program produces this error:

*** Error in `sbcl': malloc(): memory corruption: 0x0000000000745430 ***
*** Error in `sbcl': malloc(): memory corruption: 0x0000000000745430 ***

When the texture is square, the program works as expected (displays a quad with a texture).

;;(ql:quickload :cepl-default)
;;(cepl:repl)

(in-package :cepl)



(defparameter *count* 0.0)
(defparameter *texture* nil)
(defparameter *v-stream* nil)

(defun-g tex-vert ((vert g-pt))
  (values (v! (pos vert) 1)
          (:smooth (tex vert))))

(defun-g tex-frag ((tex-coord :vec2) &uniform (texture :sampler-2d)
                   (count :float) (pos-offset :vec4))
  (let* ((rip-size 0.02) (centre (v! 0.0 0.0)) (damp 0.6)
         (peaks 9.0)
         (dif (- tex-coord centre))
         (dist (dot dif dif))
         (height (/ (+ (cos (+ count (* dist peaks)))
                       (sin (- count (* (y tex-coord) peaks))))
                    2.0))
         (rip-offset (* (* (normalize dif) rip-size) height damp)))
    (+ (texture texture (+ rip-offset tex-coord))
       (v! (* -0.2 height) (* -0.2 height) 0.0 0.0))))

(defpipeline ripple-with-wobble () (g-> #'tex-vert #'tex-frag))

(defun step-demo ()
  (evt:pump-events)
  (update-swank)
  (gl:clear-color 0 0 0 1)
  (gl:clear :color-buffer-bit :depth-buffer-bit)
  (map-g #'ripple-with-wobble *v-stream*
        :texture *texture* :count *count* :pos-offset (v! 0 0 0 0))
  (incf *count* 0.08)
  (update-display))

(let ((running nil))
  (defun run-loop ()
    (setf running t)
    (let* ((img-data (loop :for i :below 128 :collect
                        (loop :for j :below 64 :collect (random 254))))
           (indicies (make-gpu-array '(2 3 0  0 1 2)
                                     :dimensions (* 2 3) :element-type :unsigned-short)))
      (setf *v-stream*
            (make-buffer-stream
             (make-gpu-array `((,(v! -0.5 -0.5 0) ,(v! -1  -1))
                               (,(v!  0.5 -0.5 0) ,(v!  1  -1))
                               (,(v!  0.5  0.5 0) ,(v!  1   1))
                               (,(v! -0.5  0.5 0) ,(v! -1   1)))
                             :dimensions 4 :element-type 'g-pt)
              :index-array indicies
             :retain-arrays t))
      (setf *texture* (with-c-array
                          (temp (make-c-array img-data :dimensions '(128 64)
                                              :element-type :ushort))
                        (make-texture temp)))
      (loop :while running :do (continuable (step-demo)))))
  (defun stop-loop () (setf running nil)))

(evt:def-event-listener sys-listener (e :sys)
  (when (typep e 'evt:will-quit) (stop-loop)))

#+nil
(run-loop)

validate undefine-gpu-function

Is there any more cleanup, or lisp side undefining that can be done?
Do we have good error messages for using an undefined function?

When this is understood add to public api

utils-kt on osx ccl

I'm under the impression that you've been using cepl on osx and ccl occasionally, and I was trying to figure out how you modified utils-kt to work. a read macro seems to disable utils-kt from working on ccl in the utils-kt.asd, but there is other weirdness that follows, and my build machine was recently wiped so I'd lost whatever work I'd done to make this project and cepl work together. Any thoughts?

swank not starting on OSX using sbcl and libIL issue

Swank does not start automatically when launching platform-specific/osx-sbcl-launch.sh but can I can start it manually using:

(swank:create-server :port 4005)

After installing sdl2, devil and assimp using hombrew I get the following error when running:

(ql:quickload :cepl-default)

Unable to load any of the alternatives: ("libIL.dylib" "libIL.1.dylib") [Condition of type CFFI:LOAD-FOREIGN-LIBRARY-ERROR]

Shader compilation errors

When I try to compile the shader,

(defun-g vert ((vert :vec2))
  (values (v! (+ vert *pos*) 0.0 1.0)
          (v! 0 0)))

I get a compilation error (backtrace attached).

This is probably not a cepl error, but I don't know how to debug it
vertex-error.txt
.

Minor changes to defun-g body produces strange error.

Starting from a clean sbcl-slime session, (ql:quickload :cepl-default), and (cepl:repl), there's an odd inconsistency in defun-g.

(cepl:defun-g subtract ((x :float) (r :float)) (- x r)) fails, but
(cepl:defun-g subtract ((x :float) (r :float)) (values (- x r))) and
(cepl:defun-g subtract ((x :float) (r :float)) (- x (floor r))) succeed.

http://pastebin.com/cw7bBsWc <- the slime backtrace.

Memory management?

I was trying to render 16 * 16 * 16 boxes.
I collected the vertices into one list and indices into other, so all of the vertices from 4096 boxes where in the same list.

(let ((vr (make-gpu-array verts :dimensions v-count :element-type 'g-pnc))
      (ir (make-gpu-array ind :dimensions i-count :element-type :unsigned-int)))
    (vector-push-extend (cons id (make-buffer-stream vr :index-array ir)) meshes)
    (free-gpu-array vr)
    (free-gpu-array ir)

Then I rendered, and it worked. I called free-vertex-stream on the buffer-stream.
I tried to create new mesh but I got opengl error 1285 . out-of-memory

Is it correct to free the gpu arrays after the stream has been made?
What am I not freeing correctly if I run out of memory?

I was looking at cepl's source and found possible bug?
delete-vertex-arrays is not inside the loop.

(defun free-vaos (vaos)
  (with-foreign-object (id :uint (length vaos))
    (loop :for vao :in vaos :for i :from 0 :do
      (setf (mem-aref id :uint i) vao))
    (%gl:delete-vertex-arrays 1 id)))

ECL FBO isn't created (probably)

I've decided to try CEPL on ECL. Everything builds fine, but can't run any demo – the condition is rised:

In function STRUCTURE-REF, the value of the first argument is
  NIL
which is not of the expected type FBO
   [Condition of type SIMPLE-TYPE-ERROR]

Related part of the backtrace:

  5: STRUCTURE-REF
  6: %ATTACHMENT
      Locals:
        "CEPL-GL:FBO" = NIL
        "CEPL-GL::ATTACHMENT-NAME" = 0
  7: ATTACHMENT
      Locals:
        "CEPL-GL:FBO" = NIL
        "CEPL-GL::ATTACHMENT-NAME" = 0
  8: CURRENT-VIEWPORT
  9: STEP-DEMO
 10: RUN-LOOP
 11: #<bytecompiled-function BYTECODES>
 12: EVAL-REGION
      Locals:
        "COMMON-LISP:STRING" = "(cepl::run-loop)\n"
        "COMMON-LISP:STREAM" = #<string-input stream from "(cepl...">
        "COMMON-LISP:VALUES" = NIL
        "SWANK::FORM" = (CEPL::RUN-LOOP)
        "#:G863" = #<frame 0>
        "#:G862" = LIST

Regards,
Daniel

Cannot (cepl:repl) on osx

OpenGL signalled (1280 . INVALID-ENUM) from GET-INTEGER-V.
[Condition of type CL-OPENGL-BINDINGS:OPENGL-ERROR]

Restarts:
0: [CONTINUE] Continue
1: [RETRY] Retry SLIME REPL evaluation request.
2: [*ABORT] Return to SLIME's top level.
3: [ABORT] Abort thread (#<THREAD "repl-thread" RUNNING {1003448023}>)

Backtrace:
0: (CL-OPENGL-BINDINGS:CHECK-ERROR #)
1: (CL-OPENGL:GET-INTEGER :NUM-EXTENSIONS 1)
2: (CEPL::GET-GL-EXTENSIONS)
3: (CEPL::CEPL-POST-CONTEXT-INITIALIZE)
4: (CEPL:REPL 640 480)
5: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CEPL:REPL) #)
6: (EVAL (CEPL:REPL))
7: (SWANK::EVAL-REGION "(cepl:repl) ..)
8: ((LAMBDA NIL :IN SWANK::REPL-EVAL))
9: (SWANK::TRACK-PACKAGE #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {1002FD84DB}>)
10: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {1002FD83FB}>)
11: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {1002FD83DB}>)
12: (SWANK::REPL-EVAL "(cepl:repl) ..)

Requires libIL

This can be found in a package called devil on ArchLinux, not sure about what else.

cgl:make-texture internal format a little too restictive

cgl:make-texture internal format can not accept :depth-component16 and over special internal formats. This is due to the limitation imposed by the calc-sampler-type function.

As a workaround i just added :depth-component16 to the the non int lists.

11.lisp crash

I am using Ubuntu 13.10

I compile and load example 11.lisp (run-demo) produces this error:

Unhandled memory fault at #x4F8.
[Condition of type SB-SYS:MEMORY-FAULT-ERROR]

Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT] Abort thread (#<THREAD "repl-thread" RUNNING {10053D0063}>)

Backtrace:
0: (SB-SYS:MEMORY-FAULT-ERROR)
1: ("foreign function: call_into_lisp")
2: ("foreign function: post_signal_tramp")
3: ("foreign function: #x7FFFF657B469")
4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (RUN-DEMO) #)
5: (EVAL (RUN-DEMO))
6: (SWANK::EVAL-REGION "(run-demo)\n")

startup crash CEPL::GET-GL-EXTENSIONS

Hi, I tried using cepl on Mac 10.8, it fails with this:

OpenGL signalled (1280 . INVALID-ENUM) from GET-INTEGER-V.
   [Condition of type CL-OPENGL-BINDINGS:OPENGL-ERROR]

Restarts:
 0: [CONTINUE] Continue
 1: [RETRY] Retry SLIME REPL evaluation request.
 2: [*ABORT] Return to SLIME's top level.
 3: [ABORT] Abort thread (#<THREAD "repl-thread" RUNNING {1003468023}>)

Backtrace:
  0: (CL-OPENGL-BINDINGS:CHECK-ERROR #<unavailable argument>)
      [No Locals]
  1: (CL-OPENGL:GET-INTEGER :NUM-EXTENSIONS 1)
      Locals:
        COUNT = 1
        VALUE = :NUM-EXTENSIONS
  2: (CEPL::GET-GL-EXTENSIONS)
      [No Locals]
  3: (CEPL::CEPL-POST-CONTEXT-INITIALIZE)
      [No Locals]
  4: (CEPL:REPL 640 480)
      Locals:
        HEIGHT = 480
        WIDTH = 640
  5: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CEPL:REPL) #<NULL-LEXENV>)
      Locals:
        SB-DEBUG::ARG-0 = (CEPL:REPL)
        SB-DEBUG::ARG-1 = #<NULL-LEXENV>
  6: (EVAL (CEPL:REPL))

SDL 2.0.0 was installed from source.

If I define get-gl-extensions to nil, I can load the examples.

Add list option to with-fbo-bound

We should be able to specify out of order attachment mapping. CEPL internals know how to do this in a performant way, which will not be possible in this case, BUT we should still be able to do it.

undefined function on (cepl:repl)

Hi! I am running OS X 10.9.4 and am getting the following error after I (ql:quickload :cepl) and (cepl:repl)
sldb_sbcl_1

Is this the OpenGL context error you mentioned? I made sure that the sbcl I had on this computer has native threads enabled. Is there anything I can do to change the default context?
1__sbcl__sbcl_

question about my glsl version

I am pretty sure this is a problem on my side, but maybe you can help. I've put the error message and the results of glxinfo below. glxinfo shows some results for 3.3. Any ideas how I can resolve this?

Thanks,

Michael

Here is the error I get when I try to compile the basic-3d-objects example:
Error compiling vertex-shader:
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

version 330

struct G_PC {
vec3 POS;
vec4 COL;
};
My computer is running Ubuntu 14.04 with an NVidia graphics card:
mfleming@poincare:~$ glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.0.4
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 11.0.4
OpenGL shading language version string: 1.30

Defpipeline bug when using postcompile

I think I found a bug in defpipeline. Shouldn't

" (if (eq (first shader) :post-compile) (push shader post-compile)"

be

" (if (eq (first shader) :post-compile)  (push (cadr shader) post-compile)"?

Otherwise I get a ":post-compile is not a function compiler error.

assimp dependency

Hi
Have you manage to get classimp working on Windows with the laters assimp.dll version. I could not load models using it when i tried.

Sorry I know it's not cepl specific but thought it worth asking as it seems to be a cepl dependency and i would like to use cepl on windows.

Cheers,

Examples don't work.

If I compile the example files and start (run-demo) an error appears,
mostly this error:

The value -468072688 is not of type SB-INT:INDEX.
[Condition of type TYPE-ERROR]

sometimes it also disconnects or c code is shown as error

How to run with brew installed dependencies

I use brew instead of macports to install the dependencies. The below version of osx.lisp works with such a setup. Please note this is a dirty hack as it will break if dependencies are upgraded.

(in-package :cepl-osx)

(defun start ()
  (push "/usr/local/Cellar/devil/1.7.8_1/lib/" cffi:*foreign-library-directories*)
  (push "/usr/local/Cellar/sdl2/2.0.3/lib/" cffi:*foreign-library-directories*)
  (push "/usr/local/Cellar/assimp/3.1.1/lib/" cffi:*foreign-library-directories*)
  (sdl2:make-this-thread-main
   (lambda () (swank:create-server :style nil :dont-close t))))

sfuns cant use sfuns

This is a stupid mistake. I may hold off on this for now though as I am rewriting Varjo and sfuns will be part of the core functionality. I will handle all this chaining in varjo at that point.

(cepl:repl) aborts with SDL Error (-1): No available audio device

Hi,
when running (cepl:repl) I get this error:

SDL Error (-1): No available audio device
   [Condition of type SDL2::SDL-RC-ERROR]

Restarts:
 0: [*CONTINUE] Return to the SDL2 main loop.
 1: [ABORT] Abort, quitting SDL2 entirely.
 2: [ABORT] abort thread (#<THREAD "SDL2 Main Thread" RUNNING {1005F694B3}>)

Backtrace:
  0: ((LAMBDA NIL :IN SDL2:INIT))
  1: (SDL2::HANDLE-MESSAGE (#<CLOSURE (LAMBDA NIL :IN SDL2:INIT) {1005F6958B}> . #S(TRIVIAL-CHANNELS:CHANNEL :QUEUE #S(TRIVIAL-CHANNELS.QUEUE:QUEUE :HEAD NIL :TAIL NIL) :Q-CONDITION #<SB-THREAD:WAITQUEUE A..
  2: (SDL2::SDL-MAIN-THREAD)
  3: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
  4: ((FLET #:WITHOUT-INTERRUPTS-BODY-1124 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
  5: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
  6: ((FLET #:WITHOUT-INTERRUPTS-BODY-584 :IN SB-THREAD::CALL-WITH-MUTEX))
  7: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFCFDAED3B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THR..
  8: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "SDL2 Main Thread" RUNNING {1005F694B3}> NIL #<CLOSURE (LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS) {1005F6943B}> (#<SB..
  9: ("foreign function: call_into_lisp")
 10: ("foreign function: new_thread_trampoline")
 11: ("foreign function: #x7FFFF79C16BC")

I run SBCL 1.2.12.51-012345e on gentoo 64bit with

*  media-libs/sdl2-mixer
      Latest version available: 2.0.0-r1
*  media-libs/libsdl2
      Latest version available: 2.0.3-r200
lshw shows that I have an audio device:
        *-multimedia
             description: Audio device
             product: 82801I (ICH9 Family) HD Audio Controller
             vendor: Intel Corporation
             physical id: 1b
             bus info: pci@0000:00:1b.0
             version: 02
             width: 64 bits
             clock: 33MHz
             capabilities: pm msi pciexpress bus_master cap_list
             configuration: driver=snd_hda_intel latency=0
             resources: irq:22 memory:e3220000-e3223fff

I made the following replacement in cepl-sdl.lisp and then now it works

(defmethod cepl-backend:init ((backend-name (eql :sdl)))
  (setf *backend* :sdl)
  (unless *initd*
    (unless (sdl2:init sdl2-ffi:+sdl-init-timer+ sdl2-ffi:+sdl-init-video+) (error "Failed to initialise SDL"))
    (setf *initd* t)))

Regards, Martin

Current library search is to broad on osx

platform-specific/osx.lisp is currently adding places to search for libs installed via macports and brew.
The search is WAAY to broad so we need to narrow it down

  • Find out what dirs are used
  • Add them in osx.lisp

[EDIT]
Because of refactoring this code is currently in repl.lisp also the main task is to find some info on best practices.

Frameless window on OSx (potential issue)

The problem is os x can't handle reliably interactions with the windowing system outside of the 'main thread'. The solution (for me) is to load the lispbuilder libs, and start the demos on the main thread.

The on-main macro looks like this:

+sb-thread

(defmacro on-main (&body b)
`(let ((thread (first (last (sb-thread:list-all-threads)))))
(sb-thread:interrupt-thread thread
#'(lambda () (sb-int:with-float-traps-masked (:underflow :overflow :inexact :invalid :divide-by-zero),@b)))))

errors on loading

Downloaded latest, ran (ql:quickload :cepl) got following errors:
To load "cepl":
Load 1 ASDF system:
cepl
; Loading "cepl"
...........; Failure to alias foreign type __BUILTIN_VA_LIST to VA-LIST
; due to undefined foreign type: __BUILTIN_VA_LIST
; Failure to alias foreign type __BUILTIN_VA_LIST to __GNUC_VA_LIST due to
; undefined foreign type: __BUILTIN_VA_LIST
; Unable to define foreign STRUCT #:ANON-TYPE-1012 due to:
; Failure to define :struct #:ANON-TYPE-1012 wrt. field FP of type
; (:POINTER FILE) due to undefined foreign type: FILE
; Unable to define foreign UNION #:ANON-TYPE-1011 due to:
; Failure to define :union #:ANON-TYPE-1011 wrt. field STDIO of type
; (AUTOWRAP::STRUCT
; (COMMON-LISP:NIL :ID 35 :BIT-SIZE 128 :BIT-ALIGNMENT 64)
; (AUTOCLOSE SDL-BOOL :BIT-SIZE 32 :BIT-OFFSET 0 :BIT-ALIGNMENT 32)
; (FP (:POINTER FILE) :BIT-SIZE 64 :BIT-OFFSET 64 :BIT-ALIGNMENT 64))
; due to undefined foreign type:
; (STRUCT (NIL ID 35 BIT-SIZE 128 BIT-ALIGNMENT 64)
; (AUTOCLOSE SDL-BOOL BIT-SIZE 32 BIT-OFFSET 0 BIT-ALIGNMENT 32)
; (FP (POINTER FILE) BIT-SIZE 64 BIT-OFFSET 64 BIT-ALIGNMENT 64))
; Unable to define foreign STRUCT SDL-RWOPS due to:
; Failure to define :struct SDL-RWOPS wrt. field HIDDEN of type
; (COMMON-LISP:UNION
; (COMMON-LISP:NIL :ID 34 :BIT-SIZE 192 :BIT-ALIGNMENT 64)
; (STDIO
; (AUTOWRAP::STRUCT
; (COMMON-LISP:NIL :ID 35 :BIT-SIZE 128 :BIT-ALIGNMENT 64)
; (AUTOCLOSE SDL-BOOL :BIT-SIZE 32 :BIT-OFFSET 0 :BIT-ALIGNMENT 32)
; (FP (:POINTER FILE) :BIT-SIZE 64 :BIT-OFFSET 64 :BIT-ALIGNMENT 64))
; :BIT-SIZE 128 :BIT-OFFSET 0 :BIT-ALIGNMENT 64)
; (MEM
; (AUTOWRAP::STRUCT
; (COMMON-LISP:NIL :ID 36 :BIT-SIZE 192 :BIT-ALIGNMENT 64)
; (BASE (:POINTER UINT8) :BIT-SIZE 64 :BIT-OFFSET 0 :BIT-ALIGNMENT
; 64)
; (HERE (:POINTER UINT8) :BIT-SIZE 64 :BIT-OFFSET 64 :BIT-ALIGNMENT
; 64)
; (STOP (:POINTER UINT8) :BIT-SIZE 64 :BIT-OFFSET 128 :BIT-ALIGNMENT
; 64))
; :BIT-SIZE 192 :BIT-OFFSET 0 :BIT-ALIGNMENT 64)
; (UNKNOWN
; (AUTOWRAP::STRUCT
; (COMMON-LISP:NIL :ID 37 :BIT-SIZE 128 :BIT-ALIGNMENT 64)
; (DATA1 (:POINTER :VOID) :BIT-SIZE 64 :BIT-OFFSET 0 :BIT-ALIGNMENT
; 64)
; (DATA2 (:POINTER :VOID) :BIT-SIZE 64 :BIT-OFFSET 64 :BIT-ALIGNMENT
; 64))
; :BIT-SIZE 128 :BIT-OFFSET 0 :BIT-ALIGNMENT 64))
; due to undefined foreign type:
; (UNION (NIL ID 34 BIT-SIZE 192 BIT-ALIGNMENT 64)
; (STDIO
; (STRUCT (NIL ID 35 BIT-SIZE 128 BIT-ALIGNMENT 64)
; (AUTOCLOSE SDL-BOOL BIT-SIZE 32 BIT-OFFSET 0 BIT-ALIGNMENT
; 32)
; (FP (POINTER FILE) BIT-SIZE 64 BIT-OFFSET 64 BIT-ALIGNMENT
; 64))
; BIT-SIZE 128 BIT-OFFSET 0 BIT-ALIGNMENT 64)
; (MEM
; (STRUCT (NIL ID 36 BIT-SIZE 192 BIT-ALIGNMENT 64)
; (BASE (POINTER UINT8) BIT-SIZE 64 BIT-OFFSET 0 BIT-ALIGNMENT
; 64)
; (HERE (POINTER UINT8) BIT-SIZE 64 BIT-OFFSET 64 BIT-ALIGNMENT
; 64)
; (STOP (POINTER UINT8) BIT-SIZE 64 BIT-OFFSET 128
; BIT-ALIGNMENT 64))
; BIT-SIZE 192 BIT-OFFSET 0 BIT-ALIGNMENT 64)
; (UNKNOWN
; (STRUCT (NIL ID 37 BIT-SIZE 128 BIT-ALIGNMENT 64)
; (DATA1 (POINTER VOID) BIT-SIZE 64 BIT-OFFSET 0 BIT-ALIGNMENT
; 64)
; (DATA2 (POINTER VOID) BIT-SIZE 64 BIT-OFFSET 64 BIT-ALIGNMENT
; 64))
; BIT-SIZE 128 BIT-OFFSET 0 BIT-ALIGNMENT 64))
; Failure to define function SDL-RW-FROM-FP (nee "SDL_RWFromFP") wrt.
; parameter FP of type (:POINTER FILE) due to undefined foreign type: FILE
; Failure to alias foreign type |UNKNOWN-TYPE:VECTOR| to |__M64| due to
; undefined foreign type: UNKNOWN-TYPE:VECTOR
; Failure to alias foreign type |UNKNOWN-TYPE:VECTOR| to __V2SI due to
; undefined foreign type: UNKNOWN-TYPE:VECTOR

... lots more of these

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.