Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid oveloading of GL.DrawElements(). #535

Closed
dngs365 opened this issue Jun 8, 2017 · 10 comments
Closed

Invalid oveloading of GL.DrawElements(). #535

dngs365 opened this issue Jun 8, 2017 · 10 comments

Comments

@dngs365
Copy link

dngs365 commented Jun 8, 2017

Description

There is an invalid overloading at GL.DrawElements().

Repro steps

Just change your
OpenTK.Graphics.ES20.GL.DrawElements(BeginMode mode, int count, DrawElementsType type, IntPtr indices)
to
OpenTK.Graphics.ES20.GL.DrawElements(BeginMode mode, int count, DrawElementsType type, int offset)
.
May wonder, why use int offset version. That is useful if binding an IBO instead passing an int[].

Expected behavior

The parameter offset means IBO's index element offset.

Actual behavior

Got an UnhandledException.

Related information

In Xamarin.Android using OpenTK-1.0.

LogCat: java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@c2030b6 does not exist.
Maybe the binding information is invalid.

@Nihlus
Copy link
Contributor

Nihlus commented Jun 8, 2017

Xamarin.Android is a very, very old version of OpenTK which is not actively maintained here. Could you try reproducing the same issue with a newer version of OpenTK?

@UnknownShadow200
Copy link
Contributor

UnknownShadow200 commented Jun 9, 2017

https://github.com/mono/opentk/blob/master/Source/OpenTK/Graphics/ES20.Android/Helper.cs#L369

public static void DrawElements(BeginMode mode, int count, DrawElementsType type, int offset)
{
       DrawElements(mode, count, type, offset);
}

Seems like this would cause a stack overflow?

The overload in this repository (i.e. newer versions of OpenTK) does new IntPtr(offset));

@dngs365
Copy link
Author

dngs365 commented Jun 9, 2017

@Nihlus @UnknownShadow200 I tried to migrate the OpenTK to v2.0, however, the OpenTK.Platform.Android namespace is missing. The Xamarin.Android basically using AndroidGameView which in that namespace. My target is Xamarin.Android v7.1.
I think, the Xamarin just choose stable and common version of OpenTK for integration even though very very old.
If the newer code is like that, I agree, it seems there is no problem.

@UnknownShadow200
Copy link
Contributor

Are you using the android specific project when compiling (or package from nuget)?

@dngs365
Copy link
Author

dngs365 commented Jun 9, 2017

@UnknownShadow200 My project from Visual Studio 2017 with Visual C# > Android > OpenGL Game template. It has OpenTK-1.0 by default without NuGet nor any other dependecy management. The Xamarin has OpenTK-1.0.dll in its own package that distributed by Microsoft.

@UnknownShadow200
Copy link
Contributor

https://www.nuget.org/packages/OpenTK/

I don't have Xamarin.Android myself (nor do I use nuget) so I'm not sure if there's an android package for OpenTK. If there isn't perhaps try compiling the OpenTK.Android project in this repository.

also going to open an issue on mono's OpenTK for this

@varon
Copy link
Member

varon commented Jun 11, 2017

@UnknownShadow200 - We've not yet released android/iOS packages for OpenTK 2.0+.

The major hurdle is getting the Android/iOS stuff building on CI, which is pretty annoying with Xamarin.

From what I've gathered, the source should be fairly stable for now - if you guys can drop some confirmed reports of it working, and perhaps a brief how-to guide, we can look at getting a package released.

@dngs365
Copy link
Author

dngs365 commented Jun 11, 2017

@UnknownShadow200 I missed about migration what I had tried. First, removed 1.0 which added from the Xamarin, and then added 2.0 by NuGet. Finally, OpenTK.Platform.Android was missing.

@varon Unfortunately, I got some doubt about stability of OpenTK because of this issue. I hope to be able to use newest version in Xamarin. Thanks for efforts.

@dngs365
Copy link
Author

dngs365 commented Jun 11, 2017

I found some more about overloading issues that some overloadings are not working properly in Xamarin.
However, using version is not in developing, therefore I'll not list them here.

@dngs365 dngs365 closed this as completed Jun 11, 2017
@UnknownShadow200
Copy link
Contributor

UnknownShadow200 commented Jun 11, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants