summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-06-28 18:46:16 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-06-28 18:46:16 -0400
commitf47eb69a354188154731846dde8b384c2c2f39f6 (patch)
tree6aa1ccb9212836b7c941e771475eb995fa6df9f9
parentdf0f2a5f3f09394f1953abbc7e33e9a98204680e (diff)
Rename guile-2d to Sly!
Massive find/replace job.
-rw-r--r--.gitignore30
-rw-r--r--INSTALL.org20
-rw-r--r--Makefile.am60
-rw-r--r--README.org101
-rw-r--r--configure.ac4
-rw-r--r--doc/Makefile.am4
-rw-r--r--doc/audio.texi2
-rw-r--r--doc/game.texi2
-rw-r--r--doc/graphics.texi2
-rw-r--r--doc/graphics/font.texi2
-rw-r--r--doc/graphics/texture.texi2
-rw-r--r--doc/graphics/tileset.texi2
-rw-r--r--doc/introduction.texi14
-rw-r--r--doc/math.texi2
-rw-r--r--doc/scripting.texi2
-rw-r--r--doc/sly.texi (renamed from doc/guile-2d.texi)14
-rwxr-xr-xexamples/2048/204826
-rw-r--r--examples/animation.scm14
-rw-r--r--examples/common.scm20
-rw-r--r--examples/coroutine.scm16
-rw-r--r--examples/font.scm20
-rw-r--r--examples/particles.scm14
-rw-r--r--examples/simple.scm10
-rw-r--r--examples/tilemap.scm14
-rw-r--r--pre-inst-env.in10
-rwxr-xr-xsandbox44
-rw-r--r--sly/agenda.scm (renamed from 2d/agenda.scm)6
-rw-r--r--sly/animation.scm (renamed from 2d/animation.scm)6
-rw-r--r--sly/audio.scm (renamed from 2d/audio.scm)4
-rw-r--r--sly/cache.scm91
-rw-r--r--sly/color.scm (renamed from 2d/color.scm)6
-rw-r--r--sly/config.scm (renamed from 2d/config.scm.in)6
-rw-r--r--sly/config.scm.in28
-rw-r--r--sly/coroutine.scm (renamed from 2d/coroutine.scm)4
-rw-r--r--sly/event.scm (renamed from 2d/event.scm)4
-rw-r--r--sly/font.scm (renamed from 2d/font.scm)22
-rw-r--r--sly/fps.scm (renamed from 2d/fps.scm)8
-rw-r--r--sly/game.scm (renamed from 2d/game.scm)14
-rw-r--r--sly/helpers.scm (renamed from 2d/helpers.scm)8
-rw-r--r--sly/keyboard.scm (renamed from 2d/keyboard.scm)10
-rw-r--r--sly/live-reload.scm (renamed from 2d/live-reload.scm)10
-rw-r--r--sly/lru-cache.scm54
-rw-r--r--sly/math.scm (renamed from 2d/math.scm)4
-rw-r--r--sly/mode.scm22
-rw-r--r--sly/mouse.scm (renamed from 2d/mouse.scm)10
-rw-r--r--sly/primitives.scm120
-rw-r--r--sly/rect.scm (renamed from 2d/rect.scm)6
-rw-r--r--sly/repl.scm (renamed from 2d/repl.scm)10
-rw-r--r--sly/scene-graph.scm217
-rw-r--r--sly/shader.scm (renamed from 2d/shader.scm)14
-rw-r--r--sly/signal.scm (renamed from 2d/signal.scm)6
-rw-r--r--sly/sprite.scm (renamed from 2d/sprite.scm)28
-rw-r--r--sly/texture.scm (renamed from 2d/texture.scm)14
-rw-r--r--sly/tileset.scm (renamed from 2d/tileset.scm)6
-rw-r--r--sly/transform.scm (renamed from 2d/transform.scm)8
-rw-r--r--sly/vector.scm (renamed from 2d/vector.scm)4
-rw-r--r--sly/window.scm (renamed from 2d/window.scm)14
-rw-r--r--sly/wrappers/freeimage.scm (renamed from 2d/wrappers/freeimage.scm)6
-rw-r--r--sly/wrappers/gl.scm (renamed from 2d/wrappers/gl.scm)4
-rw-r--r--sly/wrappers/util.scm (renamed from 2d/wrappers/util.scm)4
60 files changed, 886 insertions, 343 deletions
diff --git a/.gitignore b/.gitignore
index dd561c8..58ac0d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,20 +10,20 @@ Makefile.in
/config.status
/config.log
/aclocal.m4
-/doc/guile-2d.aux
-/doc/guile-2d.cp
-/doc/guile-2d.fn
-/doc/guile-2d.fns
-/doc/guile-2d.info
-/doc/guile-2d.ky
-/doc/guile-2d.log
-/doc/guile-2d.pdf
-/doc/guile-2d.pg
-/doc/guile-2d.toc
-/doc/guile-2d.tp
-/doc/guile-2d.vr
-/doc/guile-2d.vrs
-/doc/guile-2d.html
-/doc/guile-2d.t2p
+/doc/sly.aux
+/doc/sly.cp
+/doc/sly.fn
+/doc/sly.fns
+/doc/sly.info
+/doc/sly.ky
+/doc/sly.log
+/doc/sly.pdf
+/doc/sly.pg
+/doc/sly.toc
+/doc/sly.tp
+/doc/sly.vr
+/doc/sly.vrs
+/doc/sly.html
+/doc/sly.t2p
/2d/config.scm
/pre-inst-env
diff --git a/INSTALL.org b/INSTALL.org
index 426224b..caf276c 100644
--- a/INSTALL.org
+++ b/INSTALL.org
@@ -1,12 +1,9 @@
* Installation Instructions
- Installing guile-2d is rather easy (but not easy enough) if you are
- on a GNU/Linux system. Currently, only installation instructions for
- Debian are provided, but the non-apt commands should work without
- any modifications on any GNU/Linux distro.
-
- This installation guide assumes that you have the GNU build system
- (automake, autoconf, texinfo, pkg-config) and git installed.
+ Installing Sly is rather easy (but not easy enough) if you are on a
+ GNU/Linux system. This installation guide assumes that you have the
+ GNU build system (automake, autoconf, texinfo, pkg-config) and git
+ installed.
** Install dependencies
@@ -30,6 +27,7 @@
Check the versions available to you with =sudo apt-cache show guile-2.0-dev=.
*** SDL
+
SDL is a very popular, cross-platform game library.
*Debian*
@@ -97,16 +95,16 @@
sudo make install
#+END_SRC
-** Install guile-2d
+** Install Sly
- Once the dependencies have been installed, installing guile-2d is
+ Once the dependencies have been installed, installing Sly is
pretty straightforward.
*GNU/Linux*
#+BEGIN_SRC sh
- git clone https://github.com/davexunit/guile-2d.git
- cd guile-2d/
+ git clone https://gitorious.org/sly/sly.git
+ cd sly/
./autogen.sh
./configure --prefix=/usr
make
diff --git a/Makefile.am b/Makefile.am
index 9a48973..8ed383a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-## guile-2d
+## Sly
## Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
##
## This program is free software: you can redistribute it and/or
@@ -21,39 +21,39 @@ moddir=$(prefix)/share/guile/site/2.0
godir=$(libdir)/guile/2.0/ccache
SOURCES = \
- 2d/agenda.scm \
- 2d/animation.scm \
- 2d/audio.scm \
- 2d/color.scm \
- 2d/config.scm \
- 2d/coroutine.scm \
- 2d/event.scm \
- 2d/font.scm \
- 2d/fps.scm \
- 2d/game.scm \
- 2d/helpers.scm \
- 2d/keyboard.scm \
- 2d/live-reload.scm \
- 2d/math.scm \
- 2d/mouse.scm \
- 2d/rect.scm \
- 2d/repl.scm \
- 2d/shader.scm \
- 2d/signal.scm \
- 2d/sprite.scm \
- 2d/texture.scm \
- 2d/tileset.scm \
- 2d/transform.scm \
- 2d/vector.scm \
- 2d/window.scm \
+ sly/agenda.scm \
+ sly/animation.scm \
+ sly/audio.scm \
+ sly/color.scm \
+ sly/config.scm \
+ sly/coroutine.scm \
+ sly/event.scm \
+ sly/font.scm \
+ sly/fps.scm \
+ sly/game.scm \
+ sly/helpers.scm \
+ sly/keyboard.scm \
+ sly/live-reload.scm \
+ sly/math.scm \
+ sly/mouse.scm \
+ sly/rect.scm \
+ sly/repl.scm \
+ sly/shader.scm \
+ sly/signal.scm \
+ sly/sprite.scm \
+ sly/texture.scm \
+ sly/tileset.scm \
+ sly/transform.scm \
+ sly/vector.scm \
+ sly/window.scm \
$(WRAPPER_SOURCES)
WRAPPER_SOURCES = \
- 2d/wrappers/freeimage.scm \
- 2d/wrappers/gl.scm \
- 2d/wrappers/util.scm
+ sly/wrappers/freeimage.scm \
+ sly/wrappers/gl.scm \
+ sly/wrappers/util.scm
-2d/config.scm: Makefile
+sly/config.scm: Makefile
sed -e "s|@pkgdatadir\@|$(pkgdatadir)|" $@.in > $@
EXTRA_DIST += env.in
diff --git a/README.org b/README.org
index fdc45e4..0994efb 100644
--- a/README.org
+++ b/README.org
@@ -1,37 +1,44 @@
-* guile-2d
+* Sly
- Guile-2d is a free software 2D game engine written in GNU Guile
- Scheme. It provides an abstraction layer above SDL and OpenGL for
- common 2D game programming requirements such as:
+ Sly is a free software game engine written in GNU Guile Scheme. It
+ provides an abstraction layer above SDL and OpenGL for common game
+ programming requirements such as:
+ - Meshes
+ - Shaders
- Sprites
- Animation
- Tilesets
- - Tile maps
- Scene graph
- - Input handling
+ - Keyboard/mouse input
- Scripting
+ Sly differentiates itself from other game engines by providing an
+ interactive development environment via Guile's read-eval-print-loop
+ (REPL), exposing a functional API instead of an object-oriented one,
+ and encouraging reactive programming.
+
** Inspiration
- Every programming language should have a fun, easy to use 2D game
- library. Guile-2d draws its inspiration from great
- libraries/engines such as [[http://love2d.org/][LÖVE]], [[http://pygame.org/][Pygame]], and [[http://pyglet.org/][Pyglet]].
+
+ Every programming language should have a fun, easy to use game
+ library. Sly draws its inspiration from great libraries/engines
+ such as [[http://love2d.org/][LÖVE]], [[http://pygame.org/][Pygame]], and [[http://pyglet.org/][Pyglet]]. Sly's functional reactive nature
+ is heavily inspired by the [[http://elm-lang.org/][Elm]] programming language.
** Example
- Here is the simplest guile-2d application (so far).
+
+ Here is the simplest Sly application (so far).
#+BEGIN_SRC scheme
- (use-modules (2d game)
- (2d sprite)
- (2d window))
+ (use-modules (sly game)
+ (sly sprite)
+ (sly window))
(define sprite
(load-sprite "images/p1_front.png"
#:position #(320 240)))
- (add-hook! draw-hook
- (lambda (dt alpha)
- (draw-sprite sprite)))
+ (add-hook! draw-hook (lambda (dt alpha) (draw-sprite sprite)))
(with-window (make-window #:title "Simple Sprite Demo")
(run-game-loop))
@@ -40,7 +47,8 @@
** Features
*** The Game Loop
- Guile-2d's game loop doesn't tie drawing and updating
+
+ Sly's game loop doesn't tie drawing and updating
together. Instead, updates happen on a fixed timestep (60 ticks
per second by default) while drawing happens as many times as
possible. A framerate indepedent loop mitigates slow down that the
@@ -61,6 +69,7 @@
#+END_SRC
*** Sprites
+
Sprites encapsulate the presentation of an image or a region of an
image.
@@ -68,12 +77,12 @@
=load-sprite= procedure. All arguments except the filename are
optional keyword arguments.
- Guile-2d uses the FreeImage library and can load many different
- image formats. See the FreeImage [[http://freeimage.sourceforge.net/features.html][features page]] for a full list of
+ Sly uses the FreeImage library and can load many different image
+ formats. See the FreeImage [[http://freeimage.sourceforge.net/features.html][features page]] for a full list of
supported formats.
#+BEGIN_SRC scheme
- (use-modules (2d sprite))
+ (use-modules (sly sprite))
(define sprite
(load-sprite "cirno.png"
@@ -104,12 +113,13 @@
#+END_SRC
*** Keyboard and Mouse Input
- There are hooks within the =(2d keyboard)= and =(2d mouse)=
+
+ There are hooks within the =(sly keyboard)= and =(sly mouse)=
modules that can be used to respond to user input.
#+BEGIN_SRC scheme
- (use-modules (2d keyboard)
- (2d mouse))
+ (use-modules (sly keyboard)
+ (sly mouse))
;; Quit when ESC is pressed.
(add-hook! key-press-hook
@@ -126,7 +136,8 @@
In the future, there will be more convenient ways to respond to
user input similar to how keymaps work in Emacs.
-*** Coroutines and Agendas
+*** Coroutines and the Agenda
+
The ability to write scripts is very important for most games. A
script for an RPG NPC could look like this:
@@ -155,8 +166,8 @@
such that it does not halt further program execution.
#+BEGIN_SRC scheme
- (use-modules (2d agenda)
- (2d coroutine))
+ (use-modules (sly agenda)
+ (sly coroutine))
(coroutine
(while #t
@@ -164,15 +175,14 @@
(wait 60)
(walk 'down)
(wait 60)))
-
#+END_SRC
=coroutine= is a useful macro that evaluates a block of code as a
coroutine. =wait= aborts the procedure and schedules the
continuation inside of the agenda. In this example, the script is
- paused for 1 second after each step. Since guile-2d enforces a
- fixed timestep and updates 60 times per second by default, 60
- ticks is equivalent to 1 second.
+ paused for 1 second after each step. Since Sly enforces a fixed
+ timestep and updates 60 times per second by default, 60 ticks is
+ equivalent to 1 second.
You can also use the agenda to schedule the evaluation of any
thunk even if it isn't a coroutine.
@@ -193,6 +203,7 @@
tick.
*** Functional Reactive Programming
+
Games are composed of values that evolve as time passes. The
player's score, the current stage, an enemy's hit points, etc. all
change in response to events that happen at discrete points in
@@ -201,8 +212,8 @@
and/or assign to variables. However, this approach, while simple
and effective, comes at the price of readability and
comprehension. Instead of explicitly mutating data and entering
- "callback hell", guile-2d abstracts and formalizes the process
- using a functional reactive programming style.
+ "callback hell", Sly abstracts and formalizes the process using a
+ functional reactive programming style.
Time-varying values are called "signals", and they are created in
a declarative and functional manner. Rather than describing the
@@ -244,10 +255,10 @@
what your changes do to the game without having to restart the
program every time.
- Guile-2d integrates Guile's cooperative REPL server with the game
- loop. To activate this feature, import the =(2d repl)= module. To
- connect to the REPL server, use the [[http://www.nongnu.org/geiser/][Geiser]] extension for GNU Emacs
- or telnet.
+ Sly integrates Guile's cooperative REPL server with the game loop.
+ To activate this feature, import the =(sly repl)= module and call
+ =(start-sly-repl)=. To connect to the REPL server, use the [[http://www.nongnu.org/geiser/][Geiser]]
+ extension for GNU Emacs or telnet.
*Geiser*
@@ -264,8 +275,9 @@
#+END_SRC
** Building
- Guile-2d uses the typical GNU build system. First run =autogen.sh=
- and then do the usual incantations.
+
+ Sly uses the typical GNU build system. First run =autogen.sh= and
+ then do the usual incantations.
#+BEGIN_SRC sh
./autogen.sh
@@ -277,15 +289,15 @@
See =INSTALL.org= for more detailed installation instructions.
** Running Examples
- To run an example when guile-2d has been installed:
+
+ To run an example when Sly has been installed:
#+BEGIN_SRC sh
cd examples
guile simple.scm
#+END_SRC
- To run an example without installing guile-2d (useful when
- developing):
+ To run an example without installing Sly (useful when developing):
#+BEGIN_SRC sh
cd examples
@@ -297,15 +309,16 @@
- Press the =ESCAPE= key
** Using the Sandbox
- If you want to quickly create a guile-2d environment and start
+
+ If you want to quickly create a Sly environment and start
experimenting, run =./pre-inst-env sandbox=. It will import many
useful modules, start a REPL server, open a window, and start the
game loop. Simply connect to the REPL server and start hacking!
** Platforms
- Guile-2d supports GNU/Linux currently. OS X support is in the
- works, but there are problems with guile-sdl. See
+ Sly supports GNU/Linux currently. OS X support is in the works, but
+ there are problems with guile-sdl. See
https://github.com/davexunit/guile-2d/issues/2 for more details.
** Dependencies
diff --git a/configure.ac b/configure.ac
index e0cc30f..77d7f31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
dnl -*- Autoconf -*-
-AC_INIT(guile-2d, 0.1.0)
-AC_CONFIG_SRCDIR(2d)
+AC_INIT(Sly, 0.1.0)
+AC_CONFIG_SRCDIR(sly)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability foreign])
AM_SILENT_RULES([yes])
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f69f391..9c2d95e 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = gnu
-info_TEXINFOS = guile-2d.texi
+info_TEXINFOS = sly.texi
guile_TEXINFOS = audio.texi \
fdl.texi \
@@ -12,7 +12,7 @@ guile_TEXINFOS = audio.texi \
graphics/sprite.texi \
graphics/texture.texi \
graphics/tileset.texi \
- guile-2d.texi \
+ sly.texi \
introduction.texi \
math.texi \
math/math.texi \
diff --git a/doc/audio.texi b/doc/audio.texi
index f98751e..20d3085 100644
--- a/doc/audio.texi
+++ b/doc/audio.texi
@@ -1,7 +1,7 @@
@node Audio
@chapter Audio
-Guile-2D provides a simple wrapper over SDL's mixer API for working
+Sly provides a simple wrapper over SDL's mixer API for working
with music and sound effects.
@menu
diff --git a/doc/game.texi b/doc/game.texi
index 2115767..28cddf5 100644
--- a/doc/game.texi
+++ b/doc/game.texi
@@ -1,7 +1,7 @@
@node Games and Scenes
@chapter Games and Scenes
-In Guile-2D, games are defined declaratively. Game objects define
+In Sly, games are defined declaratively. Game objects define
things such as the title and screen resolution. Games are composed of
many scenes, which encapsulate a particular aspect of the
game. Examples would be a main menu, a world map, or a battle screen.
diff --git a/doc/graphics.texi b/doc/graphics.texi
index 62ecc6d..671754b 100644
--- a/doc/graphics.texi
+++ b/doc/graphics.texi
@@ -1,7 +1,7 @@
@node Graphics
@chapter Graphics
-Graphics are a fundamental part of most computer games. Guile-2D makes
+Graphics are a fundamental part of most computer games. Sly makes
it easy to make sprite-based games by providing all of the necessary
primitives. Graphics are rendered via OpenGL to take advantage of
hardware acceleration.
diff --git a/doc/graphics/font.texi b/doc/graphics/font.texi
index 59057a2..150a74e 100644
--- a/doc/graphics/font.texi
+++ b/doc/graphics/font.texi
@@ -1,7 +1,7 @@
@node Fonts
@section Fonts
-Guile-2D can render TTF fonts via the FTGL library.
+Sly can render TTF fonts via the FTGL library.
@anchor{2d font font-ftgl-font}@defspec font-ftgl-font
@end defspec
diff --git a/doc/graphics/texture.texi b/doc/graphics/texture.texi
index 2ac1503..b7da0f8 100644
--- a/doc/graphics/texture.texi
+++ b/doc/graphics/texture.texi
@@ -1,7 +1,7 @@
@node Textures
@section Textures
-Textures are images loaded in graphics memory. Guile-2D supports many
+Textures are images loaded in graphics memory. Sly supports many
texture formats via the FreeImage library. A texture object can
describe a full image or a rectangular section of an image.
diff --git a/doc/graphics/tileset.texi b/doc/graphics/tileset.texi
index 1f229dc..96aab67 100644
--- a/doc/graphics/tileset.texi
+++ b/doc/graphics/tileset.texi
@@ -2,7 +2,7 @@
@section Tilesets
In most 2D games, the game world is composed of many small,
-rectangular pieces called tiles. In Guile-2D, tilesets are used to
+rectangular pieces called tiles. In Sly, tilesets are used to
encapsulate a group of uniformly sized texture regions that come from
a single parent texture.
diff --git a/doc/introduction.texi b/doc/introduction.texi
index 2503586..b011c77 100644
--- a/doc/introduction.texi
+++ b/doc/introduction.texi
@@ -1,13 +1,13 @@
@node Introduction
@chapter Introduction
-Guile-2D is a 2D game development framework for GNU Guile. Guile-2D
+Sly is a 2D game development framework for GNU Guile. Guile-2D
aims to be simple for beginners to learn and to provide users with all
of the necessary tools for making 2D computer games, such as sprites,
tilesets, audio, scripting, and collision detection.
This manual is a work in progress. You will find that it is lacking in
-many areas. If Guile-2D interests you, please consider helping to
+many areas. If Sly interests you, please consider helping to
improve the documentation.
@menu
@@ -24,16 +24,16 @@ fantastic Scheme implementation with a great purpose: to bring
practical user freedom to the GNU system via Emacs-like
extensibility. There are many libraries available to make games with
languages such as Python, Java, and Lua, but there isn't much out
-there for Scheme. Guile-2D aims to change that.
+there for Scheme. Sly aims to change that.
I originally set out on the journey to write a game in C with a Scheme
scripting layer. A year later, I've decided that it would be best to
create an generic game framework in order to give back to the Guile
community and help promote Guile to game developers.
-Guile-2D draws much inspiration from existing game libraries for
+Sly draws much inspiration from existing game libraries for
other, more popular programming languages. Pygame, pyglet, and love2d
-are very beginner friendly, and Guile-2D hopes to translate their good
+are very beginner friendly, and Sly hopes to translate their good
ideas into the Scheme world.
@node The Game Loop
@@ -41,9 +41,9 @@ ideas into the Scheme world.
The game loop is so fundamental that it has to be discussed
immediately, so as to avoid any confusion about how it
-operates. Guile-2D's game loop operates on a fixed-timestep of 1/60th
+operates. Sly's game loop operates on a fixed-timestep of 1/60th
of a second. Time is measured in frames rather than in seconds to
avoid the pitfalls of a variable time-based approach. Though the
-update rate is fixed, the frame-rate is not. Guile-2D will render at
+update rate is fixed, the frame-rate is not. Sly will render at
as high of a framerate as it can. Keyboard and mouse input is polled
during every update and events are emitted to the relevant callbacks.
diff --git a/doc/math.texi b/doc/math.texi
index 74645db..6e92cc0 100644
--- a/doc/math.texi
+++ b/doc/math.texi
@@ -2,7 +2,7 @@
@chapter Math
Games typically require a lot of linear algebra and trigonometry in
-order to function. Guile-2D provides modules to perform 2D vector
+order to function. Sly provides modules to perform 2D vector
math, degree to/from radian conversions, and axis-aligned bounding box
collision tests.
diff --git a/doc/scripting.texi b/doc/scripting.texi
index a89ed1c..be748c5 100644
--- a/doc/scripting.texi
+++ b/doc/scripting.texi
@@ -4,7 +4,7 @@
The ability to write scripts is very important for most games. Scripts
are short programs that modify game state. In an RPG, one might want
to write a script that causes an NPC to walk up to the player and
-begin a conversation with them. Guile-2D allows for easy, linear
+begin a conversation with them. Sly allows for easy, linear
script writing by using cooperative multitasking, also known as
coroutines. Agendas are used to schedule scripts to be run at distinct
points in game time, and actions provide an API to describe
diff --git a/doc/guile-2d.texi b/doc/sly.texi
index 2395b49..3898e5d 100644
--- a/doc/guile-2d.texi
+++ b/doc/sly.texi
@@ -1,10 +1,10 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
-@setfilename guile-2d.info
-@settitle Guile-2D
+@setfilename sly.info
+@settitle Sly
@c %**end of header
@copying
-Guile-2D is a 2D game development framework for GNU Guile.
+Sly is a 2D game development framework for GNU Guile.
Copyright @copyright{} 2013 David Thompson
@@ -27,8 +27,8 @@ The document was typeset with
@end copying
@titlepage
-@title Guile-2D 0.1
-@subtitle Guile-2D is a 2D game development framework for GNU Guile
+@title Sly 0.1
+@subtitle Sly is a 2D game development framework for GNU Guile
@author David Thompson <dthompson@@member.fsf.org>
@page
@vskip 0pt plus 1filll
@@ -40,7 +40,7 @@ The document was typeset with
@ifnottex
@node Top
-@top Guile-2D
+@top Sly
@insertcopying
@end ifnottex
@@ -85,4 +85,4 @@ The document was typeset with
@bye
-@c guile-2d.texi ends here
+@c sly.texi ends here
diff --git a/examples/2048/2048 b/examples/2048/2048
index 58f2615..0bda152 100755
--- a/examples/2048/2048
+++ b/examples/2048/2048
@@ -32,18 +32,18 @@
(ice-9 match)
(ice-9 rdelim)
(gl)
- (2d audio)
- (2d color)
- (2d font)
- (2d game)
- (2d keyboard)
- (2d rect)
- (2d signal)
- (2d sprite)
- (2d texture)
- (2d vector)
- (2d window)
- (2d repl))
+ (sly audio)
+ (sly color)
+ (sly font)
+ (sly game)
+ (sly keyboard)
+ (sly rect)
+ (sly signal)
+ (sly sprite)
+ (sly texture)
+ (sly vector)
+ (sly window)
+ (sly repl))
;;;
;;; Helpers
;;;
@@ -470,7 +470,7 @@
;;; Initialization
;;;
-(start-2d-repl)
+(start-sly-repl)
(add-hook! window-close-hook stop-game-loop)
(add-hook! draw-hook (lambda (dt alpha) (render)))
diff --git a/examples/animation.scm b/examples/animation.scm
index 873b2de..04fc46e 100644
--- a/examples/animation.scm
+++ b/examples/animation.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -15,12 +15,12 @@
;;; along with this program. If not, see
;;; <http://www.gnu.org/licenses/>.
-(use-modules (2d animation)
- (2d game)
- (2d sprite)
- (2d tileset)
- (2d vector)
- (2d window))
+(use-modules (sly animation)
+ (sly game)
+ (sly sprite)
+ (sly tileset)
+ (sly vector)
+ (sly window))
(load "common.scm")
diff --git a/examples/common.scm b/examples/common.scm
index 62ddd14..03a0a28 100644
--- a/examples/common.scm
+++ b/examples/common.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -15,14 +15,14 @@
;;; along with this program. If not, see
;;; <http://www.gnu.org/licenses/>.
-(use-modules (2d agenda)
- (2d fps)
- (2d game)
- (2d keyboard)
- (2d repl)
- (2d signal)
- (2d sprite)
- (2d window))
+(use-modules (sly agenda)
+ (sly fps)
+ (sly game)
+ (sly keyboard)
+ (sly repl)
+ (sly signal)
+ (sly sprite)
+ (sly window))
(open-window)
(enable-sprites)
@@ -38,4 +38,4 @@
(format #t "FPS: ~d\n" (signal-ref fps)))
60)
-(start-2d-repl)
+(start-sly-repl)
diff --git a/examples/coroutine.scm b/examples/coroutine.scm
index 6db9623..ea7f881 100644
--- a/examples/coroutine.scm
+++ b/examples/coroutine.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -16,13 +16,13 @@
;;; <http://www.gnu.org/licenses/>.
(use-modules (srfi srfi-26)
- (2d agenda)
- (2d coroutine)
- (2d game)
- (2d sprite)
- (2d texture)
- (2d vector)
- (2d window))
+ (sly agenda)
+ (sly coroutine)
+ (sly game)
+ (sly sprite)
+ (sly texture)
+ (sly vector)
+ (sly window))
(load "common.scm")
diff --git a/examples/font.scm b/examples/font.scm
index 4a8412b..233ffda 100644
--- a/examples/font.scm
+++ b/examples/font.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -15,15 +15,15 @@
;;; along with this program. If not, see
;;; <http://www.gnu.org/licenses/>.
-(use-modules (2d agenda)
- (2d fps)
- (2d color)
- (2d font)
- (2d game)
- (2d mouse)
- (2d signal)
- (2d vector)
- (2d window))
+(use-modules (sly agenda)
+ (sly fps)
+ (sly color)
+ (sly font)
+ (sly game)
+ (sly mouse)
+ (sly signal)
+ (sly vector)
+ (sly window))
(load "common.scm")
diff --git a/examples/particles.scm b/examples/particles.scm
index 8fa9cb6..a6c19a7 100644
--- a/examples/particles.scm
+++ b/examples/particles.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -17,12 +17,12 @@
(use-modules (srfi srfi-1)
(srfi srfi-9)
- (2d agenda)
- (2d game)
- (2d sprite)
- (2d texture)
- (2d vector)
- (2d window))
+ (sly agenda)
+ (sly game)
+ (sly sprite)
+ (sly texture)
+ (sly vector)
+ (sly window))
(load "common.scm")
diff --git a/examples/simple.scm b/examples/simple.scm
index 3f3c881..6fece03 100644
--- a/examples/simple.scm
+++ b/examples/simple.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -15,10 +15,10 @@
;;; along with this program. If not, see
;;; <http://www.gnu.org/licenses/>.
-(use-modules (2d game)
- (2d sprite)
- (2d vector)
- (2d window))
+(use-modules (sly game)
+ (sly sprite)
+ (sly vector)
+ (sly window))
(load "common.scm")
diff --git a/examples/tilemap.scm b/examples/tilemap.scm
index 5c5abdf..7f2b48e 100644
--- a/examples/tilemap.scm
+++ b/examples/tilemap.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -18,12 +18,12 @@
(use-modules (srfi srfi-1)
(srfi srfi-9)
(srfi srfi-42)
- (2d game)
- (2d sprite)
- (2d texture)
- (2d tileset)
- (2d vector)
- (2d window))
+ (sly game)
+ (sly sprite)
+ (sly texture)
+ (sly tileset)
+ (sly vector)
+ (sly window))
(load "common.scm")
diff --git a/pre-inst-env.in b/pre-inst-env.in
index f614211..e677322 100644
--- a/pre-inst-env.in
+++ b/pre-inst-env.in
@@ -1,12 +1,12 @@
#!/bin/sh
-# guile-2d
+# Sly
# Copyright © 2014 David Thompson <dthompson2@worcester.edu>
#
-# guile-2d is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
+# Sly is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/sandbox b/sandbox
index 68302f9..94cfba5 100755
--- a/sandbox
+++ b/sandbox
@@ -2,7 +2,7 @@
-L . -s
!#
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -19,32 +19,32 @@
;;; along with this program. If not, see
;;; <http://www.gnu.org/licenses/>.
-;; Include almost every guile-2d module for convenience.
-(use-modules (2d agenda)
- (2d audio)
- (2d color)
- (2d coroutine)
- (2d font)
- (2d fps)
- (2d game)
- (2d keyboard)
- (2d mouse)
- (2d rect)
- (2d signal)
- (2d sprite)
- (2d texture)
- (2d transform)
- (2d vector2)
- (2d window)
- (2d repl))
+;; Include almost every Sly module for convenience.
+(use-modules (sly agenda)
+ (sly audio)
+ (sly color)
+ (sly coroutine)
+ (sly font)
+ (sly fps)
+ (sly game)
+ (sly keyboard)
+ (sly mouse)
+ (sly rect)
+ (sly signal)
+ (sly sprite)
+ (sly texture)
+ (sly transform)
+ (sly vector2)
+ (sly window)
+ (sly repl))
-(start-2d-repl)
+(start-sly-repl)
(add-hook! window-close-hook stop-game-loop)
-(display "Welcome to the guile-2d sandbox. Happy hacking!\n")
+(display "Welcome to the Sly sandbox. Happy hacking!\n")
-(with-window (make-window #:title "Guile-2D Sandbox")
+(with-window (make-window #:title "Sly Sandbox")
(start-game-loop))
(display "Bye!\n")
diff --git a/2d/agenda.scm b/sly/agenda.scm
index ab36f23..016101b 100644
--- a/2d/agenda.scm
+++ b/sly/agenda.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,12 +21,12 @@
;;
;;; Code:
-(define-module (2d agenda)
+(define-module (sly agenda)
#:use-module (ice-9 q)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-26)
- #:use-module (2d coroutine)
+ #:use-module (sly coroutine)
#:export (make-agenda
agenda?
agenda-time
diff --git a/2d/animation.scm b/sly/animation.scm
index 4998036..d9ac11c 100644
--- a/2d/animation.scm
+++ b/sly/animation.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,9 +21,9 @@
;;
;;; Code:
-(define-module (2d animation)
+(define-module (sly animation)
#:use-module (srfi srfi-9)
- #:use-module (2d texture))
+ #:use-module (sly texture))
;;;
;;; Animations
diff --git a/2d/audio.scm b/sly/audio.scm
index 3accb8b..715df11 100644
--- a/2d/audio.scm
+++ b/sly/audio.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,7 +21,7 @@
;;
;;; Code:
-(define-module (2d audio)
+(define-module (sly audio)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-2)
#:use-module ((sdl mixer) #:prefix SDL:)
diff --git a/sly/cache.scm b/sly/cache.scm
new file mode 100644
index 0000000..32429c8
--- /dev/null
+++ b/sly/cache.scm
@@ -0,0 +1,91 @@
+;;; Sly
+;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
+;;;
+;;; This program is free software: you can redistribute it and/or
+;;; modify it under the terms of the GNU General Public License as
+;;; published by the Free Software Foundation, either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program. If not, see
+;;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Asset cache.
+;;
+;;; Code:
+
+(define-module (sly cache)
+ #:use-module (srfi srfi-9)
+ #:export (make-cache
+ cache?
+ cache-ref
+ cache-set!
+ cached?
+ cached))
+
+(define-record-type <cache>
+ (%make-cache table max-size)
+ cache?
+ (table cache-table)
+ (max-size cache-max-size))
+
+(define (make-cache max-size)
+ (%make-cache (make-weak-key-hash-table) max-size))
+
+(define (cache-miss! cache proc args)
+ (let ((results (call-with-values (lambda ()
+ (apply proc args))
+ list)))
+ (hash-set! (cache-table cache) (cons proc args) results)
+ results))
+
+(define (cache-ref cache proc args)
+ (hash-ref (cache-table cache) (cons proc args)))
+
+(define (cached cache proc . args)
+ (apply values (or (cache-ref cache proc args)
+ (cache-miss! cache proc args))))
+
+(define (cache-clear! cache)
+ (hash-clear! (cache-table cache)))
+
+(define-syntax-rule (define-cached (name arg ...)
+ default-cache docstring body ...)
+ (define (name arg ...)
+ docstring
+ (cached default-cache (lambda (arg ...) body ...) arg ...)))
+
+(define font-cache (make-cache 100))
+
+(define-cached (load-font filename) font-cache
+ "Hello."
+ (display "load!\n")
+ (format #f "loaded font ~a" filename))
+
+(define texture-cache (make-cache 100))
+
+(define (%load-texture filename)
+ (display "load!\n")
+ (format #f "~a loaded" filename))
+
+(define (load-texture filename)
+ (cached texture-cache %load-texture filename))
+
+(load-texture "foo.jpg")
+
+(cached texture-cache "bar" (load-texture "foo"))
+
+(define-cached (load-texture filename)
+ ())
+
+(load-cache 'image "images/p1_front.png")
+(load-asset cache 'font "fonts/sans.ttf" 16)
+
+(load-asset 'clear)
diff --git a/2d/color.scm b/sly/color.scm
index d3aba00..c8ba248 100644
--- a/2d/color.scm
+++ b/sly/color.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,11 +21,11 @@
;;
;;; Code:
-(define-module (2d color)
+(define-module (sly color)
#:use-module (gl)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-1)
- #:use-module (2d math)
+ #:use-module (sly math)
#:export (<color>
make-color
color?
diff --git a/2d/config.scm.in b/sly/config.scm
index e62a2b1..c8e6dfa 100644
--- a/2d/config.scm.in
+++ b/sly/config.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; Guile-2d is free software: you can redistribute it and/or modify it
@@ -21,8 +21,8 @@
;;
;;; Code:
-(define-module (2d config)
+(define-module (sly config)
#:export (%pkgdatadir))
(define %pkgdatadir
- (or (getenv "GUILE_2D_PKGDATADIR") "@pkgdatadir@"))
+ (or (getenv "GUILE_2D_PKGDATADIR") "/usr/share/sly"))
diff --git a/sly/config.scm.in b/sly/config.scm.in
new file mode 100644
index 0000000..b296492
--- /dev/null
+++ b/sly/config.scm.in
@@ -0,0 +1,28 @@
+;;; Sly
+;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
+;;;
+;;; Sly is free software: you can redistribute it and/or modify it
+;;; under the terms of the GNU Lesser General Public License as
+;;; published by the Free Software Foundation, either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; Sly is distributed in the hope that it will be useful, but WITHOUT
+;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+;;; Public License for more details.
+;;;
+;;; You should have received a copy of the GNU Lesser General Public
+;;; License along with this program. If not, see
+;;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Build time configuration.
+;;
+;;; Code:
+
+(define-module (sly config)
+ #:export (%pkgdatadir))
+
+(define %pkgdatadir
+ (or (getenv "GUILE_2D_PKGDATADIR") "@pkgdatadir@"))
diff --git a/2d/coroutine.scm b/sly/coroutine.scm
index b8e1df9..6884028 100644
--- a/2d/coroutine.scm
+++ b/sly/coroutine.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,7 +21,7 @@
;;
;;; Code:
-(define-module (2d coroutine)
+(define-module (sly coroutine)
#:export (call-with-coroutine
coroutine
colambda
diff --git a/2d/event.scm b/sly/event.scm
index 7badf72..c5e57cb 100644
--- a/2d/event.scm
+++ b/sly/event.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,7 +21,7 @@
;;
;;; Code:
-(define-module (2d event)
+(define-module (sly event)
#:use-module ((sdl sdl) #:prefix SDL:)
#:export (process-events
register-event-handler))
diff --git a/2d/font.scm b/sly/font.scm
index 909f351..e61adbc 100644
--- a/2d/font.scm
+++ b/sly/font.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,7 +21,7 @@
;;
;;; Code:
-(define-module (2d font)
+(define-module (sly font)
#:use-module (srfi srfi-2)
#:use-module (srfi srfi-9)
#:use-module (system foreign)
@@ -29,14 +29,14 @@
#:use-module ((sdl ttf) #:prefix SDL:)
#:use-module (gl)
#:use-module (gl contrib packed-struct)
- #:use-module (2d color)
- #:use-module (2d config)
- #:use-module (2d shader)
- #:use-module (2d signal)
- #:use-module (2d texture)
- #:use-module (2d vector)
- #:use-module (2d window)
- #:use-module (2d wrappers gl)
+ #:use-module (sly color)
+ #:use-module (sly config)
+ #:use-module (sly shader)
+ #:use-module (sly signal)
+ #:use-module (sly texture)
+ #:use-module (sly vector)
+ #:use-module (sly window)
+ #:use-module (sly wrappers gl)
#:export (enable-fonts
load-font
load-default-font
@@ -78,7 +78,7 @@
(error "File not found!" filename)))
(define* (load-default-font #:optional (point-size 12))
- "Load the guile-2d default TTF font. POINT-SIZE is an optional
+ "Load the Sly default TTF font. POINT-SIZE is an optional
argument with a default value of 12."
(load-font (string-append %pkgdatadir "/fonts/DejaVuSans.ttf") point-size))
diff --git a/2d/fps.scm b/sly/fps.scm
index 12e652e..d6ff374 100644
--- a/2d/fps.scm
+++ b/sly/fps.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,9 +21,9 @@
;;
;;; Code:
-(define-module (2d fps)
- #:use-module (2d game)
- #:use-module (2d signal)
+(define-module (sly fps)
+ #:use-module (sly game)
+ #:use-module (sly signal)
#:export (fps))
;; Current frames per second
diff --git a/2d/game.scm b/sly/game.scm
index d6a0345..9bc3c52 100644
--- a/2d/game.scm
+++ b/sly/game.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,15 +21,15 @@
;;
;;; Code:
-(define-module (2d game)
+(define-module (sly game)
#:use-module (srfi srfi-9)
#:use-module ((sdl sdl) #:prefix SDL:)
#:use-module (gl)
- #:use-module (2d agenda)
- #:use-module (2d event)
- #:use-module (2d math)
- #:use-module (2d signal)
- #:use-module (2d window)
+ #:use-module (sly agenda)
+ #:use-module (sly event)
+ #:use-module (sly math)
+ #:use-module (sly signal)
+ #:use-module (sly window)
#:export (tick-interval
max-ticks-per-frame
draw-hook
diff --git a/2d/helpers.scm b/sly/helpers.scm
index 4082377..062cbb1 100644
--- a/2d/helpers.scm
+++ b/sly/helpers.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;; Copyright (C) 2014 Ludovic Courtès <ludo@gnu.org>
;;;
@@ -22,11 +22,11 @@
;;
;;; Code:
-(define-module (2d helpers)
+(define-module (sly helpers)
#:use-module (srfi srfi-1)
#:use-module (rnrs arithmetic bitwise)
- #:use-module (2d agenda)
- #:use-module (2d game)
+ #:use-module (sly agenda)
+ #:use-module (sly game)
#:export (any-equal?
logand?
define-guardian
diff --git a/2d/keyboard.scm b/sly/keyboard.scm
index 97bc20a..65ad940 100644
--- a/2d/keyboard.scm
+++ b/sly/keyboard.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,11 +21,11 @@
;;
;;; Code:
-(define-module (2d keyboard)
+(define-module (sly keyboard)
#:use-module ((sdl sdl) #:prefix SDL:)
- #:use-module (2d event)
- #:use-module (2d signal)
- #:use-module (2d vector)
+ #:use-module (sly event)
+ #:use-module (sly signal)
+ #:use-module (sly vector)
#:export (key-press-hook
key-release-hook
key-last-down
diff --git a/2d/live-reload.scm b/sly/live-reload.scm
index 265fa1f..78c4cf7 100644
--- a/2d/live-reload.scm
+++ b/sly/live-reload.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,11 +21,11 @@
;;
;;; Code:
-(define-module (2d live-reload)
+(define-module (sly live-reload)
#:use-module (srfi srfi-1)
- #:use-module (2d agenda)
- #:use-module (2d coroutine)
- #:use-module (2d signal)
+ #:use-module (sly agenda)
+ #:use-module (sly coroutine)
+ #:use-module (sly signal)
#:export (live-reload-interval
live-reload))
diff --git a/sly/lru-cache.scm b/sly/lru-cache.scm
new file mode 100644
index 0000000..1a960a3
--- /dev/null
+++ b/sly/lru-cache.scm
@@ -0,0 +1,54 @@
+;;; Sly
+;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
+;;;
+;;; This program is free software: you can redistribute it and/or
+;;; modify it under the terms of the GNU General Public License as
+;;; published by the Free Software Foundation, either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program. If not, see
+;;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Least recently used cache implementation.
+;;
+;;; Code:
+
+(define-module (sly lru-cache)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-9))
+
+(define (memoize/lru proc max-size)
+ (let ((cache (make-hash-table))
+ (keys '())
+ (size 0))
+ (lambda args
+ (let ((results (hash-ref cache args)))
+ (if results
+ (apply values results)
+ (let ((results (call-with-values (lambda ()
+ (apply proc args))
+ list)))
+ (hash-set! cache args results)
+ (set! size (1+ size))
+ (apply values results)))))))
+
+(define (memoize proc)
+ "Return a memoizing version of PROC."
+ (let ((cache (make-hash-table)))
+ (lambda args
+ (let ((results (hash-ref cache args)))
+ (if results
+ (apply values results)
+ (let ((results (call-with-values (lambda ()
+ (apply proc args))
+ list)))
+ (hash-set! cache args results)
+ (apply values results)))))))
diff --git a/2d/math.scm b/sly/math.scm
index ba8d88e..8f7ce71 100644
--- a/2d/math.scm
+++ b/sly/math.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,7 +21,7 @@
;;
;;; Code:
-(define-module (2d math)
+(define-module (sly math)
#:export (pi
degrees->radians
radians->degrees
diff --git a/sly/mode.scm b/sly/mode.scm
new file mode 100644
index 0000000..eea3068
--- /dev/null
+++ b/sly/mode.scm
@@ -0,0 +1,22 @@
+(define-module (sly mode)
+ #:use-module (srfi srfi-9))
+
+(define-record-type <mode>
+ (make-mode module vars)
+ mode?
+ (module mode-module)
+ (vars mode-vars))
+
+(define foo-mode
+ (make-mode
+ (current-module)
+ (variables
+ ((foo 100)))))
+
+(define-mode foo-mode
+ )
+
+(module-define! (current-module) 'foo 10)
+foo
+
+(make-variable)
diff --git a/2d/mouse.scm b/sly/mouse.scm
index 388b139..6ac56d2 100644
--- a/2d/mouse.scm
+++ b/sly/mouse.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,11 +21,11 @@
;;
;;; Code:
-(define-module (2d mouse)
+(define-module (sly mouse)
#:use-module ((sdl sdl) #:prefix SDL:)
- #:use-module (2d event)
- #:use-module (2d signal)
- #:use-module (2d vector)
+ #:use-module (sly event)
+ #:use-module (sly signal)
+ #:use-module (sly vector)
#:export (mouse-move-hook
mouse-press-hook
mouse-click-hook
diff --git a/sly/primitives.scm b/sly/primitives.scm
new file mode 100644
index 0000000..f5e08ca
--- /dev/null
+++ b/sly/primitives.scm
@@ -0,0 +1,120 @@
+ ; primitives.scm
+
+(define-module (sly primitives)
+ #:use-module (srfi srfi-1)
+ #:use-module (gl)
+ #:use-module (gl contrib packed-struct)
+ #:use-module ((sdl sdl) #:prefix SDL:)
+ #:use-module (srfi srfi-9)
+ #:use-module (sly color)
+ #:use-module (sly vector)
+ #:export (make-primitive
+ primitive?
+ primitive-vectors
+ primitive-mode
+ make-rectangle
+ make-triangle
+ make-line
+ make-line-strip
+ draw-primitive
+ draw-outline
+ draw-points))
+
+;;;
+;;; Vertex arrays for primitives.
+;;;
+
+(define-packed-struct primitive-vertex
+ (x float)
+ (y float))
+
+(define (make-vertex-array vertices)
+ "Create a vertex-array usable by (gl-draw-arrays) from `vertices`."
+ (define (for-each-counter f l)
+ (fold (lambda (elem counter)
+ (f elem counter)
+ (+ counter 1))
+ 0
+ l))
+ (define (pack-array array offset)
+ (for-each-counter (lambda (vertex offset)
+ (pack array offset primitive-vertex
+ (vx vertex)
+ (vy vertex)))
+ vertices))
+ (let ((vertex-list (make-packed-array primitive-vertex
+ (length vertices))))
+ (pack-array vertex-list 0)
+ vertex-list))
+
+(define (draw-vertices vertex-array count mode)
+ "Draw `count` vertices from `vertex-array` using the mode `mode`.
+`vertex-array` should be an array of packed `primitive-vertex` structs."
+ (let ((pointer-type (tex-coord-pointer-type float)))
+ (gl-enable-client-state (enable-cap vertex-array))
+ (set-gl-vertex-array pointer-type
+ vertex-array
+ 2
+ #:stride (packed-struct-size primitive-vertex)
+ #:offset (packed-struct-offset primitive-vertex x))
+ (gl-draw-arrays mode 0 count)
+ (gl-disable-client-state (enable-cap vertex-array))))
+
+;;;
+;;; Primitives
+;;;
+
+;; Object for drawing lines, polygons, points, etc.
+(define-record-type <primitive>
+ (%make-primitive color vectors vertex-array mode count)
+ primitive?
+ (vectors primitive-vectors)
+ (vertex-array primitive-vertex-array)
+ (mode primitive-mode)
+ (count primitive-vector-count))
+
+(define* (draw-primitive primitive #:optional mode)
+ "Draw the primitive `primitive` using the optional mode `mode`."
+ (let ((mode (if mode mode (primitive-mode primitive)))
+ (vertex-array (primitive-vertex-array primitive)))
+ (use-color (primitive-color primitive))
+ (draw-vertices vertex-array
+ (primitive-vector-count primitive)
+ mode)))
+
+(define (draw-outline primitive)
+ "Draw the vertices of `primitive` as a line-loop,
+which effectively draws the outline of a shape."
+ (draw-primitive primitive
+ (begin-mode line-loop)))
+
+(define (draw-points primitive)
+ "Draw the vertices of `primitive` as points."
+ (draw-primitive primitive
+ (begin-mode points)))
+
+(define (make-primitive color vectors mode)
+ "Create a new primitive object. `vectors` should be a list
+of vectors that will be drawn when the object is drawn, and
+`mode` should be a value from (begin-mode) (quads, triangles,
+etc.)."
+ (%make-primitive color vectors (make-vertex-array vectors)
+ mode (length vectors)))
+
+(define (make-polygon color vectors)
+ "Take a list of vectors and return a primitive object."
+ (make-primitive color vectors (begin-mode polygon)))
+
+(define (make-rectangle color v1 v2 v3 v4)
+ (make-primitive color (list v1 v2 v3 v4) (begin-mode quads)))
+
+(define (make-triangle color v1 v2 v3)
+ (make-primitive color (list v1 v2 v3) (begin-mode triangles)))
+
+(define (make-line-strip color vectors)
+ (if (< (length vectors) 2)
+ (error "Not enough vectors given to draw a line!")
+ (make-primitive color vectors (begin-mode line-strip))))
+
+(define (make-line color v1 v2)
+ (make-line-strip color (list v1 v2)))
diff --git a/2d/rect.scm b/sly/rect.scm
index 3a74ae2..9b61299 100644
--- a/2d/rect.scm
+++ b/sly/rect.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -22,9 +22,9 @@
;;
;;; Code:
-(define-module (2d rect)
+(define-module (sly rect)
#:use-module (srfi srfi-9)
- #:use-module (2d vector)
+ #:use-module (sly vector)
#:export (<rect>
make-rect
null-rect
diff --git a/2d/repl.scm b/sly/repl.scm
index f48b6d2..312d89a 100644
--- a/2d/repl.scm
+++ b/sly/repl.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,13 +21,13 @@
;;
;;; Code:
-(define-module (2d repl)
+(define-module (sly repl)
#:use-module (system repl coop-server)
#:use-module (system repl server)
- #:use-module (2d agenda)
- #:export (start-2d-repl))
+ #:use-module (sly agenda)
+ #:export (start-sly-repl))
-(define* (start-2d-repl #:optional (port (make-tcp-server-socket #:port 37146)))
+(define* (start-sly-repl #:optional (port (make-tcp-server-socket #:port 37146)))
"Start a cooperative REPL server that listens on the given PORT. By
default, this port is 37146. Additionally, a process is scheduled to
poll the REPL server upon every tick of the game loop."
diff --git a/sly/scene-graph.scm b/sly/scene-graph.scm
new file mode 100644
index 0000000..de191fe
--- /dev/null
+++ b/sly/scene-graph.scm
@@ -0,0 +1,217 @@
+;;; Sly
+;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
+;;;
+;;; This program is free software: you can redistribute it and/or
+;;; modify it under the terms of the GNU General Public License as
+;;; published by the Free Software Foundation, either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program. If not, see
+;;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Scene graph API.
+;;
+;;; Code:
+
+(define-module (sly scene-graph)
+ #:use-module (ice-9 hash-table)
+ #:use-module (ice-9 match)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-9)
+ #:use-module (srfi srfi-26)
+ #:use-module (gl)
+ #:use-module (sly wrappers gl)
+ #:use-module (sly color)
+ #:use-module (sly rect)
+ #:use-module (sly signal)
+ #:use-module (sly transform)
+ #:use-module (sly vector)
+ #:export (make-scene-node
+ scene-node?
+ scene-node-transform
+ scene-node-color
+ scene-node-texture
+ scene-node-shader
+ scene-node-arrays
+ scene-node-children
+ draw-scene-node))
+
+;; Types of scene nodes:
+;; - Group: position, scale, rotation, children
+;; - Vertices: vertex arrays + style (shader, texture)
+
+;; All nodes have the following
+;; - transform
+;; - children
+;; - shader
+;; - texture
+;; - vertex array
+
+;; (define (sprite)
+;; (make-scene-node #:transform (make-transform* #:translate (vector2 100 100))
+;; #:color white
+;; #:texture (load-texture "images/p1_front.png")
+;; #:arrays `((vertex float ,vertices
+;; #:stride ,texture-vertex-size
+;; #:offset ,x-offset)
+;; (texture float ,vertices
+;; #:stride ,texture-vertex-size
+;; #:offset ,s-offset))
+;; #:shader sprite-shader))
+
+;;;
+;;; Meshes
+;;;
+
+(define-vertex sprite-vertex
+ (position vector2)
+ (texcoord vector2))
+
+
+
+(define-record-type <geometry>
+ (make-geometry primitive size arrays)
+ geometry?
+ (primitive geometry-primitive)
+ (size geometry-size)
+ (arrays geometry-arrays))
+
+(define gl-primitives
+ (alist->hash-table
+ '((points . 0)
+ (lines . 1)
+ (line-loop . 2)
+ (line-strip . 3)
+ (triangles . 4)
+ (triangle-strip . 5)
+ (triangle-fan . 6)
+ (quads . 7)
+ (quad-strip . 8)
+ (polygon . 9))))
+
+(define gl-arrays
+ (alist->hash-table
+ '((vertex-array . 32884)
+ (normal-array . 32885)
+ (color-array . 32886)
+ (index-array . 32887)
+ (texture-coord-array . 32888)
+ (edge-flag-array . 32889))))
+
+(define gl-types
+ (alist->hash-table
+ '((byte . 5120)
+ (unsigned-byte . 5121)
+ (short . 5122)
+ (unsigned-short . 5123)
+ (int . 5124)
+ (unsigned-int . 5125)
+ (float . 5126)
+ (#{2-bytes}# . 5127)
+ (#{3-bytes}# . 5128)
+ (#{4-bytes}# . 5129)
+ (double . 5130)
+ (double-ext . 5130))))
+
+(define (draw-geometry geometry)
+ (define (iter arrays)
+ (cond
+ ((null? arrays)
+ (let ((primitive (hash-ref gl-primitives (geometry-primitive geometry))))
+ (gl-draw-arrays primitive 0 (geometry-size geometry))))
+ (else
+ (match (car arrays)
+ ((array-type data-type vertices . rest)
+ (with-gl-client-state (hash-ref gl-arrays array-type)
+ (set-gl-vertex-array (hash-ref gl-types data-type) vertices)
+ (iter (cdr arrays))))))))
+ (iter (geometry-arrays geometry)))
+
+(define foo
+ '(vertex float #(1 2 3 4) #:stride 4 #:offset 8))
+
+(match foo
+ ((array-type data-type vertices . kwargs)
+ (format #t "~a ~a ~a\n" array-type data-type vertices)
+ (let lp ((kwargs kwargs))
+ (match kwargs
+ ((key value . rest)
+ (format #t "~a - ~a\n" key value)
+ (lp rest))
+ (_ #f)))))
+
+(define-record-type <scene-node>
+ (%make-scene-node transform color texture shader arrays children)
+ scene-node?
+ (transform scene-node-transform)
+ (color scene-node-color)
+ (texture scene-node-texture)
+ (shader scene-node-shader)
+ (arrays scene-node-arrays)
+ (primitive scene-node-primitive)
+ (children scene-node-children))
+
+(define* (make-scene-node #:optional #:key (transform identity-transform)
+ (color white) (texture #f) (shader #f)
+ (arrays '()) (children '()))
+ (%make-scene-node transform color texture shader arrays children))
+
+(define* (draw-scene-node node #:optional (transform identity-transform))
+ (let ((transform (transform* transform (scene-node-transform node))))
+ ;; WRITEME
+ (for-each (cut draw-scene-node <> transform)
+ (scene-node-children node))))
+
+(define (draw-arrays node)
+ #f)
+
+;; (define (draw-sprite transform)
+;; (display "drew a sprite\n"))
+
+;; (define (draw-label transform)
+;; (display "drew a label\n"))
+
+;; (define s
+;; (make-scene-node
+;; #:position (vector2 100 100)
+;; #:size (vector2 200 200)
+;; #:proc draw-sprite
+;; #:children
+;; (list (make-scene-node
+;; #:position (vector2 50 50)
+;; #:size (vector2 50 50)
+;; #:rotation 45
+;; #:proc draw-label))))
+
+;; (draw-scene-node s)
+
+;; (define scene
+;; (scene-graph
+;; (sprite
+;; (position (vector2 320 240))
+;; (texture "logo.png")
+;; (anchor 'center))
+;; (label
+;; (position (vector2 320 160))
+;; (text "Some Really Awesome Game")
+;; (anchor 'bottom-center))
+;; (group
+;; (position (vector2 160 300))
+;; (children
+;; (sprite
+;; (position (vector2 16 16))
+;; (texture "load-game.png"))
+;; (sprite
+;; (position (vector2 64 16))
+;; (texture "new-game.png"))
+;; (sprite
+;; (position (vector2 96 16))
+;; (texture "options.png"))))))
diff --git a/2d/shader.scm b/sly/shader.scm
index 56a4e03..167cee5 100644
--- a/2d/shader.scm
+++ b/sly/shader.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -15,7 +15,7 @@
;;; along with this program. If not, see
;;; <http://www.gnu.org/licenses/>.
-(define-module (2d shader)
+(define-module (sly shader)
#:use-module (system foreign)
#:use-module (rnrs bytevectors)
#:use-module (srfi srfi-1)
@@ -24,11 +24,11 @@
#:use-module (ice-9 rdelim)
#:use-module (gl)
#:use-module (gl low-level)
- #:use-module (2d helpers)
- #:use-module (2d transform)
- #:use-module (2d vector)
- #:use-module (2d color)
- #:use-module (2d wrappers gl)
+ #:use-module (sly helpers)
+ #:use-module (sly transform)
+ #:use-module (sly vector)
+ #:use-module (sly color)
+ #:use-module (sly wrappers gl)
#:export (make-shader
make-vertex-shader
make-fragment-shader
diff --git a/2d/signal.scm b/sly/signal.scm
index efbb103..a77e3bb 100644
--- a/2d/signal.scm
+++ b/sly/signal.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,11 +21,11 @@
;;
;;; Code:
-(define-module (2d signal)
+(define-module (sly signal)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-26)
- #:use-module (2d agenda)
+ #:use-module (sly agenda)
#:export (signal?
make-signal
define-signal
diff --git a/2d/sprite.scm b/sly/sprite.scm
index a672d58..3a304a6 100644
--- a/2d/sprite.scm
+++ b/sly/sprite.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -22,25 +22,25 @@
;;
;;; Code:
-(define-module (2d sprite)
+(define-module (sly sprite)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-9 gnu)
#:use-module (gl)
#:use-module (gl contrib packed-struct)
#:use-module ((sdl sdl) #:prefix SDL:)
- #:use-module (2d agenda)
- #:use-module (2d animation)
- #:use-module (2d color)
- #:use-module (2d config)
- #:use-module (2d helpers)
- #:use-module (2d math)
- #:use-module (2d shader)
- #:use-module (2d signal)
- #:use-module (2d texture)
- #:use-module (2d vector)
- #:use-module (2d window)
- #:use-module (2d wrappers gl)
+ #:use-module (sly agenda)
+ #:use-module (sly animation)
+ #:use-module (sly color)
+ #:use-module (sly config)
+ #:use-module (sly helpers)
+ #:use-module (sly math)
+ #:use-module (sly shader)
+ #:use-module (sly signal)
+ #:use-module (sly texture)
+ #:use-module (sly vector)
+ #:use-module (sly window)
+ #:use-module (sly wrappers gl)
#:export (enable-sprites
make-sprite
sprite?
diff --git a/2d/texture.scm b/sly/texture.scm
index bd7bea6..bea005d 100644
--- a/2d/texture.scm
+++ b/sly/texture.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -22,15 +22,15 @@
;;
;;; Code:
-(define-module (2d texture)
+(define-module (sly texture)
#:use-module (srfi srfi-9)
#:use-module (gl)
#:use-module (gl contrib packed-struct)
- #:use-module (2d color)
- #:use-module (2d helpers)
- #:use-module (2d vector)
- #:use-module (2d wrappers gl)
- #:use-module (2d wrappers freeimage)
+ #:use-module (sly color)
+ #:use-module (sly helpers)
+ #:use-module (sly vector)
+ #:use-module (sly wrappers gl)
+ #:use-module (sly wrappers freeimage)
#:export (make-texture
make-texture-region
load-texture
diff --git a/2d/tileset.scm b/sly/tileset.scm
index 669372b..f66b6a8 100644
--- a/2d/tileset.scm
+++ b/sly/tileset.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -22,10 +22,10 @@
;;
;;; Code:
-(define-module (2d tileset)
+(define-module (sly tileset)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-42)
- #:use-module (2d texture)
+ #:use-module (sly texture)
#:export (<tileset>
make-tileset
load-tileset
diff --git a/2d/transform.scm b/sly/transform.scm
index 21be955..afb8d97 100644
--- a/2d/transform.scm
+++ b/sly/transform.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,12 +21,12 @@
;;
;;; Code:
-(define-module (2d transform)
+(define-module (sly transform)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-42)
- #:use-module (2d math)
- #:use-module (2d vector)
+ #:use-module (sly math)
+ #:use-module (sly vector)
#:export (make-transform null-transform identity-transform
transform? transform-matrix
transpose transform-vector2
diff --git a/2d/vector.scm b/sly/vector.scm
index 302f62b..ecaad2a 100644
--- a/2d/vector.scm
+++ b/sly/vector.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2014 David Thompson <davet@gnu.org>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,7 +21,7 @@
;;
;;; Code:
-(define-module (2d vector)
+(define-module (sly vector)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
diff --git a/2d/window.scm b/sly/window.scm
index 126d1a2..31ec703 100644
--- a/2d/window.scm
+++ b/sly/window.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,15 +21,15 @@
;;
;;; Code:
-(define-module (2d window)
+(define-module (sly window)
#:use-module (srfi srfi-9)
#:use-module (gl)
#:use-module ((sdl sdl) #:prefix SDL:)
#:use-module ((sdl mixer) #:prefix SDL:)
- #:use-module (2d event)
- #:use-module (2d signal)
- #:use-module (2d transform)
- #:use-module (2d vector)
+ #:use-module (sly event)
+ #:use-module (sly signal)
+ #:use-module (sly transform)
+ #:use-module (sly vector)
#:export (make-window
window?
window-title
@@ -53,7 +53,7 @@
(fullscreen? window-fullscreen?))
(define* (make-window #:optional #:key
- (title "Guile-2D Window")
+ (title "Sly Window")
(resolution #(640 480))
(fullscreen? #f))
(%make-window title resolution fullscreen?))
diff --git a/2d/wrappers/freeimage.scm b/sly/wrappers/freeimage.scm
index 544bf51..9680460 100644
--- a/2d/wrappers/freeimage.scm
+++ b/sly/wrappers/freeimage.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,9 +21,9 @@
;;
;;; Code:
-(define-module (2d wrappers freeimage)
+(define-module (sly wrappers freeimage)
#:use-module (system foreign)
- #:use-module (2d wrappers util)
+ #:use-module (sly wrappers util)
#:use-module (ice-9 format))
(define libfreeimage (dynamic-link "libfreeimage"))
diff --git a/2d/wrappers/gl.scm b/sly/wrappers/gl.scm
index 3ee84dd..4a9b2fa 100644
--- a/2d/wrappers/gl.scm
+++ b/sly/wrappers/gl.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -22,7 +22,7 @@
;;
;;; Code:
-(define-module (2d wrappers gl)
+(define-module (sly wrappers gl)
#:use-module ((gl low-level) #:renamer (symbol-prefix-proc '%))
#:use-module (gl runtime)
#:use-module (gl types))
diff --git a/2d/wrappers/util.scm b/sly/wrappers/util.scm
index 254dc3a..b2dcbb4 100644
--- a/2d/wrappers/util.scm
+++ b/sly/wrappers/util.scm
@@ -1,4 +1,4 @@
-;;; guile-2d
+;;; Sly
;;; Copyright (C) 2013, 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -21,7 +21,7 @@
;;
;;; Code:
-(define-module (2d wrappers util)
+(define-module (sly wrappers util)
#:export (define-enumeration))
;; Borrowed from guile-opengl