Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does glCopyTexImage2D save its pixels to?

Name
glCopyTexImage2D — copy pixels into a 2D texture image

C Specification
void glCopyTexImage2D(GLenum  target,  GLint  level,  GLenum  internalformat,  GLint  x,  GLint  y,  GLsizei  width,  GLsizei  height,  GLint  border);

Apparently, the pixels must be stored somewhere, but where? The function returns void and does not use a pointer parameter.

SO, where does glCopyTexImage2D save its pixels to?

like image 274
Some Noob Student Avatar asked Feb 20 '23 06:02

Some Noob Student


1 Answers

Into a texture you specify as target (e.g. GL_TEXTURE_2D, which would mean currently bound 2D texture). After using that you can use glGetTexImage to fetch the pixels from the texture to your own buffer.

like image 72
Cat Plus Plus Avatar answered Feb 27 '23 02:02

Cat Plus Plus