Jump to content
  • Advertisement
Sign in to follow this  
jo3_sum

Help with NeHe's Lesson 10

This topic is 3314 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

(I changed the name of the structure "triangle" to "triangle_s") I receive this error while compiling: invaild conversion from 'void*' to 'triange_s*' This is the line: sector1.triangle = malloc( numTriangles * sizeof( triangle_s)); The error is referring to "...triangle = malloc(...)" The assigning of the sector1.triangle to the malloc What do I need to do to fix it?

Share this post


Link to post
Share on other sites
Advertisement
I can't even get Lesson 10 to compile. Glut and Glaux is being a pain for me.
Edit:
Got it working. I am using a version that doesn't use Glaux and it's finally working.
By the way, I've renamed ALL instances of TRIANGLE to TRIANGLE_S and it works

[Edited by - Pirata Nervo on June 19, 2009 3:14:22 AM]

Share this post


Link to post
Share on other sites
I didn't actually read the code for that lesson so I don't really know what sector1 refers to, but sector1.triangle suggests that you probably forgot to rename that triangle to triangle_s.

Share this post


Link to post
Share on other sites
triangle is an instance of the structure triangle_s inside of an instance called sector1 which is stems from sector_s.
EDIT:
And I'm using the Linux/SDL example
EDIT:
Nevermind, I found out the problem. Instead putting a void* cast on triangle, I should have put a (triangle_s*) cast on malloc.

[Edited by - jo3_sum on June 19, 2009 9:24:54 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!