Beispiel #1
0
void cSphere::initialise(cTexture theTexture)
{
	quad = gluNewQuadric();

	gluQuadricDrawStyle(quad, GLU_FILL);
	gluQuadricNormals(quad, GLU_SMOOTH);
	gluQuadricTexture(quad, GL_TRUE);

	glBindTexture(GL_TEXTURE_2D, theTexture.getTexture());

}
Beispiel #2
0
//Loads a model with a given file name and texture.
void cModelLoader::loadModel(const char* mdlFilename, cTexture mdlTexture)
{
	m_model = glmReadOBJ(mdlFilename);
	glmUnitize(m_model);
	glmFacetNormals(m_model);
	glmVertexNormals(m_model, 180.0f,false);
	m_TextureID = mdlTexture.getTexture();

	m_model->textures[m_model->numtextures - 1].id = m_TextureID;
	m_model->textures[m_model->numtextures - 1].width = mdlTexture.getTWidth();
	m_model->textures[m_model->numtextures - 1].height = mdlTexture.getTHeight();
}
void cStarfield::initialise(cTexture theTexture)
{
	srand((unsigned)time(NULL));
	glBindTexture(GL_TEXTURE_2D, theTexture.getTexture());
}