summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-09-18 18:34:19 -0400
committerDavid Thompson <dthompson@member.fsf.org>2013-09-18 18:34:19 -0400
commitca3c0f6fb63ea9f51a6ef546345ee301d1ea19b9 (patch)
tree6641bf8a28737bb88bbe451fc2fa246c0d091684
parent07ec99199bf30b0e940750899667453c95c1c4c5 (diff)
Clean up docstrings for texture module.
-rw-r--r--2d/texture.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/2d/texture.scm b/2d/texture.scm
index 66d158b..7d0f7bd 100644
--- a/2d/texture.scm
+++ b/2d/texture.scm
@@ -62,15 +62,23 @@
(t2 texture-t2))
(define (texture-region? texture)
+ "Return #t if TEXTURE has a parent texture."
(texture? (texture-parent texture)))
(define (make-texture id parent width height s1 t1 s2 t2)
+ "Create a new texture object. ID is the OpenGL texture id. PARENT is
+a texture object (if this texture only represents a region of another
+texture) or #f. WIDTH and HEIGHT are the texture dimensions in
+pixels. S1, T1, S2, and T2 are the OpenGL texture coordinates
+representing the area of the texture that will be rendered."
(let ((texture (%make-texture id parent width height s1 t1 s2 t2)))
(texture-guardian texture)
texture))
(define (make-texture-region texture x y width height)
- "Creates a new texture region given a texture and a pixel region."
+ "Creates new texture region object. TEXTURE is the region's parent
+texture. X, Y, WIDTH, and HEIGHT represent the region of the texture
+that will be rendered, in pixels."
(let* ((w (texture-width texture))
(h (texture-height texture)))
(make-texture (texture-id texture)
@@ -144,7 +152,7 @@
32bit-bitmap))
(define (load-texture filename)
- "Loads a texture from a file."
+ "Load a texture from an image file at FILENAME."
(let* ((bitmap (load-bitmap filename))
(texture (bitmap->texture bitmap)))
(freeimage-unload bitmap)