OpenGL on JUCE made simple (well... sort of...)

While familiarizing myself with OpenGL (and JUCE way of using it) I found a lot of questions which were not clearly addressed in JUCE forums nor code nor in other places to get a quick, simple, one-stop information source to understand the basics of its working. Of course everything is there somewhere, and the code written by Jules et al. is really top-notch, but seems incredibily painful to use because of the lack or dissemination of information (mainly code comments).

BTW I believe this is THE major flaw in Juce which apart from that is one of the best software frameworks I have seen in my lonnnnng career...

Anyways, as I struggled myself I thought I would share the commented code that I used to test the OpenGLAPPExample app, which is the most up-to-date piece of software to understand JUCE/OpenGL interaction and usage.

It is now part of a GitHub pull request ( and I hope that it will be integrated in the official JUCE master branch, but that's Jules decision, of course.

And obviously I am keen to receive comments/critics/modifications to make this a better tool for developers who are not yet familiar with the sophisticated mazes of the very powerful OpenGL library and JUCE framework.

This is my first contribution to the amazing JUCE framework (I hope this the right way to propose changes btw), but I hope it will help some newcomers. 


I am very much in favour of commenting the various demos to effectively turn them into tutorials.

It means that rather than having documentation, tutorials and code in three places, they become one and the same thing. Which is all good.

One technique you might like to consider that I employ in my own code is this:

If you are trying to document some process where execution frequently jumps from one code location to another, you can create comments such as:

// walkthrough_startup_01

// walkthrough_startup_02

Then using your IDE, you search your project for walkthrough_startup and it lists all matches, hopefully ordered correctly. And it becomes very easy to navigate.

Not sure whether this is particularly relevant for this case (I just skimmed) but I thought I would mention it anyway.


Thanks Alan - will take a look at this asap!