View Full Version : Bugs in OpenGL

05-21-2001, 02:25 AM

I am having some problems with OpenGL that I do not understand. I am programming using VB and the program stops at a line that should not produce any errors like:

glcolor3f 0.2,0.2,0.3

To resolve this error I simply insert at the begining:

on error resume next

This works ok because the program only stops sometimes.

05-21-2001, 05:36 AM
hmm did you just make a typo here, the correct call should be



Mr. Obvious
05-21-2001, 06:03 AM
In VB you can't use the ; after a function call. You either use glColor3f 0.2,0.2,0.3 or Call glColor3f(0.2, 0.2, 0.3)

05-22-2001, 12:11 AM
I am sure that the code is not wrong because, during debug, I just press the continue button and it executes ok. It is probably because it is being interpreted and not executed after being compiled.

05-22-2001, 05:28 AM
Sorry if this sounds too insulting, but I have to ask. Are you sure you don't just have a breakpoint there?

05-22-2001, 05:49 AM
Of course not. In VB I press run (F5), there is no break point. I rotate the object several times using the mouse and this line is executed several times. Then suddenly, the program breaks and indicates that it cannot run because of an error on that line. I suspect that I should compile the program first and then execute it, but I don't think this should happen. It might also be a problem of memory, I don't know.

05-22-2001, 06:13 AM
Pressing f5 to run your program won't make it not stop at breakpoints. Not knowing how much experience you really have with VB and the fact that what you described sounds a LOT like a breakpoint, I had to ask so don't be too offended.

When it stops you can try typing the following into the immediate mode window.

print err.number

If that is anything but 0 do

print err.description

05-22-2001, 06:15 AM
Just to clarify something, anytime you run your app from the VB IDE it is basically interpretted. Only when you build the exe and run that directly are you running against a compiled version.

Mr. Obvious
05-22-2001, 09:49 AM
billy, Are you getting an error at this point? If you handle your error, use (MsgBox "Error #: " & Err.Number & vbCrLf & "Error Desc: " & Err.Description)... if not, use the method that Deiussuum describes to find if there is an error at that point.

The VB IDE will break on errors depending on what settings you have under Tools...Options... then the General Tab (Error Trapping).

If you give the error number and description that would help.

05-25-2001, 10:43 AM
heh! It gives me some pretty wierd stuff when I run my apps... When I get to a certain point in code (it's just random), it'll give me some error (I can't remember it now cuz i'm at school) and the IDE asks me if I want to debug. When I compile it and run it, it gives me the same stuff. And when I remove the perfectly legitamate statements I had just added, it runs perfectly. WTF!!! In short, help?

05-25-2001, 07:35 PM
In Delphi when running under debugger OpenGL crashes randomly. Sometimes it runs slow(it may be slow software mode and slow hardware mode, slow hardware is faster), and crashes only in this "slow" mode.
I know nothing about VB debugger, but try disabling it and running compiled program without IDE.