Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Texture problems

This topic is 5567 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

*Sigh* I''ve been using textures in OpenGL for years now but they are allways unreliable and unpredictable. Usually I can fiddle with them enough that they work, but in the simple case I cannot get them to work proporly. Its a simple thing I''m doing, every frame I put new image info into the texture then apply it to a quad the size of the screen (aka. project it up onto the screen). This allows for easy resizing of the screen etc. Problem is its not working, I''m left with a white polygon every time no matter the input. The texture is created as follows:
		glGenTextures(1, &texid);
		glBindTexture(GL_TEXTURE_2D, texid);

And then the image data is put into it and its applied to the square (on every frame, the preceeding code was only done once at the beginning):
	glBindTexture(GL_TEXTURE_2D, texid);	
	glTexImage2D(GL_TEXTURE_2D, 0, 3, 100, 100, 0, GL_RGB, GL_UNSIGNED_BYTE, screen);
Thanks, ~SPH

Share this post

Link to post
Share on other sites

  • 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!