Some fixes for SDL on Windows.

This commit is contained in:
Erik Svedäng 2020-04-06 09:28:50 +02:00
parent f9ab7df2da
commit b6d4d41f46
2 changed files with 5 additions and 10 deletions

View File

@ -6,15 +6,15 @@
(add-pkg "sdl2"))
;; Only define these if they're not already defined (allows the user to pre-define them before including SDL.carp)
(defdynamic-once sdl-windows-header-path "C:\\SDL2-2.0.9\\include")
(defdynamic-once sdl-windows-library-path "C:\\SDL2-2.0.9\\lib\\x86\\")
(defdynamic-once sdl-windows-header-path "C:\\REDACTED\vcpkg\installed\x86-windows\include\SDL2\\")
(defdynamic-once sdl-windows-library-path "C:\\REDACTED\vcpkg\installed\x86-windows\lib\\")
(windows-only
;; Note - you'll still need the SDL2.dll to be able to run the executable
(add-cflag "-DSDL_MAIN_HANDLED")
(add-cflag "-Wno-pragma-pack")
(add-cflag (str "-I" sdl-windows-header-path))
(add-lib (str "/link " sdl-windows-library-path "SDL2.lib "))) ;; sdl-windows-library-path "SDL2main.lib")))
(add-lib (str "/link " sdl-windows-library-path "SDL2.lib " sdl-windows-library-path "manual-link\SDL2main.lib")))
;; Types
(register-type SDL_Keycode)

View File

@ -2,15 +2,10 @@
(system-include "SDL2/SDL_image.h")
(add-pkg "SDL2_image"))
(defmodule IMG
(defmodule Windows
(defdynamic header-path "C:\\SDL2_image-2.0.4\\include")
(defdynamic library-path "C:\\SDL2_image-2.0.4\\lib\\x86\\")))
(windows-only
(system-include "SDL_image.h")
(add-cflag (str "-I" IMG.Windows.header-path))
(add-lib (str "/link " IMG.Windows.library-path "SDL2_image.lib ")))
(add-cflag (str "-I" sdl-windows-header-path))
(add-lib (str sdl-windows-library-path "SDL2_image.lib ")))
(defmodule IMG
(register load-texture (Fn [(Ptr SDL_Renderer) (Ptr Char)] (Ptr SDL_Texture)) "IMG_LoadTexture")