1
\$\begingroup\$

In OpenGL (ES 2.0), there are many functions that can be called in any order, and still others that must be called after other functions had been called and not before.
For example, attaching a shader to a program requires a valid program so glAttachShader must be called after a call to glCreateProgram(). glCreateProgram() must be called after GL initialization etc.
Any functions that assume a certain "current" state, depend on the functions that set this state previously (defaults notwithstanding).
Such a dependencies necessary conditions for correct functioning (but not necessarily sufficient).

Is there a document or diagram somewhere that explicitly shows these dependencies and independencies? All I found were the occasional implicit mention in the texts.

This would be very helpful for debugging, learning and understanding the framework structure and also for developing higher-level tools that abstract away some of the low-level complexity.

\$\endgroup\$
4
\$\begingroup\$

Well, OpenGL is a state machine, so inorder to plot function dependencies you need to plot a state machine, there is this one that models the most recent versions of OpenGL pipeline including ES2.0 and 4.0. Unfortuantely I couldn't find a diagram the plots function dependencies but I guess that can be mostly deduced from the state machine.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.