Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualSponji

Posted 10 August 2013 - 08:53 AM

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);

 

You should use unsigned char instead of unsigned int, now you're allocating too much memory for the data.


#2Sponji

Posted 10 August 2013 - 08:50 AM

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);

 

You should use unsigned char instead of unsigned int, now you're allocating too much memory for the data.


#1Sponji

Posted 10 August 2013 - 08:50 AM

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);

 

You should use unsigned char instead of unsigned int, now you're allocating too much memory for the data.


PARTNERS