Hello, first i shall explain my circumstances. First, i know that visual basic 6 isn’t the best choice for openGL but this is my software design and development major project (in year 12) and the teacher said -only- visual basic 6 may be used. I wanted to show off and do something good, Neverwinter nights, one of my favourite games i hear was written in openGL. Also, another contributing factor to me choosing openGL is that one of my other friends choose to do his in directx, i couldn’t use the same thing he did of course . Anyway, back to the problem, i’ve so far been able to get everything to work - spent alot of time on graphics/forms/rotating and character models for my project. It all looks quite nice.
Then, i decided to finally get around to object selection, this seemed abit advanced at first, and there weren’t any tutorals out there for visual basic 6 (i was using nehe at the time mainly though). Slapping this off at people just prefuring C/C++ over VB6 for the more advanced stuff i got the C code and converted it accross to VB6 and into my current application. it was this bit of code that didn’t work mainly…
glSelectBuffer 32, selectbuffer
glGetIntegerv glgViewport, ViewPortCoords
glselectbuffer “size as glsizei, buffer as gluint”.
where selectbuffer is an array of size 1 to 32 (code strait from tutorial but in VB6 format). The syntax which pops up automatically once you type glselectbuffer is “size as glsizei, buffer as gluint”. From everything i have read, buffer is a pointer to an array which it will store information in. Unforunatly VB6 doesn’t support pointers AT ALL. ViewPortCoords is also an array of size 1 to 4 and is suposed to be used for the same purpose (it stores the top/bottom/right/left co-ordinates of the viewing area)
now of course i didn’t just run strait to these sorts of forums to ask help of everyone i researched it alot on the net in an attempt to find out how to do it. there are 2 ways i have thought of as to how to get around this. First, borrow the pointer function from a .dll (say c++'s one, use its pointer function) and then subsitute that for the point where its needed. I took a look at how MSDN explained this and was utterly confused, way to high level for me .
2nd way i thought of was to declare the 4 seperate variables that glGetIntegerv obtains seperately, and then use those to determine the new matrix’s size (if this is possible, only a theory). As for the selectbuffer for this idea…don’t know heh.
My original code was tested in my first creation, a menu screen, just to begin with i attempted to get the ‘exit’ button on the menu to actually exit the program.
Its really urgent that i get this problem fixed up as the project will be due soon and i hope those who do try might enjoy the challange!
Sum Up Needs:
Must use VB6
creation of buffer or
use of pointer
if i’ve left anything out, please tell me! need help, will do anything within my power (i don’t want to scrap all those hours of work)
i mentioned NEHE visit this link… http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06 , go to the bottom of the screen and download the ‘visual basic code’ one, this’ll have the library in it.
EDIT: oops, this was original a post in another forum (its hard trying to find solution to this) and i basically copy/pasted it, but the ‘attachment’ bit makes no sense anyway, check out this website for the code + Library.