gecko0307 / dagon

3D game engine for D
https://gecko0307.github.io/dagon
Other
321 stars 30 forks source link

Adding textLine causes an error #58

Closed infinityplusb closed 4 years ago

infinityplusb commented 4 years ago

I have a program that works fine until I try to add a GUI.

helpText = New!TextLine(aFontDroidSans14.font, helpTextGeneral, assetManager);
helpText.color = Color4f(1.0, 0.2, 0.6, 1.0);

auto eText = createEntity2D();
eText.drawable = helpText;
eText.position = Vector3f(16.0f, 30.0f, 0.0f);

causes the compile to fail with Program exited with code -11

I can't get any of the examples to work, with similar errors.

gecko0307 commented 4 years ago

Which version of Dagon are you using? Seems that your code is for 0.10.1. I've tested it with a simple example, it compiles and works as expected (Windows 10 x64, dmd 2.088.0). It's not compatible with current ~master though, and there are many warnings from old dlib

infinityplusb commented 4 years ago

Really?? I've been trying with 0.10.0 and 0.10.1 to no avail. I tried with master but it was pretty different, so I ignored it. I have a similar issue when I compile any of the examples or other projects, like dagon-shooter, dagon-demo. Maybe it's an issue with my nuklear file, or with something else in my project. I'll have a play now that I know it can work. dub 1.17.0 dmd 2.088.0 ubuntu 19.10

infinityplusb commented 4 years ago

Looks like I forgot to load the font asset. It doesn't consistently give that as a warning.

    override void onAssetsRequest()
    {
        aFontDroidSans14 = addFontAsset("data/font/DroidSans.ttf", 14);
    }