lispgames / cl-sdl2

Common Lisp bindings for SDL2 using C2FFI.
MIT License
309 stars 82 forks source link

Adding an example to sdl2-examples #117

Closed xyproto closed 2 years ago

xyproto commented 5 years ago

Hi,

I have a repository with a collection of examples of basic use of SDL2 for a wide range of languages, with the intention of helping beginners to get started and get a taste of various languages.

https://github.com/xyproto/sdl2-examples

I would like to add Common Lisp in a similar fashion, so that running make would both download any needed files and then compile/run the example, similar to how I've done with all the other examples.

However, all Lisp documentation seems to be geared towards interacting with Lisp interactively, (or through Emacs).

Could you please add an example to the cl-sdl2 documentation for how to run a simple example from the command line? I don't expect you to make a pull request for sdl2-examples, but that would be awesome too.

Best regards, Alexander F. Rødseth

Halfwake commented 3 years ago

This is neither here nor there.

Assuming they have quicklisp installed, they're in the root of the cl-sdl2 directory, and they're using SBCL, this would start an example.

sbcl --eval "(ql:quickload 'sdl2)" --load "examples/basic.lisp" --eval "(sdl2-examples:basic-test)" --eval "(quit)"

Or in script form.


(ql:quickload 'sdl2)
(load "examples/basic.lisp")
(sdl2-examples:basic-test)
(quit)

sbcl --load some-script.lisp

xyproto commented 2 years ago

Thank you!

xyproto commented 2 years ago

A Common Lisp example is now added here:

https://github.com/xyproto/sdl2-examples/tree/main/lisp