Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When GLSurfaceView calls its renderer methods, it passes an instance that implements the IGL10 interface. However, this instance implements several other interfaces, which seem to not be correctly exposed.
Steps to reproduce:
In your Renderer, cast the IGL10 object to an instance of IGL11ExtensionPack, e.g.:
public class MyGLViewRenderer : Java.Lang.Object, GLSurfaceView.IRenderer
public void OnDrawFrame(IGL10 gl)
IGL11ExtensionPack gl11ep = (IGL11ExtensionPack)gl;
This fails. (Furthermore, a cursory review of the object in Java suggest it is based on a com.google.android.gles_jni.GLImpl which contains various OES Extension methods, but they are not exposed here.)
This succeeds. See reference code.
Use the .JavaCast<T>() extension method. The GLImpl type is not public, and thus cannot be bound by itself, and your C# cast will only be operating on Xamarin.Android proxy instances.
Use the .JavaCast<T>() extension method to safely coerce types.