LWJGL / lwjgl3-wiki

The LWJGL 3 Wiki
415 stars 35 forks source link

glGenBuffers(int, IntBuffer) no longer exists #6

Closed nanodeath closed 6 years ago

nanodeath commented 6 years ago

I'm trying to follow along in the 1.3 Memory FAQ tutorial, and near the middle there's a line of code glGenBuffers(1, ip);, but as far as I can tell, that method no longer exists (3.1.6). It's hard to tell exactly where I should be looking, because none of the examples have imports, but I was expecting to find it around here. If I just drop the int parameter, I get a JVM crash. Suggestions?

Thanks!

Spasi commented 6 years ago

Thanks, fixed with 5049efa.

LWJGL methods that accept buffers are usually auto-sized. This means that when there's another parameter that defines how big a buffer parameter is, LWJGL automatically passes the correct value there, properly derived from the buffer's number of .remaining() elements.

Dropping the int parameter should not cause a crash. In order to identify the issue, try:

nanodeath commented 6 years ago

Turned out to be user error, of course -- if you try to run examples from that particular page, without doing all the setup mentioned on the OpenGL page, well...turns out some of that initialization logic is kinda important!

Thanks for updating the docs.