[SOLVED]Is this possible?

Started by
5 comments, last by Jesse Dager 11 years ago

I am trying to create a class based system for rendering Bullet Physics objects in openGL, however, I run into problems with this:


		float mat[16];
		t.getOpenGLMatrix(mat);
		glPushMatrix();
			glMultMatrixf(mat); //translation,rotation
			glColor3f(red,green,blue);
			gluSphere(quad,r,40,40);
		glPopMatrix();

It is in a different file than my main.cpp... I figured that was what was causing the error.

I get an error: Unhandled exception at 0x69939161 in JTechEngine.exe: 0xC0000005: Access violation reading location 0xcdcdcdcd.

My question is: Is there any way to draw a gluSphere from within a separate file?

I develop to expand the universe. "Live long and code strong!" - Delta_Echo (dream.in.code)
Advertisement
Any time you see an address such as 0xcdcdcdcd in an exception error message, it is a good indication that you are trying to access an un-initialized pointer. On which line of your code does this occur? That should give you a good idea of which pointer is invalid.

On which line of your code does this occur?

That's the problem... It only tells me that the problem is in glut32.dll.

I develop to expand the universe. "Live long and code strong!" - Delta_Echo (dream.in.code)
You do not get a stack trace?


You do not get a stack trace?

glut32.dll!55fe9161

I develop to expand the universe. "Live long and code strong!" - Delta_Echo (dream.in.code)
You need to get a stack trace to figure out which call is calling into glut32.dll when the segfault happens. On the basis of the code you posted above (if it is, indeed, one of these lines that is causing it) it possibly is segfaulting on the line gluSphere(quad,r,40,40); So, are you sure that quad is valid? What was the result of the gluNewQuadric() call that you used to create quad?

You need to get a stack trace to figure out which call is calling into glut32.dll when the segfault happens. On the basis of the code you posted above (if it is, indeed, one of these lines that is causing it) it possibly is segfaulting on the line gluSphere(quad,r,40,40); So, are you sure that quad is valid? What was the result of the gluNewQuadric() call that you used to create quad?

The result is: I forgot to call it. :p Oh such the life of noobish mistakes. Thank you to everyone who replied. I got it to work simply by defining quad with gluNewQuadric()

I develop to expand the universe. "Live long and code strong!" - Delta_Echo (dream.in.code)

This topic is closed to new replies.

Advertisement