CAN we Using OpenGL with Visual Basic

Please confirm me, can we use OpenGL with visual basic

Thanks

Yes, but it’ll run slower.

I’m sure if you go to www.google.com and type OpenGL VB you’ll find plenty of code samples.

As a matter of fact, NeHe.gamedev.net may even have some of the tutorials ported to VB - try there. Just open one of the lessons and scroll down the bottom - I’m sure at least one of them will have been ported to VB.

[This message has been edited by DalTXColtsFan (edited 07-16-2003).]

That’s not necessarily true. The calls to OpenGL will be made in probably the same way they would be made normally…

My experience with using OpenGL in VB has just shown a few quirky bugs I couldn’t figure out, like if I even touched the HDC I was going to be using before creating a context it would break it and the HGLRC would never be created properly.

OpenGl with VB is not necessarily slower but there are a few catches. First and foremost, don’t think of distributing your 16k program. Along with the VB runtimes, it will be blown to around 5 MB. Secondly, VB throws up quite some errors that are unheard of such as divide by zero errors. U can workaround by issuing ‘on error resume next’ but it isn’t safe. Thirdly, if u plan to make high performance games, forget VB.

Regards.

A VERY good sight to learn OpenGL with VB is http://is6.pacific.net.hk/~edx/ I use VB and i still get good FPS (Over 100 most times). The only thing that you want to avoid for OpenGL is the Error call, on error resume next, or on error goto ___, and it runs ALOT faster compiled. Another thing that will make it go faster is when you compile it go to advanced options and check all the options there. No aliasing, Remove Array bounds check, etc. If all those are checked it will go 30 up FPS faster.

Good Luck

[This message has been edited by zix99 (edited 07-18-2003).]

and I still wonder why everyone wants to use vb… why not learn/use c++/deplphi?? Does anyone REALLY like VB???

Actually I program in Visual Basic. There tends to be an unfair feeling that VB programmers are poor cousins of C++ ones.

As regards the Division by Zero, with some cards you need to set the shininess parameter to 1.0 then you should not have any problems. I did encounter this problem, but I do not think it is VB related

the feeling is not about the programmer but about vb… I really don’t think that vb is a good programming language. and if c++ is too complicated one can use delphi, which is as easy as vb and much more powerful, as far as i know.

and vb is proprietary microsoft, and that s*cks.

and I still wonder why everyone wants to use vb…

The reason is, somewhere along the line, inexperienced folks get coerced into using it on the job – their boss knows VB, and says, “Here’s your development environment (MS VB install CD’s), here’s your VB libraries (or whatever it is that VB uses), get this done.”

Worse yet, some previous pet project was started using VB and now the boss wants you to take it over and “polish it up”. :frowning:

This almost happened to me, but I got out of it and ended up using MSVC++6 and Win32, redoing it from scratch.

I once asked one guy at work to show me what a VB source code file looks like, and he opened it up in MS Word. True story.

Originally posted by jmg:
[b]and I still wonder why everyone wants to use vb…

The reason is, somewhere along the line, inexperienced folks get coerced into using it on the job – their boss knows VB, and says, “Here’s your development environment (MS VB install CD’s), here’s your VB libraries (or whatever it is that VB uses), get this done.”

Worse yet, some previous pet project was started using VB and now the boss wants you to take it over and “polish it up”.

This almost happened to me, but I got out of it and ended up using MSVC++6 and Win32, redoing it from scratch.

I once asked one guy at work to show me what a VB source code file looks like, and he opened it up in MS Word. True story.[/b]

Holy Smokes!!! Thats exactly the situation I am in right now. Unfortunately the project is far to large to redo from scratch in the time frame I’ve been given. Sigh VB 6 is so limited.

Old GLman

I used a VB some time ago. Then I forced myself to learn C++ and now I would never change it. I’ll tell you one - difficulty of ALL programming languages is similiar. Basics are usually the same - you just have to learn a structure and a few commands to begin writing your first program.

But there are some disadvantages in VB - it has a really stupid syntax and programs are terribly big (and need some additional dll’s).

Also I think that OpenGL would most likely run with C++. It was designed to use with C, really (at least from what I know…).

doesn’t vb also lack some essential programming structures like a sophisticated class/object mechanism and dynamic memoy allocation without a garbage collection? I would never want to write a complex project with a programming language with garbage collection (an exception may be java as it is really useful for certain things). in my opinion, vb is not a “real” programming langauge at all… and its strictly microsoft, never will run on linux. and as delphi is REALLY easy, i think it is a really good advice to bother with it… it does not even cost any money if you download the personal version.

Actually, GLFW has support for VB (includes GLFW DLL + bindings + OpenGL & GLU bindings). You don’t have to mess with DCs etc. Great if all you want is an OpenGL window without nifty VB widgets etc.

Apart from that, I think VB is really a very bad programming language. Opposite to what most people believe, the syntax, variable and memory management etc makes it more difficult to understand and use the language.

I’m a C-programmer by nature, but I started a new job a month ago (OpenGL/CAD) where we do everything in Delphi, and I must say that I was very pleasantly surprised! Besides a few quirks in the built in editor (no end-of-line wrapping, no line numbers…), and not-100%-perfect optimization (compared to state of the art C/C++ compilers), it really shines. It’s truly structured (more so than C anyway), extremely easy to use (easier than VB in my opinion) and it’s even portable (ever heard of Kylix?).

Like most people here, I’m not a big fan of VB. It does have it’s uses, though. OpenGL doesn’t happen to be one of them, though. It IS pretty good for testing out COM objects, however.

From what I understand, VB (not unlike PowerBuilder) is good for rapid WYSISYG development of 2-tier Windows client-server apps. I’ve heard it doesn’t scale well, but I don’t have any direct experience.

I’m sure it works well for what it was designed, but if I were to write OpenGL programs (and by a stroke of coincidence that’s exactly what I’m doing ), I’d use C++. If you want WYSIWYG drag-and-drop GUI around your OpenGL rendering, I’d strongly suggest looking into Borland’s C++ Builder. It’s a little pricey, but it makes Windows programming a lot easier than it did with Visual C++. At least it did for me.