PDA

View Full Version : I need a help on VB.Net



Mohamed Hassan
08-15-2002, 04:24 AM
Hello,
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.

Thanks.

Deiussum
08-15-2002, 05:08 AM
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.

DFrey
08-15-2002, 06:17 AM
I was about to try my hand at OpenGL with C# too. Not sure if I should take the time now. http://www.opengl.org/discussion_boards/ubb/confused.gif

Deiussum
08-15-2002, 07:45 AM
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. http://www.opengl.org/discussion_boards/ubb/smile.gif

marcus256
08-16-2002, 02:24 AM
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:
http://hem.passagen.se/opengl/glfw/

LiLGerald
08-17-2002, 02:39 PM
what do you mean
Originally posted by Mohamed Hassan:
Hello,
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.

Thanks.

LiLGerald
08-17-2002, 02:40 PM
do you beleave in jesus

Mohamed Hassan
08-17-2002, 10:04 PM
Thanks,
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.
Eng. M.Hsn