grimfang4 / sdl-gpu

A library for high-performance, modern 2D graphics with SDL written in C.
MIT License
1.17k stars 123 forks source link

[question] sdl-gpu cross-compilation ? #157

Open ebachard opened 5 years ago

ebachard commented 5 years ago

Hello,

First thanks a lot for your work, and for sharing your code, much appreciated.

FYI, I'm currently using SDL2 + ImGui + several other API (see https://framagit.org/ericb/miniDart ) and I'm stuck with the SDL2 renderer, who can't be mixed easely with ImGui (and OpenGL usually). Looks like sdl-gpu is a better solution, but my main need is to provide a Windows version (compiled on Linux).

So, my question is very simple : Is it possible to cross compile SDL_GPU ? I mean : build a Windows version using Linux (x86_64) for example ?

Thansk a lot in advance for your answer :-)

grimfang4 commented 5 years ago

Hey, cross-compilation is definitely possible, though I haven't done it Linux -> Windows myself. You can use a Linux to Windows cross-compile CMake toolchain file to tell CMake what to do.

ebachard commented 5 years ago

Ok, thanks for your fast answer. If I can find the time, I'll give it a try. And if it works, I'll post the Cmake toolchain (possibly very close to the one I'm using to build OpenCV, ffmpeg and other miniDart resources).

Please be patient :-)

ebachard commented 5 years ago

Hello,

FYI, I did it. Please have a look at : https://github.com/ebachard/sdl-gpu/commit/4d3f431d5b3fddde0bc7eb2647b9203aef4e85ff https://github.com/ebachard/sdl-gpu/commit/3d7a4fd0870564cc872f4c5862f301eee8a60c6a

Results:

Of course, in the case you are interested, just tell me, and I'll create PR (MIT license is ok for you ?). If not, please close the issue.

Thanks again for you great code !

P.S. : include ffmpeg demos seems to be a great idea !