简体   繁体   中英

checking gpu for VBO existence

I got a (pre-made) Opengl vertex buffer object (VBO)
but I don't know it's GLuint value to submit it in opencl ..

is there a check in any opengl library (like glew) to give me existing VBOs and its corresponding GLuint that are currently on the gpu (or anything similar..as only thing i know about data inputs is number of elements in the array and array size)

edit: why i don't know GLuint ...

it's a function in cinema4d opengl api (have to use this function to access cinema4d VBO) ..this function(or i should say alot of class functions) are automatically doing something like this

allocSubBuffer ...with *pBuffer (object oriented C++) mapBuffer ..returns void *pData then cast this *pData to a vector *pvData then pass the array values to that *pvData then unmapbuffer... after this there's something called pFactory...it assigns automatically a new VBO ...

but I don't know it's GLuint value

Then how do you use the VBO from OpenGL? You have to glBindBuffer it in OpenGL as well. OpenGL object IDs are precious, keep them close, and keep them safe.

Creating a OpenGL object without remembering its name is like allocating some memory with new or malloc and then throwing away the pointer: A waste of memory.

Maybe glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &buf) will do the trick for you. Ie you force somehow cinema4d to bind the buffer and then query for currently bound buffer ID.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM