10 #ifndef __CPU_DATA_COPY_H__ 11 #define __CPU_DATA_COPY_H__ 19 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, out.
pbo());
20 glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, out.
size(), dataPtr);
21 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
33 template<
class Renderable,
typename T>
34 void copy(Renderable& out,
const T * dataPtr)
36 glBindBuffer(GL_ARRAY_BUFFER, out.vbo());
37 glBufferSubData(GL_ARRAY_BUFFER, 0, out.size(), dataPtr);
38 glBindBuffer(GL_ARRAY_BUFFER, 0);
43 #endif //__CPU_DATA_COPY_H__ FGAPI unsigned size() const
Get the OpenGL Pixel Buffer Object resource size.
Definition: CPUCopy.hpp:13
void copy(fg::Image &out, const T *dataPtr)
Definition: CPUCopy.hpp:17
FGAPI unsigned pbo() const
Get the OpenGL Pixel Buffer Object identifier.