-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ellisvelo/master
Created sdl2-tutorial system and more documentation
- Loading branch information
Showing
20 changed files
with
130 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,54 @@ | ||
# Common Lisp SDL2 tutorials | ||
Adapted from http://lazyfoo.net/tutorials/SDL/ | ||
|
||
|
||
## Installing the SDL2 Libraries | ||
|
||
The tutorial requires that SDL2, SDL2 Image, and SDL2 TTF are installed before | ||
running the examples. | ||
|
||
### Mac OS X | ||
|
||
Mac OS X requires each library to be downloaded and copied to | ||
$HOME/Library/Frameworks or /Library/Frameworks. | ||
|
||
Library Name | Download Link | ||
------------ | ------------- | ||
SDL2 | https://www.libsdl.org/download-2.0.php | ||
SDL2 Image | https://www.libsdl.org/projects/SDL_image | ||
SDL2 TTF | https://www.libsdl.org/projects/SDL_ttf | ||
|
||
Running the tutorials will cause Catalina to report that the framework cannot be | ||
opened because the developer cannot be verified. The workaround for this problem | ||
is the following: | ||
|
||
1. Navigate to System Preferences -> Security & Privacy -> General on the Mac | ||
|
||
2. Run repl.sh | ||
|
||
3. When the dialog appears about the developer not being verified, click the | ||
"Cancel" button. | ||
|
||
4. Examine the Security & Privacy screen for a button called "Allow Anyway" for | ||
the framework. Click the "Allow Anyway" button with the identified framework. | ||
|
||
5. The verification dialog will now appear a second time, but there will be an | ||
option to "Open" the framework. Click "Open". | ||
|
||
6. Repeat steps 3 through 5 for the different frameworks. | ||
|
||
### Linux | ||
|
||
The SDL2 libraries can be installed on a Debian based system with the command | ||
below. | ||
|
||
apt install libsdl2-2.0 libsdl2-image-2.0 libsdl2-ttf-2.0 | ||
|
||
|
||
## Running the Examples | ||
|
||
A repl.sh script is provided that loads SDL2-TUTORIAL with quicklisp and then | ||
starts up a swank thread on port 4005 for repl connections. | ||
|
||
1. ./repl.sh | ||
2. (sdl2-tutorial:main #'sdl2-tutorial-1:main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
sbcl --eval "(ql:quickload \"sdl2-tutorial\")" \ | ||
--eval "(sdl2-tutorial:create-swank-server)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(defsystem "sdl2-tutorial" | ||
:description "SDL2 Tutorial based upon http://lazyfoo.net/tutorials/SDL" | ||
:version "0.0.1" | ||
:licence "Public Domain" | ||
:depends-on ("bordeaux-threads" "sdl2" "sdl2-image" "sdl2-ttf" "swank") | ||
:components ((:file "1/main") | ||
(:file "2/main") | ||
(:file "3/main") | ||
(:file "4/main") | ||
(:file "5/main") | ||
(:file "6/main") | ||
(:file "7/main") | ||
(:file "8/main") | ||
(:file "9/main") | ||
(:file "10/main") | ||
(:file "11/main") | ||
(:file "12/main") | ||
(:file "13/main") | ||
(:file "14/main") | ||
(:file "15/main") | ||
(:file "16/main") | ||
(:file "sdl2-tutorial"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(defpackage :sdl2-tutorial | ||
(:use cl bt) | ||
(:export :main :create-swank-server)) | ||
|
||
(in-package :sdl2-tutorial) | ||
|
||
(defun create-swank-server() | ||
(bt:make-thread (lambda () (swank:create-server :port 4005 :dont-close t)))) | ||
|
||
(defun main(fn) | ||
(sdl2:make-this-thread-main fn)) |