
VB .NET Help. Can't get OpenTK to do anything.
Posted Tuesday, 14 August, 2012 - 17:08 by sdchown inHi
I have installed it all and followed the VB .NET example, but all I get is a blank window. No colour, no nothing.
Any help? Any ideas?
Code below:
Imports System.Drawing Imports System Imports OpenTK Imports OpenTK.Graphics.OpenGL Public Class Mainform Dim loaded As Boolean = False Private Sub Mainform_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load InitializeComponent() End Sub Private Sub GlControl1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles GlControl1.KeyDown If e.KeyValue = Keys.Escape Then Application.Exit() Else GlControl1.Invalidate() End If End Sub Private Sub GlControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GlControl1.Load loaded = True GlControl1_Resize(sender, EventArgs.Empty) GL.ClearColor(Color.ForestGreen) End Sub Private Sub GlControl1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles GlControl1.Paint If Not loaded Then Exit Sub GL.Clear(ClearBufferMask.ColorBufferBit) GlControl1.MakeCurrent() GlControl1.SwapBuffers() End Sub Private Sub GlControl1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles GlControl1.Resize If Not loaded Then Exit Sub If GlControl1.ClientSize.Height = 0 Then GlControl1.ClientSize = New System.Drawing.Size(GlControl1.ClientSize.Width, 1) GL.Viewport(0, 0, GlControl1.ClientSize.Width, GlControl1.ClientSize.Height) End Sub End Class


Comments
Re: VB .NET Help. Can't get OpenTK to do anything.
Not really, the problem is if I reward you with the solution after you spammed so hard that you break your caps lock key ....... then this will be continued, because it has proven to work. Maybe not by you, but by others seeing that it works.
Re: VB .NET Help. Can't get OpenTK to do anything.
Fine, i'm jumping out my window.
Re: VB .NET Help. Can't get OpenTK to do anything.
Guess the window was at the ground floor :P I've actually deleted all his posts that were in the wrong topic and left only the post in the right topic here. (OpenTK.Compatibility.dll is for Tao/Glu old and deprecated stuff)