PDA

View Full Version : glut Issues



mhm27x5
04-10-2002, 08:54 PM
Ok.... I'm having a bit of a problem with glut (and Borland c++ builder 5.0). For some reason, it will run just fine, and then when recompiling, it will just crash with the error "Project Project2.exe raised exception class EAccessViolation with message 'Access violation at address 1000BBAE. Read of address FFFFFFFF'. Process stopped. Use Step or Run to continue.", and the line it shows having caused the error isn't one that i changed, in any way since the previous compile.

If i comment out that line, then the next one causes the same error, and so on. So, if i comment out the line before all of this, it causes an error at a completely different section of code, although it is still the same error (with a different address in the "Access violation at address 1000BBAE" part).

There is an image online at http://www.dollsap.com/derivative/error.gif of what the error screen looks like, including the error message, and the line of code that it finds the error at.

If anyone can help me on this matter, i'd be really really appreciative.

Also, i'm using glut 3.7.6

email me at derive @ telusplanet . net

Gavin
04-10-2002, 11:32 PM
Why you calling glInit?

Bob
04-11-2002, 02:00 AM
He probably calls glInit to setup some states, like enable depth test, create textures, and so on, before the rendering starts.

Anyways, the first thing you should do before calling any other GLUT function, is to call glutInit with proper parameters.

coredump
04-11-2002, 04:35 AM
does your glutResize function return void and take two integers? aside from seeing the rest of your code, that's all i could see.

b

Gavin
04-11-2002, 07:54 AM
ok, but he can create a glut window without calling it though.....

mhm27x5
04-11-2002, 11:23 AM
Ok, a few things that i should have said, as well.

Firstly, the code is nearly an exact copy & paste of some demo code i got for a library that uses glut. The only parts that have changed are not in the main function.

Secondly, I didn't even realize that it didn't have the glutInit() function is part of it. However, having just tried putting that in there, it didn't solve the problem. it still crashes at the same point.

Also, all the functions for the glutResizeFunc() and so on, afaik, if they didn't take the proper parameters, i should get a compile time error - i think.

Either way, it does have the proper parameters.

If it would help, i just posted the code online, at http://www.dollsap.com/derivative/code.txt

Thanks.

Rob The Bloke
04-11-2002, 12:18 PM
I can compile and execute that without any problems. The only differences I have are the headers :

#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>
#include "glTexFont.h"

and I'm using the straight font.tga that Nate provides with his source. Couldn't imagine that would be the problem though.

You could try running a debugger through the code and have a look at the call stack when it crahses to see what went wrong. It may be a graphics card issue.

mhm27x5
04-11-2002, 01:02 PM
Yeah, and the differences in headers is just from where i'm putting mine. Hrm...

And as i did say, its compiled just fine for me before, too. Just for whatever reason, it decided to start giving me that error. I'll try the debugger thing, though. see where that gets me...

Thanks.

Gavin
04-12-2002, 01:11 AM
Can you just get the window ok, without the fonts etc...?