All pastes #240623 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-11-05 20:50 UTC
rendered paste body
void initTextures()
{
	// load the texture map from a file
	int width, height;   // dimensions of the texture
	GLubyte *image = loadPPM("earthmap2.ppm", width, height); 
	
	
    // id = 13
    glBindTexture(GL_TEXTURE_2D, 13);
    glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, image);

	delete [] image;
}