Jump to content
  • Advertisement

Archived

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

TheShadow

Class Variables

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

If i have the following
  
BOOL Object::draw_object(GLfloat posx, GLfloat posy, GLfloat direction, int textureID)
{

	glLoadIdentity();
	glPushMatrix();
	glTranslatef(posx + 0.5, posy+ 0.5, 0.0f);
	glRotatef(direction, 0.0f, 0.0f, 1.0f);
	
	glBindTexture(GL_TEXTURE_2D, texture[textureID]);
	glBegin(GL_QUADS);
		glTexCoord2f(1.0f, 1.0f); glVertex2f( 0.5f, 0.5f);
		glTexCoord2f(1.0f, 0.0f); glVertex2f( 0.5f,  -0.5f);
		glTexCoord2f(0.0f, 0.0f); glVertex2f(-0.5f,  -0.5f);
		glTexCoord2f(0.0f, 1.0f); glVertex2f(-0.5f, 0.5f);
	glEnd();
	glPopMatrix();
	return TRUE;

}
  
And I want to modify textureID variable in the declaration of the member function to a different value from another member function... I declare it as a public variable
  

class Object
{
public:
	BOOL draw_object(GLfloat posx, GLfloat posy, GLfloat direction, int textureID);
	int Animate();
	GLfloat posx;
	GLfloat posy;
	GLfloat direction;
	int sprite;
	bool wall;
};
  
But when i modify it textureID = 2; for example... i dont get any results... how can i achieve this?

Share this post


Link to post
Share on other sites
Advertisement
I don''t get you completely, but it sounds like you want to pass texture1D by reference, or at least that''s what I think you want. You weren''t too clear.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!