Swapping Textures

How i could do to swap texture "menu.bmp" and "f40.bmp"?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 void initRendering() {
	glEnable(GL_DEPTH_TEST);//Permet el test de profunditat o Z-Buffer
	glEnable(GL_COLOR_MATERIAL);//Permet la aplicació de colors als models
	glEnable(GL_LIGHTING);
	glEnable(GL_LIGHT0);
	glEnable(GL_NORMALIZE);

	//Inicialitza la textura
	//Image* image = loadBMP("C:\\menu.bmp");//La direcció de la imatge a carregar			
	Image* image = loadBMP("C:\\f40.bmp");//La direcció de la imatge a carregar
	_textureId = loadTexture(image);
	delete image;//Elimina la imatge, ja que ara el programa n'ha fet una copia

	glClearColor(0.2f, 0.2f, 0.2f, 1.0f);
}


I'm looking for a way of swapping them by changing mode from 0.0f to 1.0f. This worked fine in everythig except for the textures.

In other things of the game I used a clasic "if mode = 1 then you are on the menu" "if mode = 0 you are driving the car", but with the textures I can't do it

What I should change on the code?

P.S. Textures are on 10 and 9 lines respectively

Thank you,


Marc
Last edited on
Topic archived. No new replies allowed.