Jump to content
  • Advertisement
Sign in to follow this  
xinvar

OpenGL [Another problem ] glIsTexture succeeds but glBindTexture fails

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

[edit 3]: Now glIsTexture succeeds but glBindTexture fails...
	SetContext();			// doesn't help.
	glEnable(GL_TEXTURE_2D);	// doesn't help either.
	if ( glIsTexture(m_piTexture) == GL_FALSE  ) 
		MessageBox("Texture is not valid in ");
	// Typical Texture Generation
	glBindTexture(GL_TEXTURE_2D, m_piTexture);
	CheckGLError("Error Binding texture");
glIsTexture(m_piTexture) returns GL_TRUE. But CheckGLError (which calls glGetError()) returns GL_INVALID_VALUE. I set up the current rendering context, enabled texture2D, but that didn't solve the problem. What could be wrong? [Original post]: Hi, I've been working on my computer (windows XP + nVidia Quadro 4400) for quite a while without any problem with my textures. But when I run the same program in another computer (windows XP + Quadro FX 50 -- this is what shows up in device manager, is there such a card?) the textures got messed up. I have three textures: m_piTexture[3]. glGenTextures(3, &m_piTexture[0]); // glGetError() returns GL_NO_ERROR here, and m_piTexture = 1, 2, 3. But for ( int i = 0; i < 3; i ++ ) glIsTexture(m_piTexture) all return GL_FALSE in the FX50 computer, and following binding only works for the first texture (m_piTexture[0]) -- and even binding texture 0 returns GL_INVALID_VALUE with glGetError(). Calling glGetError after binding texture 1,2 would also give GL_INVALID_VALUE. Am I missing something here? Why the two computers behave differently? BTW the FX50 machine supports OpenGL 1.1 (checked), since texture objects use OpenGL 1.1. edit: fixed. The FX50 machine needs a driver update. edit2: now it fails on a laptop. The Dell laptop has Mobility Radeon 9000. I installed the most up-to-date driver from Dell (Radeon Mobility's drivers are from vendors, not from ATI), but this doesn't solve the problem. So I believe there is something wrong with my program. But what could it be? [Edited by - xinvar on July 29, 2005 5:09:00 PM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
From the OpenGL 2.0 spec
The command
     boolean IsTexture( uint texture );
returns TRUE if texture is the name of a texture object. If texture is zero, or is a nonzero
value that is not the name of a texture object, or if an error condition occurs,
IsTexture returns FALSE. A name returned by GenTextures, but not yet bound, is
not the name of a texture object.
So if you're calling glIsTexture before you bind the texture names you get from glGenTextures that's most likely the problem.

Share this post


Link to post
Share on other sites
Thank you Kalidor... That solves the problem! And thanks for quoting the OpenGL specification. MSDN didn't say that.

Quote:
MSDN:

If the texture parameter is currently the name of a texture, the glIsTexture function returns GL_TRUE. The glIsTexture function returns GL_FALSE if texture is zero. It also returns GL_FALSE if it is a non-zero value that is not currently the name of a texture, or if an error occurs.


[Edited by - xinvar on July 29, 2005 5:39:22 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!