You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run this on my Android device, line #84 in VeldridSurfaceView GraphicsDevice = GraphicsDevice.CreateOpenGLES(DeviceOptions, sd); will throw an exception stating;
CreateOpenGLES() failed to get the default Android EGLDisplay: BadParameter
When I run exactly the same code from an Xamarin Android app, everything works as expected, and I can use Veldrid just fine.
Only when I run from a .NET 6.0 app this goes wrong.
I am using VS 2022 Preview in order to use .NET 6.0 on Android.
I can't figure out what I'm missing. Is this a compatability issue, or am I missing something else?
Thanks.
The text was updated successfully, but these errors were encountered:
Hi, that might be caused by the wrong eglGetDisplay signature in EGLNative.cs, the actual c function requires a argument of pointer type , but the C# wrapper supplies a System.Int32 type, on 64-bit Android OS (which is the majority now) this causes a invalid argument exception because the upper 32 bit half is just rubbish data.
The fix is also very simple, just clone the repo, add a local project reference, and change IntPtr eglGetDisplay(int native_display) to IntPtr eglGetDisplay(IntPtr native_display), and everything will be fine
It would be great to confirm if @0x5b25 's change does indeed fix it. I don't have an active Android setup right now so this will take a bit for me to debug.
Hi,
I'm trying to setup Veldrid within an Android .NET 6.0 application.
My MainActivity class looks as follow:
The VeldridSurfaceView is directly copied from
https://github.com/mellinoe/veldrid-samples/blob/master/src/SampleBase.Android/VeldridSurfaceView.cs
When I run this on my Android device, line #84 in VeldridSurfaceView
GraphicsDevice = GraphicsDevice.CreateOpenGLES(DeviceOptions, sd);
will throw an exception stating;CreateOpenGLES() failed to get the default Android EGLDisplay: BadParameter
This exception originates from https://github.com/mellinoe/veldrid/blob/master/src/Veldrid/OpenGL/OpenGLGraphicsDevice.cs
InitializeANativeWindow(), line #621.
For some reason the display can't be found.
When I run exactly the same code from an Xamarin Android app, everything works as expected, and I can use Veldrid just fine.
Only when I run from a .NET 6.0 app this goes wrong.
I am using VS 2022 Preview in order to use .NET 6.0 on Android.
I can't figure out what I'm missing. Is this a compatability issue, or am I missing something else?
Thanks.
The text was updated successfully, but these errors were encountered: