-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9337336
Showing
8 changed files
with
85 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.fasl |
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,15 @@ | ||
# CL-SDL2-TTF | ||
|
||
This is a wrapper for the SDL2_TTF library used for loading fonts and creating text assets. | ||
|
||
## Usage | ||
|
||
## Examples | ||
|
||
## Issues | ||
if you cannot load `cl-sdl-ttf`, please ensure you have SDL_TTF 2.0 installed and not just 1.2. | ||
|
||
If you are sure all of this is correct, and it still will not load, please file an issue and specify | ||
* Your platform and architecture | ||
* Your Common Lisp implementation | ||
* The absolute path to your installed .so, .dylib, .dll, or appropriate OSX framework |
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,21 @@ | ||
(defpackage :sdl2-ttf.asdf | ||
(:use #:cl #:asdf)) | ||
|
||
(in-package :sdl2-mixer.asdf) | ||
|
||
(defsystem :sdl2-ttf | ||
:description "Bindings for sdl2_ttf using autowrap" | ||
:author "Bryan Baraoidan" | ||
:license "MIT" | ||
:version "1.0" | ||
:depends-on (:alexandria :defpackage-plus :cl-autowrap :sdl2) | ||
:pathname "src" | ||
:serial t | ||
:components ((:file "package") | ||
(:file "library") | ||
(:file "autowrap") | ||
(:file "conditions") | ||
(:file "general") | ||
(:module autowrap-spec | ||
:pathname "spec" | ||
:components ((:static-file "SDL_ttf"))))) |
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,34 @@ | ||
;;; This file is adapted from almostly completely verbatim from cl-sdl2-mixer as I needed the same functionality for font loading | ||
(in-package :sdl2-mixer) | ||
|
||
(define-condition sdl-mixer-error (sdl2::sdl-rc-error) ()) | ||
|
||
;;; Note, Mix_GetError doesn't exist, it's a #define for SDL_GetError | ||
|
||
(defmacro check-rc (form) | ||
(with-gensyms (rc) | ||
`(let ((,rc ,form)) | ||
(when (< ,rc 0) | ||
(error 'sdl-ttf-error :rc ,rc :string (sdl-get-error))) | ||
,rc))) | ||
|
||
(defmacro check-non-zero (form) | ||
(with-gensyms (rc) | ||
`(let ((,rc ,form)) | ||
(unless (/= ,rc 0) | ||
(error 'sdl-ttf-error :rc ,rc :string (sdl-get-error))) | ||
,rc))) | ||
|
||
(defmacro check-true (form) | ||
(with-gensyms (rc) | ||
`(let ((,rc ,form)) | ||
(unless (sdl-true-p ,rc) | ||
(error 'sdl-ttf-error :rc ,rc :string (sdl-get-error))) | ||
,rc))) | ||
|
||
(defmacro check-null (form) | ||
(with-gensyms (wrapper) | ||
`(let ((,wrapper ,form)) | ||
(if (cffi:null-pointer-p (autowrap:ptr ,wrapper)) | ||
(error 'sdl-ttf-error :rc ,wrapper :string (sdl-get-error)) | ||
,wrapper)))) |
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 @@ | ||
(in-package :sdl2-ttf) |
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 @@ | ||
(in-package :sdl2-mixer) | ||
|
||
(cffi:define-foreign-library libsdl2-ttf | ||
(:unix (:or "libSDL2_ttf-2.0.so.0" "libSDL2_ttf"))) |
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,8 @@ | ||
(in-package :cl-user) | ||
(defpackage :sdl2-mixer | ||
(:use #:cl | ||
#:cffi | ||
#:alexandria | ||
#:autowrap.minimal | ||
#:plus-c | ||
#:sdl2-ffi.functions)) |
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 @@ | ||
#include <SDL2/SDL_ttf.h> |