Question

I am drawing 2 triangles in opengl es 2.0 using vbo.

the program handle (hProgramHandle)

hProgramHandle = glCreateProgram(); // value is 210003

is same as the iVertBuffId

glGenBuffers(1, &iVertBuffId1); // for vertices   // 70001
    ...
    ...
glGenBuffers(1, &iVertBuffId2); // for color   // 140002
    ...
    ...
glGenBuffers(1, &iVertBuffId3); // for texture  // 210003

I have created 3 buffers (each for position, color and texture). The above issue is coming while generating the buffer for the texture.

I am not getting the output.

Will opengl generate the same number for the program id and vbo buffer id?

Was it helpful?

Solution 2

Ids returned by OpenGL are in fact names refering to its internal storage. Internal OpenGL storage is divided by speciality, so it can optimize its memory access at will. Where this is counter-intuitive is that ids are in fact not unique, but rather dependant on what you are talking about to OpenGL : e.g. what is currently bound.

It is absolutely correct for OpenGL to give you identical ids, as long as they refer to something different : texture ids and buffer ids can overlap, that's not a problem.

Remark that they may or may not overlap, and begin by 0 in order or simply give you what seems to be random numbers, that is implementation dependant.

OTHER TIPS

That is dependent on the implementation of the particular OpenGL ES driver you are running, but yes the values can be the same because they are handles to different types of objects and not necessarily memory pointers. Think of them as indexes into different data structures.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top