SHARE
TWEET

Untitled

a guest Apr 15th, 2019 159 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // glBufferStorage
  2. {
  3.     GLuint buf;
  4.     glGenBuffers(1, &buf);
  5.     glBindBuffer(GL_ARRAY_BUFFER, buf);
  6.     glBufferStorage(GL_ARRAY_BUFFER, 20, null, GL_DYNAMIC_STORAGE_BIT);
  7.  
  8.     GLint size;
  9.     glGetNamedBufferParameteriv(buf, GL_BUFFER_SIZE, &size);
  10.     writeln(size); // prints 20
  11. }
  12.  
  13. // glNamedBufferStorage
  14. {
  15.     GLuint buf;
  16.     glGenBuffers(1, &buf);
  17.     glNamedBufferStorage(buf, 20, null, GL_DYNAMIC_STORAGE_BIT); // 1282 GL_INVALID_OPERATION error generated. <buffer> does not refer to an existing buffer object.
  18.  
  19.     GLint size;
  20.     glGetNamedBufferParameteriv(buf, GL_BUFFER_SIZE, &size); // 1282 GL_INVALID_OPERATION error generated. <buffer> does not refer to an existing buffer object.
  21.     writeln(size); // prints 0
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top