Jump to content

  • Log In with Google      Sign In   
  • Create Account

[SOLVED]Is this possible?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 sethhope   Members   -  Reputation: 462

Like
0Likes
Like

Posted 13 April 2013 - 09:27 AM

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)

Sponsor:

#2 FLeBlanc   Crossbones+   -  Reputation: 3117

Like
1Likes
Like

Posted 13 April 2013 - 10:33 AM

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.

#3 sethhope   Members   -  Reputation: 462

Like
0Likes
Like

Posted 13 April 2013 - 04:42 PM

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)

#4 tanzanite7   Members   -  Reputation: 1378

Like
0Likes
Like

Posted 13 April 2013 - 05:56 PM

You do not get a stack trace?

#5 sethhope   Members   -  Reputation: 462

Like
0Likes
Like

Posted 13 April 2013 - 06:42 PM


 

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)

#6 JTippetts   Moderators   -  Reputation: 8653

Like
1Likes
Like

Posted 13 April 2013 - 06:53 PM

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?

#7 sethhope   Members   -  Reputation: 462

Like
0Likes
Like

Posted 13 April 2013 - 07:56 PM

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)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS