Browse Source

Better naming for SDL functions

pitch-detection
Macoy Madson 1 year ago
parent
commit
704da22ad2
  1. 10
      src/SDL.cake
  2. 2
      test/src/SDLOgreApp.cake
  3. 2
      test/src/VocalGame.cake

10
src/SDL.cake

@ -12,8 +12,8 @@
(forward-declare (struct SDL_Window))
;; I'm not sure SDL won't use OpenGL under the hood. This supports drawing using SDL functions
(defun sdl-initialize-nogl (window-out (* (* SDL_Window)) &return bool)
;; This supports drawing using SDL functions
(defun sdl-initialize-for-2d (window-out (* (* SDL_Window)) &return bool)
(when (< (SDL_Init (bit-or SDL_INIT_VIDEO SDL_INIT_AUDIO SDL_INIT_TIMER)) 0)
(sdl-print-error)
(return false))
@ -29,7 +29,7 @@
(return true))
;; This is the OpenGL version, which may not support SDL drawing functions, only OpenGL
(defun sdl-initialize (window-out (* (* SDL_Window)) &return bool)
(defun sdl-initialize-for-3d (window-out (* (* SDL_Window)) &return bool)
(when (< (SDL_Init (bit-or SDL_INIT_VIDEO SDL_INIT_AUDIO SDL_INIT_TIMER)) 0)
(sdl-print-error)
(return false))
@ -61,7 +61,7 @@
(defun test--sdl-main (&return int)
(printf "Hello, SDL!\n")
(var window (* SDL_Window) null)
(unless (sdl-initialize-nogl (addr window)) (return 1))
(unless (sdl-initialize-for-2d (addr window)) (return 1))
;; (var window-surface (* SDL_Surface) (SDL_GetWindowSurface window))
@ -141,7 +141,7 @@ Note that you can also build SDL manually. This can be useful if you are porting
(run-process-sequential-or
("make" "install" :in-directory sdl-working-dir)
(build-sdl-on-failure
"failed at SDL make install. Was there a configuration issue with --prefix?.")
"failed at SDL make install. Was there a configuration issue with --prefix?")
(return false))
;; One final to check to ensure everything's good to go

2
test/src/SDLOgreApp.cake

@ -13,7 +13,7 @@
(defun main (&return int)
(var window (* SDL_Window) null)
(unless (sdl-initialize (addr window))
(unless (sdl-initialize-for-3d (addr window))
(return 1))
;; Ogre uses exceptions for error handling, so we can't gracefully close without getting all that
;; stuff set up (which I don't really want to do; it belongs in Gamelib)

2
test/src/VocalGame.cake

@ -296,7 +296,7 @@
(defun-local app-main (&return int)
(unless initialized
;; (defun main (&return int)
(unless (sdl-initialize (addr g-window))
(unless (sdl-initialize-for-3d (addr g-window))
(return 1))
(audio-input-buffer-initialize)

Loading…
Cancel
Save