Jump to page: 1 2
Thread overview
Any 3D Game or Engine with examples/demos which just work (compile&run) out of the box on linux ?
Oct 18, 2019
Prokop Hapala
Oct 18, 2019
Ferhat Kurtulmuş
Oct 18, 2019
Ferhat Kurtulmuş
Oct 18, 2019
Prokop Hapala
Oct 18, 2019
Aldo
Oct 18, 2019
Prokop Hapala
Oct 18, 2019
Prokop Hapala
Oct 19, 2019
Prokop Hapala
Oct 19, 2019
Mike Parker
Oct 20, 2019
Prokop Hapala
Oct 20, 2019
Jonathan Marler
Oct 21, 2019
Ferhat Kurtulmuş
Jun 01, 2021
Prokop Hapala
Jun 02, 2021
evilrat
Jun 07, 2021
Prokop Hapala
Jun 07, 2021
drug
Jun 07, 2021
evilrat
Oct 18, 2019
Elronnd
Oct 18, 2019
Prokop Hapala
October 18, 2019
Already >1 year I consider to move from C++ to Dlang or to Rust in my hobby game development (mostly based on physical simulations https://github.com/ProkopHapala/SimpleSimulationEngine). I probably prefer Dlang because it compiles much faster, and I can copy&paste C/C++ code to it without much changes.

But I cannot figure out how to jumpstart. The barrier is to configure environment/libraries.

Up to now I was able to compile just "First Triangle example" (Not sure from where I copyied it)
https://www.dropbox.com/sh/myem3g69qjyo58v/AABZuvwuRDpnskhEC4AAK5AVa?dl=0

but when I tried to clone from github some more sophisticated tutorials or demos it never works. Either it is Windows-only (Visual Studio .snl, no dub; https://github.com/Ingrater/Spacecraft), or there are some dependencies on old versions of libraries, which I don't know how to upgrade. Or it has some other dependecies which documentation does not explain how to configure on linux.

============================================================
These are some cases I tried (and problems I had):
============================================================

#### d-gamedev-team/opengl-tutorials (https://github.com/d-gamedev-team/opengl-tutorials)

opengl-tutorials/ports/opengl-tutorial.org/$ dub
Failed to find any versions for package glad-drey, referenced by opengl-tutorial.org ~master

opengl-tutorials/ports/opengl-tutorial.org/tutorials/02_triangle$ dub
Failed to find any versions for package glamour-drey, referenced by gltut-utility >=0.0.0 @/home/prokop/git_SW/_Dlang/opengl-tutorials/utility


#### kiith-sa/d-gl-tutorial (https://github.com/kiith-sa/d-gl-tutorial)

(dmd-2.088.0)prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/d-gl-tutorial$ ./compile.sh
./DerelictUtil-master/source/derelict/util/sharedlib.d(40): Error: module linux is in file 'std/c/linux/linux.d' which cannot be read
import path[0] = ./DerelictGL3-master/source/
import path[1] = ./DerelictSDL2-master/source/
import path[2] = ./DerelictUtil-master/source/
import path[3] = .
import path[4] = /home/prokop/dlang/dmd-2.088.0/linux/bin64/../../src/phobos
import path[5] = /home/prokop/dlang/dmd-2.088.0/linux/bin64/../../src/druntime/import
Failed: ["/home/prokop/dlang/dmd-2.088.0/linux/bin64/dmd", "-I./DerelictGL3-master/source/", "-I./DerelictSDL2-master/source/", "-I./DerelictUtil-master/source/", "-v", "-o-", "triangle.d", "-I."]


#### Dagon (https://github.com/gecko0307/dagon)

... it compiles and produce 'libdagon.a', but what to do with it? there are not demos/examples

#### dagon-demo (https://github.com/gecko0307/dagon-demo)

Linking...
Copying files for dagon...
Invalid source/import path: /home/prokop/git_SW/_Dlang/dagon-demo/shaders
Running ./dagondemo
Error: Nuklear library is not found. Please, install Nuklear.
Program exited with code 1
... Almost there, but still I don't know how to make it run

#### dmech (https://github.com/gecko0307/dmech)

Target is a library. Skipping execution.

#### dmech/demos (https://github.com/gecko0307/dmech)

dlib 0.12.2: building configuration "library"...
../../../../.dub/packages/dlib-0.12.2/dlib/dlib/core/stream.d(228,16): Error: module string is in file 'std/c/string.d' which cannot be read
import path[0] = ../../../../.dub/packages/dlib-0.12.2/dlib
import path[1] = /home/prokop/dlang/dmd-2.088.0/linux/bin64/../../src/phobos
import path[2] = /home/prokop/dlang/dmd-2.088.0/linux/bin64/../../src/druntime/import
/home/prokop/dlang/dmd-2.088.0/linux/bin64/dmd failed with exit code 1.

#### Dash (https://github.com/Circular-Studios/Dash)

Running pre-build commands...
cp: cannot create regular file '/usr/lib/libsoloud_x86.so': Permission denied
source/dash/utility/data/yaml.d(4,15): Deprecation: module yaml is deprecated - Import dyaml instead
../../../.dub/packages/vibe-d-0.7.33/vibe-d/source/vibe/core/log.d(554,21): Error: Built-in hex string literals are obsolete, use std.conv.hexString!"EFBBBF" instead.
source/dash/utility/input/input.d(7,8): Deprecation: module yaml is deprecated - Import dyaml instead
source/dash/core/gameobject.d(7,8): Deprecation: module yaml is deprecated - Import dyaml instead
source/dash/components/assets.d(10,8): Deprecation: module yaml is deprecated - Import dyaml instead
source/dash/components/material.d(7,8): Deprecation: module yaml is deprecated - Import dyaml instead
source/dash/components/mesh.d(8,19): Error: module stream is in file 'std/stream.d' which cannot be read

#### Sample-Dash-Game (https://github.com/Circular-Studios/Sample-Dash-Game)

logger 0.3.3: building configuration "library"...
Error: module std.experimental.logger.core from file ../../../.dub/packages/logger-0.3.3/logger/std/experimental/logger/core.d is specified twice on the command line
Error: module std.experimental.logger.filelogger from file ../../../.dub/packages/logger-0.3.3/logger/std/experimental/logger/filelogger.d is specified twice on the command line
Error: module std.experimental.logger.multilogger from file ../../../.dub/packages/logger-0.3.3/logger/std/experimental/logger/multilogger.d is specified twice on the command line
Error: module std.experimental.logger.nulllogger from file ../../../.dub/packages/logger-0.3.3/logger/std/experimental/logger/nulllogger.d is specified twice on the command line
../../../.dub/packages/logger-0.3.3/logger/std/experimental/logger/package.d(1,1): Error: module std.experimental.logger from file ../../../.dub/packages/logger-0.3.3/logger/std/experimental/logger/package.d conflicts with package name logger
/home/prokop/dlang/dmd-2.088.0/linux/bin64/dmd failed with exit code 1.

October 18, 2019
On Friday, 18 October 2019 at 05:52:19 UTC, Prokop Hapala wrote:
> Already >1 year I consider to move from C++ to Dlang or to Rust in my hobby game development (mostly based on physical simulations https://github.com/ProkopHapala/SimpleSimulationEngine). I probably prefer Dlang because it compiles much faster, and I can copy&paste C/C++ code to it without much changes.
>
> [...]

I cannot make any comment for others. But Dagon should work. I wrote a very little demo game some time ago https://github.com/aferust/dagon-shooter. I didn't try to compile and run it on Linux.I think you need to have a nuklear.so in your path, since Bindbc loaders try to load dynamic libraries by default.
October 18, 2019
On Friday, 18 October 2019 at 06:11:37 UTC, Ferhat Kurtulmuş wrote:
> On Friday, 18 October 2019 at 05:52:19 UTC, Prokop Hapala wrote:
>> Already >1 year I consider to move from C++ to Dlang or to Rust in my hobby game development (mostly based on physical simulations https://github.com/ProkopHapala/SimpleSimulationEngine). I probably prefer Dlang because it compiles much faster, and I can copy&paste C/C++ code to it without much changes.
>>
>> [...]
>
> I cannot make any comment for others. But Dagon should work. I wrote a very little demo game some time ago https://github.com/aferust/dagon-shooter. I didn't try to compile and run it on Linux.I think you need to have a nuklear.so in your path, since Bindbc loaders try to load dynamic libraries by default.

https://github.com/Timu5/bindbc-nuklear/blob/master/README.md

"This library contains prebuild windows dll for Nuklear, on different platforms you can easily build C source code from cmake configuration in c directory."


October 18, 2019
> Up to now I was able to compile just "First Triangle example" https://www.dropbox.com/sh/myem3g69qjyo58v/AABZuvwuRDpnskhEC4AAK5AVa?dl=
Why not start with that, then, and expand it until it has everything you need?

If it helps, the basic gl startup code for my engine is at http://ix.io/1Z2X/d and http://ix.io/1Z2Y/d (engine is closed-source, but feel free to steal that part for w/e you want).  Obviously depends on a bunch of other infrastructure, but should be enough to get the idea.  In the second link, you probably only want the constructor; everything else is irrelevant windowing stuff or boilerplate.

I guess I'm mostly confused as to what your roadblock is: once you've imported derelict.opengl, you have all the same opengl functions as you would have in c++; once you've imported derelict.sdl, you have all the same sdl functions as in c++.  The only thing I can think of aside from that is math or gui libs--but in your c++ engine, it looks like you implemented those from scratch.

By the way, I recommend using bindbc (https://github.com/bindbc) wrappers over derelict ones, if available, because mike isn't really maintaining derelict anymore.  He was pretty much the sole maintainer.  I'm currently using a weird branch of derelictsdl for vulkan support, and a custom version of derelictassimp so it doesn't break.
October 18, 2019
On Friday, 18 October 2019 at 06:36:49 UTC, Elronnd wrote:
> I guess I'm mostly confused as to what your roadblock is: once you've imported derelict.opengl, you have all the same opengl functions as you would have in c++; once you've imported derelict.sdl, you have all the same sdl functions as in c++.  The only thing I can think of aside from that is math or gui libs--but in your c++ engine, it looks like you implemented those from scratch.

The point is, I would like first to try some existing Dlang-based game or engine, to evaluate if Dlang really gives me so much more advantage/convenience over C++ (or Rust). Depending on that I will decide if it is worth to invest the effort to migrate all my stuff to Dlang.

Also while in C/C++ I hacked most of functionality (math,GUI,renderer,physics-engine) from scratch, I would prefer to rely on some solid reliable standard libraries from Dlang. My stuff is usually kinda "The best you can make in one week". One reason why I re-implemented so much things (like GUI, which I really hate to do) is because I find it quite painful to install&configure libraries in C/C++ (especially when versions changes). I hope that with Dlang's Dub or Rust's Cargo this will be much easier and I will use 3rd party libraries more.
October 18, 2019
On Friday, 18 October 2019 at 06:24:38 UTC, Ferhat Kurtulmuş wrote:
> On Friday, 18 October 2019 at 06:11:37 UTC, Ferhat Kurtulmuş wrote:
>> On Friday, 18 October 2019 at 05:52:19 UTC, Prokop Hapala wrote:
>>> Already >1 year I consider to move from C++ to Dlang or to Rust in my hobby game development (mostly based on physical simulations https://github.com/ProkopHapala/SimpleSimulationEngine). I probably prefer Dlang because it compiles much faster, and I can copy&paste C/C++ code to it without much changes.
>>>
>>> [...]
>>
>> I cannot make any comment for others. But Dagon should work. I wrote a very little demo game some time ago https://github.com/aferust/dagon-shooter. I didn't try to compile and run it on Linux.I think you need to have a nuklear.so in your path, since Bindbc loaders try to load dynamic libraries by default.
>
> https://github.com/Timu5/bindbc-nuklear/blob/master/README.md
>
> "This library contains prebuild windows dll for Nuklear, on different platforms you can easily build C source code from cmake configuration in c directory."

I did what you say (I guess), but Nuclear still cannot be found:

prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dagon-demo$ echo $LD_LIBRARY_PATH
/home/prokop/git_SW/bindbc-nuklear/build:/home/prokop/torch/install/lib:

prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dagon-demo$ ls
COPYING    data      dub.selections.json   icon.ico  input.conf     rcedit-x64.exe  README.md      src
dagondemo  dub.json  gamecontrollerdb.txt  icon.txt  libnuklear.so  rcedit-x86.exe  settings.conf

prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dagon-demo$ ./dagondemo
Error: Nuklear library is not found. Please, install Nuklear.




October 18, 2019
On Friday, 18 October 2019 at 19:20:04 UTC, Prokop Hapala wrote:
> On Friday, 18 October 2019 at 06:24:38 UTC, Ferhat Kurtulmuş wrote:
>> On Friday, 18 October 2019 at 06:11:37 UTC, Ferhat Kurtulmuş wrote:
>>> On Friday, 18 October 2019 at 05:52:19 UTC, Prokop Hapala wrote:
>>>> Already >1 year I consider to move from C++ to Dlang or to Rust in my hobby game development (mostly based on physical simulations https://github.com/ProkopHapala/SimpleSimulationEngine). I probably prefer Dlang because it compiles much faster, and I can copy&paste C/C++ code to it without much changes.
>>>>
>>>> [...]
>>>
>>> I cannot make any comment for others. But Dagon should work. I wrote a very little demo game some time ago https://github.com/aferust/dagon-shooter. I didn't try to compile and run it on Linux.I think you need to have a nuklear.so in your path, since Bindbc loaders try to load dynamic libraries by default.
>>
>> https://github.com/Timu5/bindbc-nuklear/blob/master/README.md
>>
>> "This library contains prebuild windows dll for Nuklear, on different platforms you can easily build C source code from cmake configuration in c directory."
>
> I did what you say (I guess), but Nuclear still cannot be found:
>
> prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dagon-demo$ echo $LD_LIBRARY_PATH
> /home/prokop/git_SW/bindbc-nuklear/build:/home/prokop/torch/install/lib:
>
> prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dagon-demo$ ls
> COPYING    data      dub.selections.json   icon.ico  input.conf
>   rcedit-x64.exe  README.md      src
> dagondemo  dub.json  gamecontrollerdb.txt  icon.txt  libnuklear.so  rcedit-x86.exe  settings.conf
>
> prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dagon-demo$ ./dagondemo
> Error: Nuklear library is not found. Please, install Nuklear.

Try to move that libnuklear.so or rename it to nuklear.so. I checked bindbc code and saw :

    version(Windows) {
        const(char)[][1] libNames = ["nuklear.dll"];
    }
    else version(OSX) {
        const(char)[][1] libNames = ["nuklear.dylib"];
    }
    else version(Posix) {
        const(char)[][2] libNames = [
            "nuklear.so",
            "/usr/local/lib/nuklear.so",
        ];
    }
October 18, 2019
On Friday, 18 October 2019 at 20:09:47 UTC, Aldo wrote:
> Try to move that libnuklear.so or rename it to nuklear.so. I checked bindbc code and saw :
>
>     version(Windows) {
>         const(char)[][1] libNames = ["nuklear.dll"];
>     }
>     else version(OSX) {
>         const(char)[][1] libNames = ["nuklear.dylib"];
>     }
>     else version(Posix) {
>         const(char)[][2] libNames = [
>             "nuklear.so",
>             "/usr/local/lib/nuklear.so",
>         ];
>     }

Great! progress! ... It shown loading splash screen and moving loading bar, when it reach the end, it segfault

prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dagon-demo$ ./dagondemo
Loading scene "TestScene"
Segmentation fault (core dumped)

possibly it it connected with the error I saw during compilation:
Copying files for dagon...
Invalid source/import path: /home/prokop/git_SW/_Dlang/dagon-demo/shaders
October 18, 2019
The whole thing is like this:

prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dagon-demo$ source ~/dlang/dmd-2.088.0/activate
(dmd-2.088.0)prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dagon-demo$ dub
WARNING: A deprecated branch based version specification is used for the dependency dagon. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Invalid source/import path: /home/prokop/git_SW/_Dlang/dagon-demo/shaders
Performing "debug" build using /home/prokop/dlang/dmd-2.088.0/linux/bin64/dmd for x86_64.
bindbc-loader 0.1.1: target for configuration "noBC" is up to date.
bindbc-ft 0.1.0: target for configuration "library" is up to date.
bindbc-nuklear 0.1.0: target for configuration "dynamic" is up to date.
bindbc-opengl 0.4.0: target for configuration "dynamic" is up to date.
bindbc-sdl 0.4.1: target for configuration "dynamic" is up to date.
dlib 0.16.0: target for configuration "library" is up to date.
dagon ~dev_0.10: target for configuration "library" is up to date.
dagondemo 0.10.0+commit.6.gdf2dd63: target for configuration "application" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Copying files for dagon...
Invalid source/import path: /home/prokop/git_SW/_Dlang/dagon-demo/shaders
Running ./dagondemo


October 19, 2019
The dmech/demos also seems to be almost running just it somehow cannot find or use my libsdl.so library which it just compiled (it is in 'dmech/demos/lib')


(dmd-2.088.0)(dmd-2.088.0)prokop@prokop-Lenovo-ideapad-Y700-15ISK:~/git_SW/_Dlang/dmech/demos$ dub
Performing "debug" build using /home/prokop/dlang/dmd-2.088.0/linux/bin64/dmd for x86_64.
dlib 0.16.0: target for configuration "library" is up to date.
demo ~master: target for configuration "pyramid" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Running ./pyramid
derelict.util.exception.SharedLibLoadException@derelict/util/exception.d(43): Failed to load one or more shared libraries:
	./lib/libsdl.so - ./lib/libsdl.so: wrong ELF class: ELFCLASS32
----------------
derelict/util/exception.d:75 void derelict.util.exception.SharedLibLoadException.throwNew(const(char[][]), const(char[][])) [0x55ecce3ed712]
derelict/util/sharedlib.d:221 void derelict.util.sharedlib.SharedLib.load(immutable(char)[][]) [0x55ecce3edef3]
derelict/util/loader.d:91 void derelict.util.loader.SharedLibLoader.load(immutable(char)[][]) [0x55ecce3edb54]
derelict/util/loader.d:86 void derelict.util.loader.SharedLibLoader.load(immutable(char)[]) [0x55ecce3edb25]
dgl/core/application.d:185 void dgl.core.application.loadLibraries() [0x55ecce3f1127]
pyramid.d:385 _Dmain [0x55ecce406a68]
Program exited with code 1




« First   ‹ Prev
1 2