Click here to Skip to main content
15,867,308 members

Port XNA 4.0 to Android

BullaR asked:

Open original thread
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

C#
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.
Tags: C#, XNA4.0

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900