Sign in to follow this  

Help with NeHe's Lesson 10

This topic is 3104 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
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

This topic is 3104 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this