Archived

This topic is now archived and is closed to further replies.

sela_lerer

OpenGL in VB

Recommended Posts

I wouldnt recommend using OpenGL in VB, since you will always be one step back. But, since you are willing to do gl + vb, why dont you download the ports of the tutorials?

Also a google search might help you
www.google.com

Share this post


Link to post
Share on other sites
quote:
Original post by cANaBiTz
ihhh vb sux PPP


As a professional VB user I feel offended by that. It''s all very well going on about how *insert language name here* is far better than VB, but the fact is that with VB you can do just about anything that you can do in other languages. Name an example, and I will prove you wrong.

Anyway... first off you will need to download the VB type library for OpenGL. Then you can just follow the NeHe tuts as is (GLfloat etc. work, and all functions are included. It even has a few other MS libs included so you can avoid Declare statements), converting to VB as needed. Quick guide:

  • Remove semicolons ";" and replace with colons ":" to separate commands on the same line

  • Replace curly braces "{}" with the VB equivalent (e.g. "if (x) {blah}" turns into "if x then blah" with an "end if" if needed)


It''s mostly obvious. Don''t be afraid to ask for if you need to.

One word of warning: you *might* have problems with the wglCreateFontOutlines() function. It crashed VB on my PC, but I thinl it''s just my seriously mangled Win2k install.


--- Thomas McCorkell

Do or do not. There is no try. ~ Yoda
Many that live deserve death. And some that die deserve life. Can you give that to them? ~ Gandalf

Share this post


Link to post
Share on other sites
quote:
Original post by BoggyB
Name an example, and I will prove you wrong.
...
One word of warning: you *might* have problems with the wglCreateFontOutlines() function. It crashed VB on my PC, but I think it's just my seriously mangled Win2k install.



how about wglCreateFontOutlines( ) BoogyB
im not interested in what i can do and what i can not do. i just hate this basic syntax.
the only cool thing is vba (because in school i used it to code tic tac toe because excel was too boring and since i had no compiler i had to use it ;D)


[edited by - cANaBiTz on November 7, 2002 5:12:38 PM]

Share this post


Link to post
Share on other sites
cANaBiTz:
I don''t think that the original poster intended this to become a VB bashing thread. So hold it. If you have something productive to add to this thread (using OpenGL in VB, in case you don''t remember) then you''re welcome to contribute it. Flamebait comments, OTOH, are not welcome. Any further Anti-VB/C/C++/whatever flamebait will be deleted without further notice.

Share this post


Link to post
Share on other sites
>rant<STUPID THINGY REJECTED MY PASSWORD AND MADE ME RETYPE MY POST!!!>/rant<

Anyway... now I've got to try and remember what it was I had typed in.

Seriously condensed rant follows:

quote:
Original post by cANaBiTz
how about wglCreateFontOutlines( ) BoogyB


quote:
Original post by BoggyB
One word of warning: you *might* have problems with the wglCreateFontOutlines() function. It crashed VB on my PC, but I think it's just my seriously mangled Win2k install.



Read the message. I said I thought it was just my PC.

quote:

im not interested in what i can do and what i can not do. i just hate this basic syntax.



I'm not a great fan of the C/C++ syntax (I keep on leaving off the ******* ";") but I put up with it and don't moan about it.

quote:

the only cool thing is vba (because in school i used it to code tic tac toe because excel was too boring and since i had no compiler i had to use it ;D)



VBA is a core part of VB. VB uses three main libs: VB, VBA and VBRUN.




Right... now I had written some advice here on OpenGL and VB >rant<STOOPID INSERT KEY>/rant< (you can see I'm not particularly pleased with my PC, Internet Explorer and this message-board software. It *would* be nice if I didn't have to start again just cos I got my pwd wrong. *breath slowly, be calm*) Now, what did I write? Oh yeah...

The type libraries are not required but they do save writing a load of Declare statements. There are two available:

The type libs came from this site, and there is plenty of other VB-related info there. Enjoy.



I formally apoligize for any signs of me being in a bad mood that are present in this message.

--- Thomas McCorkell

Do or do not. There is no try. ~ Yoda
Many that live deserve death. And some that die deserve life. Can you give that to them? ~ Gandalf

[edited by - boggyb on November 9, 2002 5:37:47 AM]

[edited by - boggyb on November 9, 2002 5:39:15 AM]

Share this post


Link to post
Share on other sites
I recommend reading through my VB port(s)... I can''t remember which lessons I ported now, it was so long ago, but I remember that they were superior to the other VB ports

Also try www.planet-source-code.com/vb/ and search for OpenGL TGA or something along those lines and you should come up with an example program I wrote on loading BMP/TGA/RAW files from VB using pure VB code (No 3rd party libs). My ports created Win32 windows using API function calls. As I''m sure you can imagine, this makes the code easier to read along with NeHe''s tutorials. I once wrote an MD2 model viewer in VB in collaboration with this German guy, though I never submitted it..

Also about VB''s limitations... I might add that I was quite big on the amateur VB game development scene a few years back. I have talked to Patrice Scribe about his (original) win32.tlb project. I have even got the source to the OpenGL 1.2 type library as I was starting a project intended to update the type library to 1.3. I used DirectX5 in VB (Note: Before Microsoft ever even considered VB as a viable platform for DX development - thus there was no official DX support), and used to play with all kinds of interesting things!

1) Arrays. VB arrays are slow, and clunky. This is because they are not real arrays, but rather ''safearrays''. Ever tried to lock a DirectDraw surface in VB to get access to the pixel data? Well, locking it is simple, but I mean have you tried using that pointer? In C you just cast the pointer to a (BYTE*) and increment the pointer as you iterate through the memory. In VB you had to do it the ''manual'' way - IE get the pointer, create a ''safearray'' using vb structures and code (Which were ripped out of the internals of the VB runtime), copy the memory from the pointer to the safearray, manipulate the memory IN the array and then you had to write it back. Interesting technique, but painfully slow.

2) Pointers. We''re all programmers here, we''ve all heard of pointers at least, but until you use a language other than BASIC, you wont get to play with them. See #1.

3) Lack of inline assembler. When VB code wasn''t fast enough, it seemed logical that another language was needed. I used to write win32 dll''s in C, and use inline assembler in there. If you wanted ultimate speed, you''d write your dll in NASM, compile the code into an .obj file, and then use the VB (LINK.EXE) linker to make the dll. All very interesting, but not very practical. Some kind of inline assembler would have been nice.

There were other things - but those were the main pitfalls of game development in VB. There were workarounds, but since I learnt C++ I haven''t looked back.

Share this post


Link to post
Share on other sites