OpenGL as event driven appplication - call for discussion

Up front
please no "OpenGL it is not event driven … it is graphic… "
Also if this is inappropriate to discuss here , just ignore it.

Here is a very nice description of OpenGL as a event driven application.

The relations of main loop and callback functions is the key , and it all works as expected.
The article does not cover interaction between redrawing, reshaping etc.
That has be a sore subject for me so far , especially when object are rendered and
window is maximized.
Anyway - any other members here doing "event driven / state machine " code using OpenGL ?
Like to hear form them .

I’m not sure what you’re asking here. Are you asking for commentary on that presentation?

Because it’s ultimately pretty bad. It promotes the erronous conflation of OpenGL and GLUT. It spreads OpenGL calls out across a bunch of GLUT callbacks, which can make it difficult to track the state of the program’s rendering. It even promotes using fixed-function GL, which was removed 6 years prior to that presentation’s release.

Worst of all… it has a bug in it. The reshape callback resets the current modelview matrix. And since the state of the animation (the current angle of rotation) is never saved, this causes the animation to be reset whenever the window is resized.

Basically, that presentation will teach you a bunch of bad ideas. Learning from it is a mistake.

You have indirectly pointed to my current “problem” .
I hope you are only referring to the link “problem” and this issue can be resolved.
Yes, it has to do with resizing.
I am can put it only in this description.
I can render complex object(s) by rendering each one in its own matrix.
I can freely resize / maximize etc.

However, such rendering is done in single C case code.

Now I need to add more objects to the original, in different “case” , and cannot get the resizing work on the original and the addition.

For now I can hack the next "case " be adding / copying the original code in addition to the new code .
Looks goofy, too many “rewrites” , even when I bypass majority of the debugging scaffolding.
So I need to go back to basic - how OpenGL pipe handles the results of all the manipulation. I am sure I’ll find the answer , someday.

BTW this problem has nothing to do with the idea using OpenGL as event application. In my opinion the idea is sound, after all a major OS is based on event and callback processing .

I was looking for somebody who " been there , done that ".

That’s what makes this all so confusing. Because “that” is just… using GLUT.

That presentation didn’t present some fantastical new idea. “Event Driven OpenGL Programming” is not a concept or a construct. There is no “idea” to be “sound”. It was just presenting some GLUT code, and not particularly good GLUT code at that.

Anybody who has used GLUT could write something similar.

So again, it’s really unclear what you want here. Unless what you want is for someone to tell you how to use GLUT, which… I mean, there are tutorials and documentation for doing that.