debugging - How to get all current OpenGL bindings -


i learning opengl via superbible , internet, , concept see causing trouble glbindxxx (see instance accepted answer of concept behind opengl's 'bind' functions typical problem related bindings.)

you can/have bind buffers (glbindbuffer) before setting them used glvertexattribpointer. can/have bind vao (glbindvertexarray) before setting glverteyattribpointer, , on, never ending chain of current binding dependencies.

sometimes, if forget binding program might still work if simple enough, have seen lots of people taking time find source of bug hidden binding not aware of.

is there command in opengl list last binding? similar glgetallbindings, , return last bound id of each glbindxxx functions (a small list of them below based on superbible 6th edition)

glbindbuffer glbindbufferbase glbindframebuffer glbindimagetexture glbindprogrampipeline glbindsampler glbindtexture glbindtransformfeedback glbindvertexarray glbindvertexbuffer

for instance, if performed glbindbuffer buffer id 1 parameter , again buffer id 2, glbindvertexarray id 3 , glbindvertexarray id 5, function return 2 glbindbuffer , 5 glbindvertexarray.

with that, can know in context before applying new settings.

i believe needing understand , debug binding problems.

is there command in opengl list current bindings?

no. really, how there be?

many objects bound specific targets particular type of object. buffer objects alone have dozen. , textures not bound target, bound combination of texture unit and target. combination of (unit 0, gl_texture2d) can have different texture bound (unit 0, gl_texture3d). , number of texture units modern hardware required @ least 96 (16 per stage * 6 shader stages).

it not reasonable have single function regurgitate of information.


Comments