Skip to content

Commit

Permalink
Use flat file hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
TatriX committed Jul 16, 2021
1 parent 1cec5d8 commit 1cbd6d6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions 01/tutorial-01.lisp → 01-hello-sdl.lisp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(defpackage #:sdl2-tutorial-01
(defpackage #:sdl2-tutorial-01-hello-sdl
(:use :cl)
(:export :run))

(in-package :sdl2-tutorial-01)
(in-package :sdl2-tutorial-01-hello-sdl)

(defparameter *screen-width* 640)
(defparameter *screen-height* 480)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
(defpackage #:sdl2-tutorial-02
(defpackage #:sdl2-tutorial-02-getting-an-image-on-the-screen
(:use :cl)
(:export :run))

(in-package :sdl2-tutorial-02)
(in-package :sdl2-tutorial-02-getting-an-image-on-the-screen)

(defparameter *screen-width* 640)
(defparameter *screen-height* 480)

(defmacro with-window-surface ((window surface) &body body)
`(sdl2:with-init (:video)
(sdl2:with-window (,window
:title "SDL2 Tutorial"
:title "SDL2 Tutorial 02"
:w *screen-width*
:h *screen-height*
:flags '(:shown))
Expand All @@ -26,7 +26,7 @@

(defun run()
(with-window-surface (window screen-surface)
(let ((image (load-image #p"./02/hello_world.bmp")))
(let ((image (load-image #p"./assets/02/hello_world.bmp")))
(sdl2:blit-surface image nil screen-surface nil)
(sdl2:update-window window)
(sdl2:delay 2000)
Expand Down
8 changes: 4 additions & 4 deletions 03/tutorial-03.lisp → 03-event-driven-programming.lisp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
(defpackage #:sdl2-tutorial-03
(defpackage #:sdl2-tutorial-03-event-driven-programming
(:use :common-lisp)
(:export :main))

(in-package :sdl2-tutorial-03)
(in-package :sdl2-tutorial-03-event-driven-programming)

(defparameter *screen-width* 640)
(defparameter *screen-height* 480)

(defmacro with-window-surface ((window surface) &body body)
`(sdl2:with-init (:video)
(sdl2:with-window (,window
:title "SDL2 Tutorial"
:title "SDL2 Tutorial 03"
:w *screen-width*
:h *screen-height*
:flags '(:shown))
Expand All @@ -26,7 +26,7 @@

(defun run ()
(with-window-surface (window screen-surface)
(let ((image (load-image "./03/exit.bmp")))
(let ((image (load-image "./assets/03/exit.bmp")))
(sdl2:with-event-loop (:method :poll)
(:quit () t)
(:idle ()
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions sdl2-tutorial.asd
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
:version "0.0.1"
:licence "Public Domain"
:depends-on ("bordeaux-threads" "sdl2" "sdl2-image" "sdl2-ttf")
:components ((:file "01/tutorial-01")
(:file "02/tutorial-02")
(:file "03/tutorial-03")
:components ((:file "01-hello-sdl")
(:file "02-getting-an-image-on-the-screen")
(:file "03-event-driven-programming")
(:file "04/tutorial-04")
(:file "05/tutorial-05")
(:file "06/tutorial-06")
Expand Down

0 comments on commit 1cbd6d6

Please sign in to comment.