Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actual___

Posted 11 August 2013 - 07:15 AM

remove clamp add 

  glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 

 

but anyway we don't see your drawing routine that might cause trouble.

anyway change your 3d array to 1d (its not so hard)

 

 

and why do you use glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

 

here is how i make texture from pixels:

ofc GLCAM_TEX is unsigned int



glEnable(GL_TEXTURE_2D);
pData = new unsigned int [256*256*3];
glGenTextures(1, &GLCAM_TEX);           //Texture binding
glBindTexture(GL_TEXTURE_2D, GLCAM_TEX);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexImage2D(GL_TEXTURE_2D, 0, 3, 256, 256, 0, GL_RGB, GL_UNSIGNED_BYTE, pData);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
		  glDisable(GL_TEXTURE_2D);

#1___

Posted 10 August 2013 - 06:48 AM

remove clamp add 

  glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 

 

but anyway we don't see your drawing routing that might cause trouble.

anyway change your 3d array to 1d (its not so hard)

 

 

and why do you use glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

 

here is how i make texture from pixels:

ofc GLCAM_TEX is unsigned int

glEnable(GL_TEXTURE_2D);
pData = new unsigned int [256*256*3];
glGenTextures(1, &GLCAM_TEX);           //Texture binding
glBindTexture(GL_TEXTURE_2D, GLCAM_TEX);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexImage2D(GL_TEXTURE_2D, 0, 3, 256, 256, 0, GL_RGB, GL_UNSIGNED_BYTE, pData);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
		  glDisable(GL_TEXTURE_2D);

PARTNERS