Hello,
I wonder if there's a way to use OpenGL directly from VB .NET, without any
C++ code, or CsGL library. I've tried to convert NeHe's first tutorial
(http://nehe.gamedev.net/data/lessons....asp?lesson=01) to VB .NET, but
it seems to behave improperly somewhere in this fragment:
~
PixelFormat = ChoosePixelFormat(hDC, pfd)
If PixelFormat = 0 Then
MessageBox(0, "Can't find a suitable PixelFormat.", "Error", MB_OK Or
MB_ICONERROR)
PostQuitMessage(0)
Exit Select
End If
If SetPixelFormat(hDC, PixelFormat, pfd) = 0 Then
MessageBox(0, "Can't set PixelFormat", "Error", MB_OK Or MB_ICONERROR)
PostQuitMessage(0)
Exit Select
End If
hRC = wglCreateContext(hDC)
~
In WinME, ChoosePixelFormat returns 0.
In WinXP, ChoosePixelFormat returns 5; but the trouble is with
SetPixelFormat: it returns 1, but actually it does nothing, because
wglCreateContext returns 0 with error code 2000 (invalid pixel format).
Any suggestions? Maybe there is another OpenGL example in VB .NET only?
Thanks in advance.