Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#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