I want to make the background to scroll from left to right, right now my background image is in the openGL file, but how should I make it to move. My code for the background image.
The size of the background image is 800 by 600. I make it to 1600 so that only the left part of the image would be shown. How should I code such that the background image moved when the character was moving towards the right. All my character and others has been done expect the background scrolling.Code:/* glPushMatrix(); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBindTexture(GL_TEXTURE_2D, BackgroundTexture[imageNumber].texID ); glPushMatrix(); glBegin(GL_QUADS); int height = 100 * 1.333/1.5; glTexCoord2f(0,0); glVertex2f(0,600); glTexCoord2f(1,0); glVertex2f(1600,600); glTexCoord2f(1,1); glVertex2f(1600,0); glTexCoord2f(0,1); glVertex2f(0,0); glEnd(); glPopMatrix(); glDisable(GL_BLEND); glPopMatrix(); */