Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

OpenGLES2

$
0
0

Hello, I have a problem. I try to use opengl es2 or es3 for openTK 1.0 and android. I have working example (glTriangle30 from xamarin samples), but it use previous version OpenTK. Setting es3 are done by

GLContextVersion = GLContextVersion.Gles3_0; (in CreateFrameBuffer method of my class inherited from AndroidGameView)

In OpenTK 1.0 public GLContextVersion property does not exist. Now I do so:

ContextRenderingApi = GLVersion.ES2;

and have app crash:

ex {OpenTK.Platform.Android.EglException: Failed to find a valid GraphicsMode configuration at OpenTK.Platform.Android.AndroidGraphicsMode.ChooseConfig (Javax.Microedition.Khronos.Egl.EGLDisplay display) [0x0035c] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/9d03ce3e/source/monodroid/src/OpenGLES/Android/AndroidGraphicsMode.cs:186 at OpenTK.Platform.Android.AndroidGraphicsMode..ctor (Javax.Microedition.Khronos.Egl.EGLDisplay display, Int32 version, ColorFormat color, Int32 depth, Int32 stencil, Int32 samples, Int32 buffers, Boolean stereo) [0x0004c] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/9d03ce3e/source/monodroid/src/OpenGLES/Android/AndroidGraphicsMode.cs:94 at OpenTK.Platform.Android.AndroidGraphicsMode..ctor (Javax.Microedition.Khronos.Egl.EGLDisplay display, Int32 version, OpenTK.Graphics.GraphicsMode mode) [0x00022] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/9d03ce3e/source/monodroid/src/OpenGLES/Android/AndroidGraphicsMode.cs:62 at OpenTK.Platform.Android.AndroidGraphicsContext.Init (OpenTK.Graphics.GraphicsMode mode, IWindowInfo win, IGraphicsContext sharedContext, Int32 major, GraphicsContextFlags flags) [0x0007b] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/9d03ce3e/source/monodroid/src/OpenGLES/Android/AndroidGraphicsContext.cs:110 at OpenTK.Platform.Android.AndroidGraphicsContext..ctor (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, IGraphicsContext sharedContext, GLVersion glesVersion, GraphicsContextFlags flags) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/9d03ce3e/source/monodroid/src/OpenGLES/Android/AndroidGraphicsContext.cs:88 at OpenTK.Platform.Android.AndroidGraphicsContext.CreateGraphicsContext (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, IGraphicsContext sharedContext, GLVersion glVersion, GraphicsContextFlags flags) [0x00007] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/9d03ce3e/source/monodroid/src/OpenGLES/Android/AndroidGraphicsContext.cs:50 at OpenTK.Platform.Android.AndroidGameView.CreateContext () [0x0001b] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/9d03ce3e/source/monodroid/src/OpenGLES/Android/AndroidGameView.cs:314 at OpenTK.Platform.Android.AndroidGameView.CreateFrameBuffer () [0x00002] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/9d03ce3e/source/monodroid/src/OpenGLES/Android/AndroidGameView.cs:165 at Mono.Samples.GLTriangle30.PaintingView.CreateFrameBuffer () [0x0001a] in /Users/user/Documents/xamarin training/GLTriangle30/PaintingView.cs:52 } OpenTK.Platform.Android.EglException

Please anybody help me.

And second question: API OpenTK 1.0 and previous version have some difference, besides openTK 1.0 for Android and ios have difference too (function arguments, enums - for example GL.CreateShader method have argument type - All in Android, ShaderType in ios). Is it normal? Must I spend time on such details if I am going to make cross-platform app?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>