PDA

View Full Version : CAN we Using OpenGL with Visual Basic



muhammadatharniaz
07-16-2003, 11:53 AM
Please confirm me, can we use OpenGL with visual basic

Thanks

DalTXColtsFan
07-16-2003, 12:50 PM
Yes, but it'll run slower.

I'm sure if you go to www.google.com (http://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).]

07-16-2003, 07:52 PM
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.

abhijeet_maharana
07-17-2003, 12:12 AM
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.

zix99
07-18-2003, 05:46 AM
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).]

JanHH
07-18-2003, 06:00 AM
and I still wonder why everyone wants to use vb.. why not learn/use c++/deplphi?? Does anyone REALLY like VB????

07-18-2003, 01:20 PM
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

JanHH
07-18-2003, 02:43 PM
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.

jmg
07-19-2003, 05:17 PM
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.

07-19-2003, 06:29 PM
Originally posted by jmg:
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". http://www.opengl.org/discussion_boards/ubb/frown.gif

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.

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

Orzech
07-20-2003, 12:37 PM
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...).

JanHH
07-20-2003, 01:24 PM
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.

marcus256
07-21-2003, 03:58 AM
Actually, GLFW (http://hem.passagen.se/opengl/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?).

Deiussum
07-21-2003, 04:36 AM
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.

starman
07-21-2003, 04:53 AM
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 http://www.opengl.org/discussion_boards/ubb/wink.gif), 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.