I tried to import the type library vbogl.tlb
to a vb.net assembly and it can’t be imported. I tryed also to use the declare statements to declare the functions directly from opengl32.dll but i can’t get any gain.
using opengl32.dll function wglcreatecontext falis with error code (2000: invalid pixel format) from GeLastError() even if the SetPixelFormat()succeeded.
Can any one help me.
I ran into similar problems trying to play with OpenGL in C#. I was trying to import everything myself, and no matter what I did, wglCreateContext would fail. I finally looked at some code that someone did to use OpenGL in C# and was suprised to notice that he did all his pixelformat stuff in C in a separate DLL.
So… I’m thinking that the .Net managed vs. unmanaged code just does something weird that makes using .Net and OpenGL together not very pretty.
I was about to try my hand at OpenGL with C# too. Not sure if I should take the time now.
I don’t remember the guys name who did the OpenGL library for C#, but it seems that pretty much every example of OpenGL in C# uses that.
I guess it’s probably a pretty good way to go if you want to do OpenGL in C#, but when I was thinking of playing with it, I really wanted to be able to directly do the OpenGL programming w/o using some other person’s library. More work maybe, but more fun, IMO.
Perhaps one alternative could be to use the GLFW OpenGL toolkit, which at least has support for Visual Basic 6.x. There are also (preliminary) OpenGL & GLU bindings available in the GLFW VB distro. Check:
Thanks for every body tryed to help me.
I have already built an opengl component with
VC++ and using it. It run very well on all .Net applications. But I need to build the same code from scratch using vb.net. I don’t prefere to use another dll or com.