端口XNA 4.0到Android [英] Port XNA 4.0 to Android

查看:99
本文介绍了端口XNA 4.0到Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,我一直在尝试使用此手机将我的XNA游戏移植到Android: http:// www .youtube.com / watch?v = S4kbqU6feiA [ ^ ]



问题是当我运行程序时。我收到一个错误:

无法创建OpenGLES 2.0帧缓冲区



有谁知道我应该怎么做?我绝对不知道我该怎么做。

我不知道关于OpenGL / OpenTK的一件事。



PS。告诉我你是否需要更多代码。



Thx - Carl



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();
}





编辑(24 / 1-13):我试图不将C#移植到其他语言,它可能是使其工作的好方法,但我希望能够轻松修复/更新/等,而无需在我的程序中移植到其他语言。



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.

推荐答案

您可以使用CodePorting.com提供的免费服务将您的C#代码移植到Java:

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


这篇关于端口XNA 4.0到Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆