View Single Post
Posts: 317 | Thanked: 787 times | Joined on Oct 2009 @ Krakow, Poland
#10
Originally Posted by juise- View Post
It seems that the buffer is given as parameter to glTexImage2D(). Check the documentation to see exactly what that function does to the buffer.

Does the free() work if you comment out the call to glTexImage2D()?

Does it work if you place it immediately after malloc()?
free() works when glTextImage2D is commented. Khronos API docs say nothing about memory management, but standard OpenGL docs say that I should free my pixels as they are copied to video memory after call to glTextImage2D.

Thanks everyone for your help.