I tried to create a new GameWindow in VB.NET using the OpenTK library.
The game window works fine, I can maximize it or change its size perfectly fine, but it takes a few seconds for the window to appear in the taskbar and it's very laggy when I right-click it in the taskbar.
I tried
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
. Changing it to 4.0 doesn't fix the issue. This was a bug in the way OpenTK 1.0 interacted with keyboard layouts. It has been fixed in OpenTK 1.1.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.