MikePopoloski / SharpBgfx

C# bindings for the bgfx graphics library
MIT License
169 stars 32 forks source link

Crash when running hello world in debug mode #9

Closed xaviergonz closed 7 years ago

xaviergonz commented 7 years ago

In release mode it works fine, but on debug mode, while trying to run the hello world sample it crashes in Bgfx.cs line 224:

            NativeMethods.bgfx_init(
                backend,
                (ushort)adapter.Vendor,
                (ushort)adapter.DeviceId,
                CallbackShim.CreateShim(callbackHandler),
                IntPtr.Zero
            );
MikePopoloski commented 7 years ago

I believe this is from bgfx issue: https://github.com/bkaradzic/bgfx/issues/925

I haven't gotten around to doing a new build with the fix.

raizam commented 7 years ago

I've rebuilt bgfx,tried to run the examples, and I'm having a BadImageFormatException on NativeMethods.bgfx_set_platform_data(ref data); (called from SetWindowHandle). The PlatformData structure may have changed?

MikePopoloski commented 7 years ago

That's the first call made into bgfx though right? Did you build a DLL for the correct platform (x64) ?

MikePopoloski commented 7 years ago

I just updated binaries. Let me know if that resolves the issue for you.

raizam commented 7 years ago

works great thanks! Is there any plans to integrate nanovg and/or imgui ?

MikePopoloski commented 7 years ago

I'd like to do imgui at some point but it's a large project.

raizam commented 7 years ago

a large project as you say... you know what? I'm stuck trying to choose between Monogame, and this project to assemble some game engine. and I feel like whatever I choose, a very long path is ahead.

MikePopoloski commented 7 years ago

Yep, welcome to game development my friend :)