[PyOpenGL-Users] glMapBuffer with GL_WRITE_ONLY
Brought to you by:
mcfletch
From: Colin C. <cjc...@gm...> - 2009-04-03 02:10:39
|
Hi everyone, I've managed to get VBOs working in my PyOpenGL application, but I've hit a wall trying to update the data in them. My VBOs contain position and texcoord data only (not interleaved). Every few frames I need to change some of the texcoord data. I know this is done with glMapBuffer, but I can't wrap my head around the python bindings for this function. glMapBuffer returns a ctypes.c_void_p. I'm very comfortable with C, but not with ctypes. I want to treat this c_void_p like a python list of floats, and use slicing to change the values at particular locations. Is this possible? I'm also very worried about performance; I don't want any of the texcoord buffer to be copied back into main memory. I've spent a lot of time hunting around with Google, but I'm still lost. Any help is greatly appreciated. Colin |