fix GLWpfControlSettings
This commit is contained in:
@@ -11,6 +11,7 @@ Imports System.Windows.Forms.Integration
|
|||||||
Imports OpenTK.Mathematics
|
Imports OpenTK.Mathematics
|
||||||
Imports System.Windows.Input
|
Imports System.Windows.Input
|
||||||
Imports Key = OpenTK3.Input.Key
|
Imports Key = OpenTK3.Input.Key
|
||||||
|
Imports OpenTK.Wpf
|
||||||
|
|
||||||
Namespace PreviewN
|
Namespace PreviewN
|
||||||
|
|
||||||
@@ -136,8 +137,8 @@ Namespace PreviewN
|
|||||||
Me.glControlHost.Name = "glControl1"
|
Me.glControlHost.Name = "glControl1"
|
||||||
Me.glControlHost.Anchor = AnchorStyles.Left Or AnchorStyles.Top Or AnchorStyles.Right Or AnchorStyles.Bottom
|
Me.glControlHost.Anchor = AnchorStyles.Left Or AnchorStyles.Top Or AnchorStyles.Right Or AnchorStyles.Bottom
|
||||||
Me.glControlHost.Location = New Point(0, 0)
|
Me.glControlHost.Location = New Point(0, 0)
|
||||||
Me.glControlHost.MinimumSize = New Size(600, 120)
|
|
||||||
Me.glControlHost.Size = Me.ClientSize
|
Me.glControlHost.Size = Me.ClientSize
|
||||||
|
Me.glControlHost.MinimumSize = New Size(600, 120)
|
||||||
Me.glControlHost.TabIndex = 0
|
Me.glControlHost.TabIndex = 0
|
||||||
Me.glControlHost.TabStop = False
|
Me.glControlHost.TabStop = False
|
||||||
Me.glControlHost.Child = glControl1
|
Me.glControlHost.Child = glControl1
|
||||||
@@ -149,7 +150,12 @@ Namespace PreviewN
|
|||||||
|
|
||||||
'Toolkit.Init()
|
'Toolkit.Init()
|
||||||
|
|
||||||
Dim controlSettings As New Wpf.GLWpfControlSettings
|
|
||||||
|
Dim controlSettings As New GLWpfControlSettings With
|
||||||
|
{
|
||||||
|
.RenderContinuously = False,
|
||||||
|
.GraphicsProfile = Windowing.Common.ContextProfile.Compatability
|
||||||
|
}
|
||||||
glControl1.Start(controlSettings)
|
glControl1.Start(controlSettings)
|
||||||
AddHandler glControl1.MouseWheel, AddressOf glControl1_Wheel
|
AddHandler glControl1.MouseWheel, AddressOf glControl1_Wheel
|
||||||
ProjMatrix = Matrix4.CreatePerspectiveFieldOfView(FOV, glControl1.Width / glControl1.Height, 100.0F, 100000.0F)
|
ProjMatrix = Matrix4.CreatePerspectiveFieldOfView(FOV, glControl1.Width / glControl1.Height, 100.0F, 100000.0F)
|
||||||
@@ -257,8 +263,8 @@ Namespace PreviewN
|
|||||||
|
|
||||||
Private Sub glControl1_Resize(sender As Object, e As EventArgs) Handles glControlHost.Resize
|
Private Sub glControl1_Resize(sender As Object, e As EventArgs) Handles glControlHost.Resize
|
||||||
'glControl1.Context.Update(glControl1.WindowInfo)
|
'glControl1.Context.Update(glControl1.WindowInfo)
|
||||||
GL.Viewport(0, 0, glControl1.Width, glControl1.Height)
|
GL.Viewport(0, 0, glControlHost.Width, glControlHost.Height)
|
||||||
ProjMatrix = Matrix4.CreatePerspectiveFieldOfView(FOV, glControl1.Width / glControl1.Height, 100.0F, 100000.0F)
|
ProjMatrix = Matrix4.CreatePerspectiveFieldOfView(FOV, glControlHost.Width / glControlHost.Height, 100.0F, 100000.0F)
|
||||||
glControlHost.Invalidate()
|
glControlHost.Invalidate()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user