veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.18k stars 219 forks source link

How to get gfx running? #427

Closed MarcusTU closed 4 years ago

MarcusTU commented 4 years ago

Hello there,

the instructions (Windows 10, Visual Studio Code, Go), for installing sdl, img, ttf, mix are all the same: download the devel package, unpack the package, copy x86_64-w64-mingw32, go get -v github.com/veandco/go-sdl2/XXX, hit run -> it works fine.

sadly this wont work with the gfx package because it doesnt contain any folder named x86_64-w64-mingw32. It is some visual studio (not code) project folder that must be build in order to get what you want. No matter what I try i am to incompetent to do this so i sit on a bunch of files and cant get it to work.

It would be great to have some seperate install instructions for the gfx package or some nice guy that builds the project and links the copy & pastable folder so everyone that is not a compile master can use sdl_gfx.

veeableful commented 4 years ago

Hi @MarcusTU, thanks for pointing that out. I'd guess that for the GCC version you can run ./configure; make and copy the library into the same directory as other libraries.

I'll have a look at this and update the guide when I have the time (probably this weekend).

veeableful commented 4 years ago

So I had to edit the configure script at line 13142 to make sure they escape spaces in $SDL_CONFIG. Then I edit sdl2-config to use the correct $prefix. But looking at config.log, I found out that you need autoconf, autoheader, and automake in the end which aren't provided by mingw-w64.

I will try with MSYS2 if it can be used to successfully compile the project since it does provides those autotools.

veeableful commented 4 years ago

I found a nice person who shares his SDL2_gfx.dll which I confirmed to be working with go-sdl2/gfx! Here's the link: https://github.com/Vladar4/sdl2_nim/blob/master/LINKS.md

The header files of SDL2_gfx (.h files) will need to be copied into include folder of your MinGW. They can be obtained from the source code here: http://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/

MarcusTU commented 4 years ago

Thank you very much :) This method is not complicated and works fine.