guile-sdl2.git
3 years agosurface: Add binding for SDL_ConvertSurfaceFormat.
David Thompson [Tue, 22 Dec 2015 14:00:20 +0000 (09:00 -0500)] 
surface: Add binding for SDL_ConvertSurfaceFormat.

* sdl2/bindings.scm: Add a ton of pixel format constants.
* sdl2/surface.scm: (symbol->sdl-pixel-format, convert-surface-format):
  New procedures.

3 years agoUpdate Guix package recipe.
David Thompson [Mon, 21 Dec 2015 21:42:44 +0000 (16:42 -0500)] 
Update Guix package recipe.

3 years agoevents: window: Change vector from pair to list.
David Thompson [Mon, 21 Dec 2015 20:53:58 +0000 (15:53 -0500)] 
events: window: Change vector from pair to list.

This is consistent with representing coordinate pairs as lists
elsewhere in the library.

* sdl2/events.scm (parse-window-event): Change vector from pair to list.

3 years agoevents: window: Add additional predicates.
David Thompson [Mon, 21 Dec 2015 20:53:01 +0000 (15:53 -0500)] 
events: window: Add additional predicates.

* sdl2/events.scm (window-shown-event?, window-hidden-event?,
window-exposed-event?, window-moved-event?, window-resized-event?,
window-size-changed-event?, window-minimized-event?,
window-maximized-event?, window-restored-event?, window-enter-event?,
window-leave-event?, window-focus-gained-event?,
window-focus-lost-event?, window-closed-event?): New procedures.

3 years agoevents: Add quit event.
David Thompson [Mon, 21 Dec 2015 16:40:38 +0000 (11:40 -0500)] 
events: Add quit event.

* sdl2/events.scm (<quit-event>): New record type.
(make-quit-event, quit-event?, quit-event-timestamp, parse-quit-event):
New procedures.
(poll-event): Add support for SDL_QUIT events.

3 years agoevents: keyboard: Correct exported symbols.
David Thompson [Mon, 21 Dec 2015 16:38:45 +0000 (11:38 -0500)] 
events: keyboard: Correct exported symbols.

Exported the wrong symbol for the key symbol, and forgot to export
symbols for selecting scancode and modifiers.

* sdl2/events.scm: Remove export to nonexistent keyboard-event-keysym.
  Export keyboard-event-key, keyboard-event-scancode, and
  keyboard-event-modifiers.

3 years agoUpdate README.
David Thompson [Sun, 20 Dec 2015 21:16:29 +0000 (16:16 -0500)] 
Update README.

3 years agosurface: Add useful selectors.
David Thompson [Sun, 20 Dec 2015 21:03:03 +0000 (16:03 -0500)] 
surface: Add useful selectors.

* sdl2/surface.scm (pointer-int-ref, surface-width, surface-height)
(surface-pitch, surface-pixels): New procedures.
(%int-size, %pointer-size, %width-offset, %height-offset, %pitch-offset)
(%pixels-offset): New variables.

3 years agoUpdate Guix package.
David Thompson [Sun, 20 Dec 2015 17:25:36 +0000 (12:25 -0500)] 
Update Guix package.

3 years agoAdd SDL2_mixer bindings.
David Thompson [Sun, 20 Dec 2015 17:15:44 +0000 (12:15 -0500)] 
Add SDL2_mixer bindings.

* sdl2/bindings.scm: Add "AUDIO_*" constants.
* sdl2/bindings/mixer.scm: New file.
* sdl2/mixer.scm: New file.
* Makefile.am (SOURCES): Add new files.

3 years agobuild: Add SDL2_mixer detection.
David Thompson [Fri, 18 Dec 2015 03:54:33 +0000 (22:54 -0500)] 
build: Add SDL2_mixer detection.

3 years agoAdd SDL2_ttf bindings.
David Thompson [Thu, 17 Dec 2015 14:09:10 +0000 (09:09 -0500)] 
Add SDL2_ttf bindings.

* sdl2/bindings/ttf.scm: New file.
* sdl2/ttf.scm: New file.
* Makefile.am (SOURCES): Add them.

3 years agosurface: Fix argument name in record type printer.
David Thompson [Thu, 17 Dec 2015 14:08:21 +0000 (09:08 -0500)] 
surface: Fix argument name in record type printer.

* sdl2/surface.scm (<surface>): s/context/surface/ in record type
  printer.

3 years agoAdd color type.
David Thompson [Thu, 17 Dec 2015 14:06:58 +0000 (09:06 -0500)] 
Add color type.

* sdl2/bindings.scm (sdl-color): New variable.
* sdl2.scm (<color>): New record type.
  (make-color, color?, color-r, color-g, color-b, color-a, color->struct): New
  procedures.

3 years agobuild: Add SDL2_ttf detection.
David Thompson [Thu, 17 Dec 2015 04:38:52 +0000 (23:38 -0500)] 
build: Add SDL2_ttf detection.

3 years agoAdd SDL2_image bindings.
David Thompson [Thu, 17 Dec 2015 04:15:21 +0000 (23:15 -0500)] 
Add SDL2_image bindings.

* sdl2/bindings/image.scm: New file.
* sdl2/image.scm: New file.
* Makefile.am (SOURCES): Add them.

3 years agobuild: Add SDL2_image detection.
David Thompson [Thu, 17 Dec 2015 03:51:16 +0000 (22:51 -0500)] 
build: Add SDL2_image detection.

3 years agoevents: joystick: Add button bindings.
David Thompson [Thu, 17 Dec 2015 02:25:58 +0000 (21:25 -0500)] 
events: joystick: Add button bindings.

* sdl2/events.scm (<joystick-button-event>): New record type.
  (make-joystick-button-event, joystick-button-event?,
  joystick-button-down-event?, joystick-button-up-event?,
  joystick-button-event-timestamp, joystick-button-event-which,
  joystick-button-event-button, joystick-button-event-pressed?,
  parse-joystick-button-event): New procedures.
  (poll-event): Add support for joystick button events.

3 years agoevents: joystick: Add axis motion bindings.
David Thompson [Thu, 17 Dec 2015 02:12:28 +0000 (21:12 -0500)] 
events: joystick: Add axis motion bindings.

* sdl2/events.scm (<joystick-axis-event>): New record type.
  (make-joystick-axis-event, joystick-axis-event?,
  joystick-axis-event-timestamp, joystick-axis-event-which,
  joystick-axis-event-axis, joystick-axis-event-value,
  parse-joystick-axis-event): New procedures.
  (poll-event): Add support for joystick axis motion events.

3 years agoevents: mouse: Add motion event bindings.
David Thompson [Thu, 17 Dec 2015 01:47:20 +0000 (20:47 -0500)] 
events: mouse: Add motion event bindings.

* sdl2/bindings.scm (button-mask): New procedure.
  (SDL_BUTTON_LMASK, SDL_BUTTON_RMASK, SDL_BUTTON_MMASK,
  SDL_BUTTON_X1MASK, SDL_BUTTON_X2MASK): New variables.
* sdl2/events.scm (<mouse-motion-event>): New record type.
  (make-mouse-motion-event mouse-motion-event?,
mouse-motion-event-timestamp, mouse-motion-event-window-id,
mouse-motion-event-which, mouse-motion-event-buttons,
mouse-motion-event-x, mouse-motion-event-y, mouse-motion-event-x-rel,
mouse-motion-event-y-rel, parse-mouse-motion-event): New procedures.

3 years agoevents: window: Fix parse-window-event.
David Thompson [Thu, 17 Dec 2015 01:45:27 +0000 (20:45 -0500)] 
events: window: Fix parse-window-event.

Good ol' fencepost error strikes again.

* sdl2/events.scm (parse-window-event): Fix off-by-1 error.

3 years agoevents: keyboard: Add additional predicates.
David Thompson [Thu, 17 Dec 2015 01:44:48 +0000 (20:44 -0500)] 
events: keyboard: Add additional predicates.

* sdl2/events.scm (keyboard-down-event?, keyboard-up-event?): New procedures.

3 years agoevents: Add mouse button event bindings.
David Thompson [Thu, 17 Dec 2015 01:41:55 +0000 (20:41 -0500)] 
events: Add mouse button event bindings.

* sdl2/bindings.scm (SDL_BUTTON_LEFT, SDL_BUTTON_RIGHT,
  SDL_BUTTON_MIDDLE, SDL_BUTTON_X1, SDL_BUTTON_X2): New variables.
* sdl2/events.scm (<mouse-button-event>): New record type.
 (make-mouse-button-event, mouse-button-event?,
  mouse-button-down-event?, mouse-button-up-event?,
  mouse-button-event-timestamp, mouse-button-event-window-id,
  mouse-button-event-which, mouse-button-event-button,
  mouse-button-event-pressed?, mouse-button-event-clicks,
  mouse-button-event-x, parse-mouse-button-event): New procedures.
  (poll-event): Add support for mouse button events.

4 years agoAdd event bindings.
David Thompson [Wed, 16 Dec 2015 17:38:38 +0000 (12:38 -0500)] 
Add event bindings.

So far, only window and keyboard events are handled.  More to come in
future patches.

This patch adds a *ton* of constants that I'm not going to mention in
this log because it would be too damn long.

* sdl2/bindings.scm (sdl-poll-event): New procedure.
* sdl2/events.scm: New file.
* Makefile.am (SOURCES): Add it.

4 years agoAdd Emacs directory local configuration.
David Thompson [Mon, 14 Dec 2015 17:10:26 +0000 (12:10 -0500)] 
Add Emacs directory local configuration.

4 years agoexample: Use the "call-with-*" procedures to manage resources.
David Thompson [Mon, 14 Dec 2015 17:09:48 +0000 (12:09 -0500)] 
example: Use the "call-with-*" procedures to manage resources.

4 years agowindow: Improve call-with-window.
David Thompson [Mon, 14 Dec 2015 17:09:17 +0000 (12:09 -0500)] 
window: Improve call-with-window.

* sdl2/video.scm (call-with-window): Use a pre-existing window object
  instead of making a new one.

4 years agoRemove "sdl-" prefix from symbols in window module.
David Thompson [Mon, 14 Dec 2015 17:03:30 +0000 (12:03 -0500)] 
Remove "sdl-" prefix from symbols in window module.

4 years agoReplace blank window example with hello example.
David Thompson [Mon, 14 Dec 2015 03:56:27 +0000 (22:56 -0500)] 
Replace blank window example with hello example.

4 years agoAdd a few surface bindings.
David Thompson [Mon, 14 Dec 2015 03:51:33 +0000 (22:51 -0500)] 
Add a few surface bindings.

* sdl2/bindings.scm (sdl-rw-from-file, sdl-free-surface,
  sdl-load-bmp-rw): New procedures.
* sdl2/surface.scm: New file.
* Makefile.am (SOURCES): Add it.

4 years agoAdd renderer bindings.
David Thompson [Sun, 13 Dec 2015 20:34:33 +0000 (15:34 -0500)] 
Add renderer bindings.

* sdl2/bindings.scm (SDL_RENDERER_SOFTWARE, SDL_RENDERER_ACCELERATED,
  SDL_RENDERER_PRESENTVSYNC, SDL_RENDERER_TARGETTEXTURE): New variables.
  (sdl-create-renderer, sdl-destroy-renderer, sdl-render-clear,
  sdl-render-present, sdl-render-copy, sdl-create-texture-from-surface):
  New procedures.
* sdl2/render.scm: New file.
* Makefile.am (SOURCES): Add it.

4 years agoAdd blank window example.
David Thompson [Sat, 12 Dec 2015 07:54:59 +0000 (02:54 -0500)] 
Add blank window example.

* examples/blank-window.scm: New file.

4 years agoAdd SDL_GetTicks binding.
David Thompson [Sat, 12 Dec 2015 07:54:04 +0000 (02:54 -0500)] 
Add SDL_GetTicks binding.

* sdl2/bindings.scm (sdl-get-ticks): New procedure.
* sdl2.scm (sdl-ticks): New procedure.

4 years agoUpdate Guix package.
David Thompson [Wed, 7 Oct 2015 02:49:45 +0000 (22:49 -0400)] 
Update Guix package.

4 years agoInitial commit.
David Thompson [Wed, 7 Oct 2015 02:05:20 +0000 (22:05 -0400)] 
Initial commit.

Let's do this!