Cromon

Buffer.cpp

Oct 20th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1.         Buffer::Buffer() {
  2.             ext::glGenBuffers(1, &mBufferID);
  3.         }
  4.  
  5.         Buffer::~Buffer() {
  6.             ext::glDeleteBuffers(1, &mBufferID);
  7.         }
  8.  
  9.         void Buffer::updateResource(const void* data, uint64 numBytes) {
  10.             ext::glBindBuffer(GL_ARRAY_BUFFER, mBufferID);
  11.             ext::glBufferData(GL_ARRAY_BUFFER, numBytes, data, GL_DYNAMIC_DRAW);
  12.             ext::glBindBuffer(GL_ARRAY_BUFFER, 0);
  13.             glFlush();
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment