summaryrefslogtreecommitdiff
path: root/sly/window.scm
Commit message (Collapse)AuthorAgeFilesLines
* math: Rewrite vector math library to use packed f64 bytevectors.David Thompson2016-02-271-1/+2
| | | | | | | | | | | | | | | | | | | | The big consequence of this change to the rest of the codebase is that we can no longer use record destructuring when pattern matching, so I had to rewrite every place where pattern matching was used. It was probably a bad idea to expose the record type descriptors publicly in the first place. * sly/math/vector.scm: Reimplement everything in terms of an f64 packed bytevector record type. Do not expose record type descriptors. * sly/game.scm (run-game-loop): Convert viewport width/height to exact numbers. * sly/window.scm (open-window): Likewise. * sly/input/mouse.scm (mouse-position): Rewrite pattern matching. * sly/math/quaternion (make-quaternion, vector->quaternion): Likewise. * sly/math/rect.scm (rect-clamp): Likewise. * sly/math/transform.scm (translate!, translate, scale): Likewise. * sly/render/mesh.scm (vertices-bytevector): Likewise. * examples/mines/mines.scm: Likewise.
* window: Initialize SDL window before opening.David Thompson2016-02-051-0/+2
| | | | | * sly/window.scm (open-window): Initialize SDL2 and the window before modifying it.
* window: Configure various OpenGL parameters.David Thompson2016-01-121-1/+6
| | | | | * sly/window.scm (init-window): Set OpenGL version to 3.2, explicitly set double buffering and vsync, and configure depth buffer size.
* window: Respect fullscreen setting.David Thompson2016-01-121-0/+1
| | | | | | | Rather than, you know, ignoring it completely. * sly/window.scm (open-window): Set the window to fullscreen mode, if requested.
* Upgrade to SDL2!David Thompson2015-12-221-32/+35
| | | | | | This commit is massive and crazy and I'm not going to do the usual GNU ChangeLog thing because it's just too much. Let's just be happy that the port is completed!
* window: Throw an exception when SDL window cannot be opened.David Thompson2015-03-171-1/+2
| | | | | * sly/window.scm (open-window): Throw error when 'SDL:set-video-mode' fails.
* window: Fix outdated docstring.David Thompson2015-01-191-1/+1
| | | | * sly/window.scm (close-window): Remove mention of audio in docstring.
* math: Move transform module to sly/math directory.David Thompson2014-11-081-1/+1
| | | | | | | | | | | | | * sly/transform.scm: Delete. * sly/render/transform.scm: New file. * Makefile.am (SOURCES): Add new file. Delete old one. * sly/render/camera.scm: Use (sly math transform). * sly/render/mesh.scm: Likewise. * sly/render/renderer.scm: Likewise. * sly/render/scene.scm: Likewise. * sly/render/shader.scm: Likewise. * sly/window.scm: Likewise. * examples/simple.scm: Likewise.
* Rewrite vector math module.David Thompson2014-10-011-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * .gitignore: Ignore '*.log' files. * sly/vector.scm: Delete file. * sly/math/vector.scm: New file. * tests/math/vector.scm: New file. * Makefile.am: Add new file and remove the old one. * sly/font.scm: Remove import. * sly/game.scm: Change import. * sly/joystick.scm (make-directional-signal-raw, make-directional): Use 'vector2'. * sly/keyboard.scm (key-directions): Use 'vector2'. * sly/mesh.scm (vertices-bytevector): Use new vector procedures. * sly/mouse.scm (mouse-position): Use 'vector2'. * sly/quaternion.scm (axis-angle->quaternion, quaternion->vector, vector->quaternion): Use new vector procedures. * sly/rect.scm (rect-position, rect-top-right, rect-bottom-left, rect-bottom-right, rect-center, rect-size): Use 'vector2'. * sly/scene.scm (make-scene-node): Use 'vector2'. * sly/shader.scm: Change import. * sly/shape.scm (make-cube): Use new vector procedures. * sly/sprite.scm (make-sprite): Use new vector procedures. * sly/texture.scm (anchor-texture): Use 'vector2'. * sly/transform.scm (transform-vector2): Use 'vector2'. (translate, scale): Use new vector procedures. * sly/transition.scm (guess-interpolator): Use new vector procedures. * sly/window.scm (make-window, window-size, open-window): Use 'vector2'.
* camera: Add before/after draw handlers.David Thompson2014-09-061-10/+1
| | | | | | | | | | | * sly/camera.scm (camera-before-draw-handler, camera-after-draw-handler): New procedures. (make-camera): Add before-draw and after-draw keyword parameters. (orthographic-camera): Use #:allow-other-keys. (run-handler): New procedure. (draw-camera): Enable/disable GL features before/after drawing and run handlers. * sly/window.scm (open-window): Remove calls to GL procedures.
* Enable OpenGL scissor test.David Thompson2014-08-251-0/+1
| | | | * sly/window.scm (open-window): Enable GL scissor test.
* Reset video mode when window is resized.David Thompson2014-08-251-3/+5
| | | | * 2d/window.scm: Reset SDL video mode when video-resize is triggered.
* Enable GL face culling and depth test.David Thompson2014-08-251-0/+2
| | | | * 2d/window.scm (open-window): Enable cull-face and depth-test.
* Rename guile-2d to Sly!David Thompson2014-06-281-0/+118
Massive find/replace job.