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?