Skip to content

Instantly share code, notes, and snippets.

@maxmcguire
Created January 28, 2014 17:55
Show Gist options
  • Save maxmcguire/8672710 to your computer and use it in GitHub Desktop.
Save maxmcguire/8672710 to your computer and use it in GitHub Desktop.
char pixels[32 * 32 * 4];
GLuint texture1;
glGenTextures(1, &texture1);
glBindTexture( GL_TEXTURE_2D, texture1 );
// Removing, moving this call after glTexSubImage2D, or changing GL_LINEAR to GL_POINT eliminates the crash
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexStorage2D( GL_TEXTURE_2D, 1, GL_RGBA8, 32, 32 );
glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, 32, 32, GL_RGBA, GL_UNSIGNED_BYTE, pixels );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment