2
\$\begingroup\$

How can I develop a game with Irrlicht game engine in a cygwin environment?

I tried google, but honestly I didn't find any useful tutorials about setting that game engine in cygwin.

Thanks, Ehsan.

\$\endgroup\$

2 Answers 2

3
+25
\$\begingroup\$

I highly recommend using MSYS2 instead of Cygwin. It is basically a well-maintained fork of Cygwin that includes ① the Mingw-w64 toolchain (basically, GCC for Windows), ② a robust package manager (pacman from Arch Linux) and ③ packages for the Irrlicht engine.

Once MSYS2 is installed, you can install GCC and Irrlicht from an MSYS2 shell:

pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-irrlicht

Here is a simple Irrlicht program that you can try; it just opens a window and clears the screen:

#include <irrlicht/irrlicht.h>
using namespace irr;
using namespace core;
using namespace video;

int main() {
    IrrlichtDevice *device = createDevice(video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16, false, false, false, 0);
    device->setWindowCaption(L"Hello World");
    IVideoDriver* driver = device->getVideoDriver();
    while (device->run()) {
        driver->beginScene(true, true, SColor(255,100,101,140));
        driver->endScene();
    }
    device->drop();
}

To compile your project from an MSYS2 shell:

/mingw64/bin/g++ example.cpp -lIrrlicht -o example.exe

And to launch it:

./example.exe
\$\endgroup\$
5
  • \$\begingroup\$ Unfortunately, using MINGW isn't an option for me :( \$\endgroup\$
    – Ehsan
    Commented Jun 26, 2016 at 13:00
  • \$\begingroup\$ @Ehsan Then, what compiler you're using/want to use? And what's wrong with MinGW? \$\endgroup\$ Commented Jun 26, 2016 at 13:03
  • \$\begingroup\$ You know, nothing is wrong with MINGW, just I have developed some part of the game like audio in some libraries which are for cygwin and porting those to MINGW takes a considerable effort... \$\endgroup\$
    – Ehsan
    Commented Jun 26, 2016 at 13:05
  • \$\begingroup\$ Pretty much nothing is available for Cygwin because its Unix-like layer is extremely slow and thus it doesn’t make sense to port to Cygwin except for very Unix-centered software. I’m curious as to what exactly can’t be easily ported to mingw; even pthreads are easy nowadays since you can use std::thread. \$\endgroup\$ Commented Jun 26, 2016 at 14:30
  • 1
    \$\begingroup\$ I cried tears of joy to see pacman running on Windows. \$\endgroup\$
    – user5665
    Commented Jun 29, 2016 at 6:29
1
\$\begingroup\$

I wouldn't waste your time on trying to get it going in cygwin. You would probably actually HAVE to move to mingw to get it to work.

And even if you did get it working there's many issues with cygwin.

If you want to do game development that's definitely not the way to go unfortunately. I have tried before and it was a big headache.

If you just want to run some stuff other people made, it probably still won't work. And if it does it will be with a ton of effort.

Not good news, but that is just the reality.

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .