mono - 如何为 AndroidGameView 启用抗锯齿 (4X MSAA)?

标签 mono xamarin.android xamarin opentk

我有一个简单的 OpenGL 应用程序,我正在尝试为其启用抗锯齿 (4x MSAA)。我似乎无法弄清楚如何使用 AndroidGameView 来做到这一点.

到目前为止,我一直通过 Developer Settings 菜单强制使用 4x MSAA 作为短期解决方案,但我希望能够以编程方式执行此操作。任何人都可以阐明这一点吗?

最佳答案

事实证明,以编程方式执行此操作的方法是在继承自 AndroidGameView 的类的 CreateFrameBuffer() 重写中设置 GraphicsMode 属性>:

    protected override void CreateFrameBuffer()
    {
        // Create a graphics context for OpenGL ES 2.0
        ContextRenderingApi = GLVersion.ES2;

        // Set the graphics mode to use 32bpp colour format, 24bpp depth, 8bpp stencil and 4x MSAA
        GraphicsMode = new GraphicsMode(new ColorFormat(32), 24, 8, 4); 

        // Create the frame buffer itself by calling the base class method
        base.CreateFrameBuffer();

        // Custom initialization code here
    }

感谢Cheesebaron引导我研究 AndroidGameViewGraphicsMode 属性。

关于mono - 如何为 AndroidGameView 启用抗锯齿 (4X MSAA)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19774622/

相关文章:

visual-studio - 单声道 2.6 和 Visual Studio 10

c# - 我需要做什么才能使此代码在可移植类库中工作?

java - ECDSA 签名生成 KeyPair Java 到 C# - JcaPEMKeyConverter()

c# - 如何使用 MVVM C#​​ 添加到 ObservableCollection

ios - 如何为iOS应用说明添加其他语言的本地化

android - 如何阻止我的 Android 模拟器的分区大小在关闭时重置?

f# - 如何在 Mac OS 上运行简单的 f# 程序

winforms - Mono Winforms MacOSX 替代 WebBrowser

c# - 尝试播放嵌入式YouTube网址时视频不可用(Xamarin.Android)

c# - 如何在 UITableView 上显示 JSON 数据