Yes, this is possible, as the other answers indicate.
What I'd like to add is that when developing a game, you are going to rely on a whole stack of software: you will be using one or more programming languages and software libraries and frameworks that implement basic functionality you want to use but not implement yourself.
Many of these stacks are suitable for cross-platform development, and you will need to pick one, depending on
- hardware you want the game to run on (laptops? phones?)
- the software environments you want it to run on (web-based? native GUI? text-based? should it be scriptable? etc.)
- aesthetic and functional requirements you want the game to meet
- performance requirements (easy to meet for tic-tac-toe, not so easy for a chess server with millions of users or for a first-person shooter)
- your own experience
I think the best approach is hands-on:
- find one or more open source games that look like games you'd want to spend time working on, and that are offered for Windows, MacOS, and Linux
- figure out what it would take to develop and contribute a small improvement
That will take you through the whole software stack, build process, development process, and project communication requirements. Once you have an idea of what's required to make one tiny change to the kind of game you'd be interested in working on, you will have some perspective on what it would take to develop such a game.
Personally I've only contributed a few lines of code to only one game, namely Freeciv, which runs natively on Linux, Windows, MacOS, Android, and a few other OSes, and also has a web-based version. That is just one example; just Google for examples of multiplatform games and you'll probably find a few that look like the kind of game you'd want to work on.
sudo dnf install -y mingw64-gcc; export CC=x86_64-w64-mingw32-gcc; echo '#include<stdio.h>' > helloworld.c ; echo 'int main() { printf("hello world\\n"); return 0;}' >> helloworld.c; $CC -o helloworld.exe helloworld.c(Of course, how you install mingw64-gcc depends on your distro, but the rest will be identical)mingw32-headersandmingw32-crt), so the compiler will just grab symbol stubs from its bundledlibadvapi32.aand produce a binary which will depend on an actualadvapi32.dllto run.