我尝试使用OpenTK库在VB.NET中创建一个新的GameWindow。
游戏窗口工作正常,我可以最大化它或完全改变它的大小,但窗口出现在任务栏需要几秒钟,当我在任务栏中右键单击它时,它非常迟缓。
我试过
Entry point
)Imports OpenTK
Imports System.Threading
Module Main
Public Sub Main()
Dim MainGameWindow As New MyGameWindow
MainGameWindow.Run(30, 60) 'Tried changing this to MainGameWindow.Run(1, 1)
End Sub
End Module
GameWindow
)Imports OpenTK
Imports OpenTK.Graphics
Imports OpenTK.Graphics.OpenGL
Public Class MyGameWindow
Inherits GameWindow
Private GlLoaded As Boolean = False
Public Sub New()
MyBase.New(820, 520)
Title = "Game Test"
Icon = My.Resources.gameicon
End Sub
Private Sub MyGameWindow_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
GlLoaded = True
End Sub
Private Sub MyGameWindow_RenderFrame(ByVal sender As Object, ByVal e As OpenTK.FrameEventArgs) Handles Me.RenderFrame
If Not GlLoaded Then Return
'Nothing here yet...
End Sub
Private Sub MyGameWindow_UpdateFrame(ByVal sender As Object, ByVal e As OpenTK.FrameEventArgs) Handles Me.UpdateFrame
If Not GlLoaded Then Return
'Nothing here yet...
End Sub
Private Sub MyGameWindow_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
'Nothing here yet...
End Sub
End Class
.NET Framework 2.0
。将其更改为4.0无法解决问题。答案 0 :(得分:1)
这是OpenTK 1.0与键盘布局交互方式的一个错误。它已在OpenTK 1.1中修复。