fabioguerrazzi's picture

Installed OpenTK, first run from VB.NET, it asks *.cs files??

I am new to OpenTK, not really new to OpenGL, I was using GLUT libraries in the past. Now trying some features whatever I put in the code, the first class is going to use, debugging the code it stops and open a dialog window to select a *.cs file.

The project does not contains compiler warning,
I am running on Seven 64bit, Visual Studio 2013 Express, Debugging as "AnyCPU", framework 4.0
Loaded OpenTk.Dll and OpenTkControl as references

ALso I don't see any GL Control available on my tab controls..

any help would be apreciated, thanks

Imports OpenTK
Imports OpenTK.Platform
Imports OpenTK.Graphics
Imports OpenTK.Graphics.OpenGL
 
Public Class myCore
    '  Inherits GameWindow
 
    Private m_wi As Platform.IWindowInfo
    Private m_context As IGraphicsContext
    Private Const rotation_speed As Single = 40.0!
    Private angle As Single
    Private vertOffset, normOffset, texcoordOffset As Integer
    ' helpers FG
    Private FloatSize As Integer
    Private IntSize As Integer
    Private mWindow As System.Windows.Forms.Form
    Private m As MeshData
    Private dataBuffer As UInteger
    Private indexBuffer As UInteger
    Private tex As UInteger
    Private up As OpenTK.Vector3d = New OpenTK.Vector3d(0, 1, 0)  ' <----- HERE ASK Vector3.cs
    Private viewDirection As OpenTK.Vector3d = New OpenTK.Vector3d(1, 1, 1)
    Private viewDist As Double = 1
    Private vShaderSource As String = " void main() {gl_Position = ftransform(); gl_TexCoord[0] = gl_MultiTexCoord0;}"
    Private fShaderSource As String = "uniform sampler2D tex; void main() {	gl_FragColor = texture2D(tex, gl_TexCoord[0].st);}"
 
    Public Sub New(Window As System.Windows.Forms.Form)
        '  MyBase.New(Window.Width, Window.Height)
 
        mWindow = Window
        m_wi = Platform.Utilities.CreateWindowsWindowInfo(Window.Handle)
        ' Construct a new IGraphicsContext using the IWindowInfo from above.
        m_context = New GraphicsContext(GraphicsMode.Default, m_wi)
        m_context.MakeCurrent(m_wi)
        m_context.LoadAll()
 
        GL.Clear(ClearBufferMask.ColorBufferBit)
        GL.MatrixMode(MatrixMode.Projection)
        GL.LoadIdentity()
        GL.Ortho(0, Window.Width, Window.Height, 0, -1, 1)
 
        If Environment.Is64BitOperatingSystem Then
            FloatSize = 8
            IntSize = 8
        Else
            FloatSize = 4
            IntSize = 4
        End If
    End Sub
 
etc..
Inline Images

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

The debugger is asking for the source code of OpenTK so it can step through its code.

How did you install OpenTK? Are you using the nuget packages or the installer from sourceforge?

Normally, you can add GLControl to your toolbox by right-clicking inside the toolbox and selecting "Choose Items" -> OpenTK.GLControl.dll -> GLControl.

fabioguerrazzi's picture

The installer from sourgeforge, put it not on default Document user folder but on \Programs\OpenTk1.1, then added as referenced browsing for folders.

I got this, running a simple test app, on Output window. Modulo compilato senza simboli. means "module compiled without symbols"

'TkTest.vshost.exe' (CLR v4.0.30319: TkTest.vshost.exe): caricamento di 'C:\0\dx\OpenTK\TkTest\TkTest\bin\Debug\TkTest.exe' completato. Simboli caricati.
'TkTest.vshost.exe' (CLR v4.0.30319: TkTest.vshost.exe): caricamento di 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll' completato. Simboli caricati.
'TkTest.vshost.exe' (CLR v4.0.30319: TkTest.vshost.exe): caricamento di 'C:\0\dx\OpenTK\TkTest\TkTest\bin\Debug\OpenTK.GLControl.dll' completato. Modulo compilato senza simboli.
'TkTest.vshost.exe' (CLR v4.0.30319: TkTest.vshost.exe): caricamento di 'C:\0\dx\OpenTK\TkTest\TkTest\bin\Debug\OpenTK.dll' completato. Simboli caricati.
'TkTest.vshost.exe' (CLR v4.0.30319: TkTest.vshost.exe): caricamento di 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_it_b77a5c561934e089\mscorlib.resources.dll' completato. Modulo compilato senza simboli.
Eccezione first-chance di tipo 'System.DllNotFoundException' in OpenTK.dll

The control yes, thanks, I was used to build my own and they appear automatically, never added one external before, thanks

I don't know what's wrong, meybe 2013 is fighting with GL? I will try with an older ones

the Fiddler's picture

The DllNotFoundException may be normal. OpenTK is trying to load SDL2.dll on startup, but will work correctly without this dll. If you press continue, does it run or does the application exit?