[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: opengl and textures



Francesco Orsenigo:
 |Any idea/suggestion?

Sure sounds like your texture isn't being loaded up-front.  Use glGetError
(for testing only) and make sure no OpenGL errors are being thrown in your
startup and draw.  If so, chase 'em down.

Shots in the dark:

  glTexEnvf   ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE  );
  glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_WRAP_S, GL_CLAMP   ) ;
  glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_WRAP_T, GL_CLAMP   ) ;

Probably not:

  glPixelStorei ( GL_UNPACK_ALIGNMENT, 1 ) ;

since you said it works the second time, without reloading the texture
presumably.

Also what's your blend function set to?

 |Is there any book/online-resource where i could find answer to such
 |questions

Grab a copy of the OpenGL red book and turn to a texturing example.

Randy