PDA

View Full Version : segfault after glGetTexImage



_NoName_
10-22-2016, 07:41 AM
Im trying to save my rendered image as a .ppm file but if I use glGetTexImage() and after that glUseProgram() I always get segmentation fault.
Do anyone know why I get this error.
This is the way I get my texture data : glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_BYTE, pixelBuffer);
(If I dont use glGetTexImage I dont get any error).

mhagain
10-22-2016, 09:52 AM
Is pixelBuffer sized large enough to recieve the data?

Dark Photon
10-22-2016, 08:20 PM
Is pixelBuffer sized large enough to recieve the data?

And if you are expecting tightly-package RGB8 data to be returned, have you specified:

glPixelStorei(GL_PACK_ALIGNMENT, 1)

For details, see this section in the OpenGL wiki:

* Common_Mistakes#Texture_upload_and_pixel_reads (https://www.opengl.org/wiki/Common_Mistakes#Texture_upload_and_pixel_reads)