Click here to Skip to main content
13,089,386 members (59,550 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hey guys, i've been trying to port my XNA game to Android using this tot: http://www.youtube.com/watch?v=S4kbqU6feiA[^]

The problem is that when i run the program. I'm getting an error:
"Could not create OpenGLES 2.0 frame buffer"

Does anyone know what i should do? I have absolutly no idea what i should to.
I dont know one single thing about OpenGL/OpenTK.

PS. tell me if u need more code or so.

Thx - Carl

        protected override void CreateFrameBuffer()
		{
            Android.Util.Log.Debug("MonoGame", "AndroidGameWindow.CreateFrameBuffer");
			try
            {
                GLContextVersion = GLContextVersion.Gles2_0;
				try
				{
					base.CreateFrameBuffer();
				}
				catch(Exception)
				{
					// try again using a more basic mode which hopefully the device will support
					GraphicsMode = new AndroidGraphicsMode(0, 0, 0, 0, 0, false);
					base.CreateFrameBuffer();
				}
                All status = GL.CheckFramebufferStatus(All.Framebuffer);
                Android.Util.Log.Debug("MonoGame", "Framebuffer Status: " + status.ToString());
            } 
			catch (Exception) 
			{
				throw new NotSupportedException("Could not create OpenGLES 2.0 frame buffer"); //i get the error here<-------------
		    }
            if (_game.GraphicsDevice != null && _contextWasLost)
            {
                _game.GraphicsDevice.Initialize();
                Android.Util.Log.Debug("MonoGame", "Begin reloading graphics content");
                Microsoft.Xna.Framework.Content.ContentManager.ReloadGraphicsContent();
                Android.Util.Log.Debug("MonoGame", "End reloading graphics content");
 
                // DeviceReset events
                _game.graphicsDeviceManager.OnDeviceReset(EventArgs.Empty);
                _game.GraphicsDevice.OnDeviceReset();
 
                _contextWasLost = false;
            }
 
            MakeCurrent();
		}


Edit(24/1-13): Im trying to not port the C# to an other language, it might be the good way to make it work but i want to be able to fix/update/etc easy without alot of porting to other languages in my program.
Posted 23-Jan-13 9:30am
BullaR116
Updated 23-Jan-13 21:16pm
v2
Comments
Brisingr Aerowing 23-Jan-13 15:41pm
   
Where you have the catch(Exception) line, replace that with catch(Exception ex) and post the Stack Trace from the ex variable. You can just write it to a file and paste the text here. That info should help us figure out what went wrong.

My current guess is that your device does not support OpenGLES 2.0 for some reason.
BullaR 23-Jan-13 15:50pm
   
The only thing that pops up is: System.NotSupportedException..
i guesss that's not a good thing.. it didnt tell so mush..
BullaR 24-Jan-13 15:36pm
   
Got the error message:
System.NotSupportedException: Could not create OpenGLES 2.0 frame buffer
at Microsoft.Xna.Framework.AndroidGameWindow.CreateFrameBuffer () [0x00079] in c:\Users\BullaR\Desktop\MonoDevelup\MonoGame.Framework\Android\AndroidGameWindow.cs:171

at OpenTK.Platform.Android.AndroidGameView.LoadInternal (System.EventArgs) [0x00000] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/OpenGLES/Android/AndroidGameView.cs:242

at OpenTK.Platform.Android.AndroidGameView.SurfaceCreated (Android.Views.ISurfaceHolder) [0x0005d] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/OpenGLES/Android/AndroidGameView.cs:112

at Microsoft.Xna.Framework.AndroidGameWindow.Android.Views.ISurfaceHolderCallback.SurfaceCreated (Android.Views.ISurfaceHolder) [0x00001] in c:\Users\BullaR\Desktop\MonoDevelup\MonoGame.Framework\Android\AndroidGameWindow.cs:485

at Android.Views.ISurfaceHolderCallbackInvoker.n_SurfaceCreated_Landroid_view_SurfaceHolder_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.Views.ISurfaceHolder.cs:161

at (wrapper dynamic-method) object.b4a3c11e-f292-40e0-add7-4cd1a1b7c4d2 (intptr,intptr,intptr) <IL 0x00017, 0x00043>

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You can use free service provided by CodePorting.com to port your C# code to Java:
http://codeporting.com/[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100