ClientSize不更新Linux上C#中的GameWindow宽度和高度

问题描述 投票:0回答:1

我有以下方法负责设置加载时窗口的大小(这全部发生在MyClass类中,该类是GameWindow的子类)。

protected override void OnLoad( EventArgs e )
{
    // called during application initialization
    GL.ClearColor( 0, 0, 0, 0 );
    GL.Enable( EnableCap.Texture2D );
    GL.Disable( EnableCap.DepthTest );
    GL.Hint( HintTarget.PerspectiveCorrectionHint, HintMode.Nicest );
    Console.WriteLine(Width.ToString() + " " + Height.ToString()); // 640, 480
    ClientSize = new Size( 640, 400 );
    app = new MyApplication();
    Console.WriteLine(Width.ToString() + " " + Height.ToString()); // 640, 480
    app.screen = new Surface( Width, Height );
    Sprite.target = app.screen;
    screenID = app.screen.GenTexture();
    app.Init();
}

我在使用ClientSize时遇到问题,因为它似乎将输入的值作为建议。不管我输入什么,“宽度”和“高度”始终分别保持为640和400。我希望它能改变这些价值观。我检查了一个运行Windows的朋友,对他来说,它的工作正常。尽管我不确定,但我正在运行Linux,但感觉与此有关。我正在使用Mono进行编译。而且我已经看过几件事:

[此错误报告看起来可能是在谈论我的问题:https://github.com/opentk/opentk/issues/259,但该错误已修复,并且我使用可调整大小的窗口,而不是固定的窗口。

有人可以帮我吗?任何帮助都将不胜感激。

c# linux mono opentk
1个回答
0
投票

没有解决方案,我已经提出了一个问题。如果您对此还有疑问,请在此处寻求进一步的帮助:

https://github.com/opentk/opentk/issues/1053

当OpenTK更新到版本4.0时,它可能应该已修复,但是该版本仍处于beta中。

© www.soinside.com 2019 - 2024. All rights reserved.