Jump to content
  • Advertisement
Sign in to follow this  

Texture gets distorted when loading + SDL (solved)

This topic is 3761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My textures end up like this: when trying to make them from a SDL surface using the following code:

	GLuint ttexture;

	glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
	glGenTextures(1, &ttexture);
	glBindTexture(GL_TEXTURE_2D, ttexture);

	SDL_PixelFormat *fmt = Surface->format;

	// If there is alpha
		gluBuild2DMipmaps(GL_TEXTURE_2D, 4, Surface->w, Surface->h, GL_BGRA, GL_UNSIGNED_BYTE, Surface->pixels);
		gluBuild2DMipmaps(GL_TEXTURE_2D, 4, Surface->w, Surface->h, GL_BGR, GL_UNSIGNED_BYTE, Surface->pixels);

Tried a bunch of code from all over the forum already, everyone gives a different distortion. Any suggestions? Edit: Solved. The problem wasn't there. Had my drawingcode drawing it tiled 50x50 :P [Edited by - Softnux on July 5, 2008 12:41:05 PM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!