Linux for development Windows games - how do it

Started by
8 comments, last by Serapth 10 years, 11 months ago

1st thing - if similar topic exist, can you past a link? I can't find it.

Like everyone, I want write game. It'll be isn't big, more like 'tech demo' or 'learn something new'. I want to use C++, some 2D library, game with top view. I'm using linux, coding in Java at work. But I want to deploy final product to Windows, in *.exe. What technology/tools (IDE or something else) allow me to do it? It's possible to complie and deploy 2D game in OpenGL without any change to Windows, even if game was written in Linux?

I know for now, that will be problem with IDE. I'm using Intellij for Java, but all C++ IDE on Linux are bad or worse, but I must chose one. I'm not happy, but I wasn't install Windows especially for it.

Pierdol system, lecz rób to stylowo.

Advertisement

For my cross platform c++ development I use Qt Creator with CMake. This gives me an excellent IDE (good code completion, syntax highlighting,...) and a flexible and powerful build system. With this setup I can write my whole game on Linux and compile the code on windows with MinGW when the code is ready to release (most of the time this compiles out of the box without any errors) (You can even cross compile from Linux but I've never tried it)

PS: there is nothing wrong with the Qt creator build system (QMake), I just prefer CMake because my build steps can get pretty complicated (I automatically generates python bindings for my engine and CMake allow me to do that quite easily)

I tried GLFW. It works but its horror for anything more than a little 2D project. If you dont need GUI or you will write your own then create a class that will be responsible for the OS-specific stuff: creating the window, handling the system messages, etc.(Or use something like Qt as suggested) Once your project becomes bigger you will have to do that anyway. ....or switch to a cross-platform engine.

IDE: Im using NetBeans with GCC and it works fine. Except that the debugger is crap compared to VS.

Do you have any Windows box at all? It can be troublesome to develop for a platform you can't test on.

For my last cross-platform project, I just worked over two machines, and my project naturally became cross-platform. It can encourage hacky solutions though if you're not disciplined about it (since the project just fails to build when you actually want to get work done).

It's possible to complie and deploy 2D game in OpenGL without any change to Windows, even if game was written in Linux?

Provided you stick to portable libraries, you should be able to (though differences in how filenames are handled can be annoying). In the project I'm working on when I tried building it on Windows the only couple of lines I needed to add was a few #includes I should have added and forgot. (didn't get a warning on Linux since some other headers were including those implicitly) I spent more time rebuilding all the libraries than building the game itself.

That said, I'm also clueless as to how do cross compiling (i.e. build the Windows executable with a Linux system). I have MinGW-w64 installed (a variant of MinGW that adds some headers and such that are missing from the normal version, as well as allowing 64-bit executables), but I have no idea from where to go. It seems like every library has a completely different way to be built for cross compiling, ugh.

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

I was forced to do this one time as an educational experience, and while I was able to do it, the amount of hassle that came along with it was unreal. The best advice (assuming you have a windows box) is to program the windows specific code on native Windows. Regardless, you are going to have to use a toolchain that supports the ".exe" file. This is best done natively on Windows, but you might be able to use 'W.I.N.E' or something similar.

If you are using libraries that are cross-platform, and assuming you stick to cross-platform code, it should be as easy as just compiling on the new platform (I use the phrase "should be" lightly).

Do you have any Windows box at all? It can be troublesome to develop for a platform you can't test on.

I missed this the first time, but this is a very real and valid point. It is not good practice to test a game that you want to natively port to Windows in something like "W.I.N.E." You really want a native system to test on.

@EDIT: Added to original answer.

"The code you write when you learn a new language is shit.
You either already know that and you are wise, or you don’t realize it for many years and you are an idiot. Either way, your learning code is objectively shit." - L. Spiro

"This is called programming. The art of typing shit into an editor/IDE is not programming, it's basically data entry. The part that makes a programmer a programmer is their problem solving skills." - Serapth

"The 'friend' relationship in c++ is the tightest coupling you can give two objects. Friends can reach out and touch your privates." - frob

I've Windows, all version, from MSDN AA, but:

  • I hate cmd, but love bash (important at work) - it's more intuitive, user-friendly etc. IMO
  • I'm using Windows only for games, in my desktop PC. It has only Steam, communicator, Spotify and Chrome. It's like console;) But it's old machine (E7300, 4GB RAM DDR2 800), for work I've i5, 6GB RAM DDR3 (laptop). I don't like coding on desktop.
  • I don't like Visual Studio, for me is unintuitive, like Eclipse (Intellij ftw)

So Windows for me at work is... unnecessarysmile.png

Pierdol system, lecz rób to stylowo.

We use a continuous integration server at work (Atlassian Bamboo) which attempts to build the software on all the platforms we are targetting. This is really useful because it prevents us from ignoring a platform for long periods of time. When it tries to build, it will fail and give us an email so that we can then go and do a better job of maintaining the port.

If you are an experienced UNIX/Linux developer, then you probably have a fairly good knowledge of writing portable software anyway to cater for the many different Linux / BSD distributions we use today. Using the Mingw toolchain (and certainly Cygwin) will create a sufficiently UNIX-like development environment for you to work in anyway (Arguably more UNIX-like than Ubuntu ;).

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

Code::Blocks is crossplatform, it is decent enough.

Then you can run the Windows emulator and compile the final exe (the nice thing is that you would be able to use the same project since you would be usiung the same IDE for both systems).

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

I've Windows, all version, from MSDN AA, but:

  • I hate cmd, but love bash (important at work) - it's more intuitive, user-friendly etc. IMO
  • I'm using Windows only for games, in my desktop PC. It has only Steam, communicator, Spotify and Chrome. It's like console;) But it's old machine (E7300, 4GB RAM DDR2 800), for work I've i5, 6GB RAM DDR3 (laptop). I don't like coding on desktop.
  • I don't like Visual Studio, for me is unintuitive, like Eclipse (Intellij ftw)
So Windows for me at work is... unnecessary:)
CMD can easily be replaced, install Cygwin and you can run bash. Or better yet, learn powershell, a modern and powerful shell environment,

IntelliJ is available on Windows, but if you want a C++ IDE other than Visual C++, try Qt creator.

If you are targeting a platform, it's pretty much essential to run on that platform,

This topic is closed to new replies.

Advertisement