Add windows/powershell install instructions
Running luarocks install lua-sdl2 on windows with powershell runs into several problems:
-
trying to pass the directories manually for SDL2_image (as well as other SDL2 addon libraries) yields an error because luarocks appears to not allow lowercase letters when passing in variables. Doing so yield
Invalid assignmentas an error. -
Placing the lua development headers and binaries in
c:\externalthen runs into the problem of requiring cl.exe to be present in the path of the user - which it is not by default -
Adding the directory for
cl.exeto the path of the user then results in the inability to find c runtime headers such as stdio.h since cl.exe requires all include directories to be manually specified and has no default directory. Since the rock doesn't specify any include path or environment variable to set for the c runtime, they cannot be found
Currently, as far as I can tell, building through luarocks on windows/Visual C++ is broken. It would be nice to have:
- instructions for building on windows specifically
- allow a directory to be specified in the
luarocks installcommand for wincrt headers so cl.exe can build correctly - fix the variable names in the rock to remove lowercase letters from the SDL2 directories
- provide binary distributions directly for the most common OS/architectures to avoid having to build the binaries yourself, which would make program distribution easier (don't have to distribute your own binaries, and don't have to instruct users to install luarocks and overcome all these obstacles themselves)
I am trying to set luasdl2 up in windows and I had tons of different errors in few hours. I don't even remember the first error I got. I am trying to install this thing for almost 4 hour. My brain about to explode. Please add better instructions.

@ByPikod I had also a great trouble when I was building lua-sdl2 on windows using msvc. After failing to build lua-sdl2 I decided to switch to meson build and created lua-batteries. It includes latest version of lua-sdl2. Also sdl2 and it's dependent libraries are all statically linked to lua-sdl2 module. For now msvc builds works fine but I am working to support mingw.
https://user-images.githubusercontent.com/71246790/204086287-804d9a72-316b-4a18-b55d-3252eade62f6.mp4
@clitic thank you so much. You are a life saver. I am going to try your solution. I'll let u know if it works.
