Archived

This topic is now archived and is closed to further replies.

Function call inconsistencies =-(

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

Hi. I''m having a little trouble with one of my programs and I need some professional help =-) Well, I''m making a maze program to use in my psychology class to take statistics of how quickly people can navigate mazes and their ability to learn after repeated tries through the same maze. I''ve got most of the maze program set up except for collision detection and other program-end dealies. However, I''m having a bit of trouble with a few function calls. Each wall of the maze has a corresponding object of class "Wall". All the walls are kept in a vector class I wrote called class "Array". Array has a method getSize() that returns the number of items in the vector. Now here''s where things get weird.... In my main game loop, I call g_wallList.getSize() (g_wallList is the global Array object in the game). It returns the correct number of walls and that allows me to loop through and render all the walls with the help of OpenGL. HOWEVER(!) inside my collision detection function, I call the SAME METHOD again and it returns 0(!!!) I through in some debug code that printed out the value of g_wallList.getSize() immediately BEFORE and AFTER I called the collision detect function and it gave me 2 DIFFERENT return values. I''m confused o_O Does anyone have any idea what might be wrong here? I can provide full source if neccessary. Also, I had a similar problem with Texture mapping in OpenGL with the glBindTexture command. If I used it in my main game loop, it worked fine, but inside the render method of the Wall class, it didn''t work at all and I got plain white walls =-( Can anyone help me here? "You TK''ed my chicken!"

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Everyone has problems like this occasionaly. It is almost always something small and stupid, which is hard to see by the person who wrote the code. I think you will have to post the code.

Share this post


Link to post
Share on other sites