Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

[SOLVED]Is this possible?

4: Adsense

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   

619
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)

#2 FLeBlanc   Members   

3137
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   

619
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   

1410
Like
0Likes
Like

Posted 13 April 2013 - 05:56 PM

You do not get a stack trace?

#5 sethhope   Members   

619
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   

12629
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   

619
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.