pond3r / ggpo

Good Game, Peace Out Rollback Network SDK
MIT License
3.12k stars 361 forks source link

Add Linux support #19

Open kkremitzki opened 4 years ago

kkremitzki commented 4 years ago

This is something I'm interested in working on but I figured I'd create an issue to track the work in case anyone else wants to jump in.

Currently building fails on Linux with this totally unsurprising error about a missing winsock2.h:

[  7%] Building CXX object CMakeFiles/ggpo.dir/src/lib/ggpo/main.cpp.o
In file included from /home/kkremitzki/Desktop/Source/ggpo/git/src/lib/ggpo/main.cpp:8:0:
/home/kkremitzki/Desktop/Source/ggpo/git/src/lib/ggpo/types.h:12:10: fatal error: winsock2.h: No such file or directory
 #include <winsock2.h>
          ^~~~~~~~~~~~
compilation terminated.
CMakeFiles/ggpo.dir/build.make:62: recipe for target 'CMakeFiles/ggpo.dir/src/lib/ggpo/main.cpp.o' failed

Once the build works on Linux I can proceed to getting it packaged for Debian/Ubuntu.

sharpobject commented 4 years ago

If you apply #16 and #17 locally I expect it will work. Let me know if there's any problem.

kkremitzki commented 4 years ago

Thanks, I opened #21 which will get things working after #17 is merged.

arrayofchar commented 4 years ago

Please see #37. I just merged your code #21 to the dev/crossplatform branch plus the original changes in #17.

Shugyousha commented 4 years ago

To port the vectorwar example application I thought we could replace the gdi_renderer and all the Window specific code with a simple libsdl implementation (using sdl_ttf for text rendering). The simple 2D rendering primitives available in libsdl should work on Windows, Linux and MacOSX.

Does that sound reasonable?

plasx commented 2 years ago

@arrayofchar does this mean Linux Support is added already and this issue is closed?

arrayofchar commented 2 years ago

I'm not sure how much cross platform support there is. I think I got it to build in a Ubuntu VM. I've not tested the actual functionality. You should compare the cross platform branch with the main branch

On Mon, Nov 29, 2021, 09:51 Daniel Plas Rivera @.***> wrote:

@arrayofchar https://github.com/arrayofchar does this mean Linux Support is added already and this issue is closed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pond3r/ggpo/issues/19#issuecomment-981871048, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOBEWXTR5SSZ4A6ABVYBL3UOO4RBANCNFSM4JBCOY7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Shugyousha commented 2 years ago

On Thu, Dec 2, 2021 at 10:04 PM arrayofchar @.***> wrote:

I'm not sure how much cross platform support there is. I think I got it to build in a Ubuntu VM. I've not tested the actual functionality. You should

I have ported the "vectorwar" example application to Linux based on the linux support branch here: https://github.com/pond3r/ggpo/pull/57

This probably has bitrotted quite a bit but back then on a local machine, the vectorwar example application worked on Linux as well as Windows with up to 4 players IIRC. I have not tried running the application over the network but in theory (!) it should just work.

lolriven commented 2 years ago

Has any progress been made on the linux/unix support? I'm looking through the development/crossplatform branch and it seems to still heavily utilize Win32 API and types. Unless there were some macros I missed.