Not necessarily. Crafty's or TSCP's source code for example have a "look at it, but don't touch it" kind of licence.
Why C++ instead of C#?
Moderators: hgm, Rebel, chrisw
-
- Posts: 2488
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: Why C++ instead of C#?
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: Why C++ instead of C#?
Just remove mingw64, and install MSYS2 with GCC and Clang.
You can then compile 64-bit versions in MSYS2 MinGW64, and 32-bit in MSYS2 MinGW32. You can treat the program as if it's a Linux program, but a Windows executable will be created. There's a catch if you need "make" though; you need to install "make", but it actually installs "make-mingw32" or something like that. You need to create a "make" symlink to that executable. I don't know if this is by design or a mistake, but it has always been like this in MSYS2.
-
- Posts: 179
- Joined: Tue Jun 15, 2021 8:11 pm
- Full name: Emanuel Torres
Re: Why C++ instead of C#?
I think you absolutely should share it. You might want to just shoot an email to Fabio and ask for permission, or better yet a proper license.lithander wrote: ↑Fri Sep 17, 2021 1:48 pm As so many of you seem interested in the topic I'm thinking about sharing the C# version with you so everyone who wants can replicate the measurements. We could then also try to make the version faster together, leverage the full potential of C# so to speek. Learn more about what micro-optimizations are possible in C# is one of the reasons I undertook this little experiment.
The only thing that's stopping me at the moment (apart from being at work^^) is that I don't know under what terms the author of the QBBEngine meant to share his code. Didn't find an open source license mentioned anywhere specifcally. On the other hand if someone is sharing the code of a didactic engine I assume he expects others to interact with it in some form?
[Moderation warning] This signature violated the rule against commercial exhortations.
-
- Posts: 881
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Why C++ instead of C#?
When I said compiled using MinGW 64bit I meant the version that came with MSYS2. But I didn't know that just calling gcc wthout any other parameters doesn't optimize the build.
I also didn't manage to compile it out of the box with Visual Studio (not even after installing Clang) because
Code: Select all
clock_gettime(CLOCK_MONOTONIC,&end);
I already wrote him a PM yesterday but it's still sitting in the outbox. I guess he doesn't visit the forum every hour like the rest of us
Last edited by lithander on Fri Sep 17, 2021 3:55 pm, edited 2 times in total.
-
- Posts: 179
- Joined: Tue Jun 15, 2021 8:11 pm
- Full name: Emanuel Torres
Re: Why C++ instead of C#?
Lame. Could try 0xfab10@gmail.com perhaps.
[Moderation warning] This signature violated the rule against commercial exhortations.
-
- Posts: 881
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Why C++ instead of C#?
Fabio just replied "It has no license you can do what you want with the code. It's a very simple engine." so I guess I can share the C# port later! Yay!
-
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: Why C++ instead of C#?
I have actually forgotten how to create debug and release builds with GCC since using Rust... I'd have to look it up again. Even so, when compiling a release build, it is _still_ not optimized for a specific CPU. In Rust, you use the --release option, for a release build, but to optimize to a certain minimum cpu level, you have to set the environmental variable RUSTFLAGS = -C target-cpu=cpu_name_here. Similar for C (CFLAGS) and C++ (CXXFLAGS).
That is why I always compile engines on MSYS2. Most open source engines compile on Linux, and therefore they normally compile under MSYS2 too. I never had an engine NOT compile. (Except when actually broken because of errors in it or missing third-party dependencies.)I also didn't manage to compile it out of the box with Visual Studio (not even after installing Clang) becauseseems to not be available on Windows. *shrug* I'm really not a C expert, never really used it before.Code: Select all
clock_gettime(CLOCK_MONOTONIC,&end);
-
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: Why C++ instead of C#?
If you manage to create something in C# that actually reaches 75% or more of C / C++'s speed, I think I'm just going to blatantly ignore it, put fingers in my ears, sing "LA-LA-LA-LA", and assume either you did something wrong on the C / C++ side or the C / C++ code is crappy.
Otherwise, I'm a fairly open-minded person though...
-
- Posts: 433
- Joined: Fri Dec 16, 2016 11:04 am
- Location: France
- Full name: Richard Delorme
-
- Posts: 2488
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: Why C++ instead of C#?
Yes, that's a POSIX function. With MingW, you could add the compiler / linker options -mthreads -pthread -lpthread.lithander wrote: ↑Fri Sep 17, 2021 3:53 pmI also didn't manage to compile it out of the box with Visual Studio (not even after installing Clang) becauseseems to not be available on Windows.Code: Select all
clock_gettime(CLOCK_MONOTONIC,&end);
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net