Advertisement

error in tutorial 36

Started by July 15, 2005 10:28 AM
-1 comments, last by frca 19 years, 2 months ago

GLuint EmptyTexture()
{
	GLuint txtnumber;
	unsigned int* data; // unnecessary line

	data = (unsigned int*)new GLuint[((128 * 128)* 4 * sizeof(unsigned int))]; // unnecessary line

	ZeroMemory(data,((128 * 128)* 4 * sizeof(unsigned int))); // unnecessary line

	glGenTextures(1, &txtnumber);
	glBindTexture(GL_TEXTURE_2D, txtnumber);
	glTexImage2D(GL_TEXTURE_2D, 0, 4, 128, 128, 0,  // unnecessary line
		GL_RGBA, GL_UNSIGNED_BYTE, data);  // unnecessary line
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

	delete [] data;  // unnecessary line

	return txtnumber;
}
try to delete unnecessary lines and that should still work :-) however, i liked this tutorial much :-)

This topic is closed to new replies.

Advertisement