Hi,
I may have missed something in my code because while the OpenGLAppExemple runs just fine mine encounters an access violation error when i try to access:
openGLContext.extensions.gl*
Theses functions pointers are all null by the time i try to call them…
I tried to call
openGLContext.extensions.initialize()
before trying anything else but it does not help
When these functions pointers are initialised ? How does one do that ?
I am using an OpenGLAppComponent:
SynaestheticAppComponent::SynaestheticAppComponent() :
OpenGLAppComponent{},
manager{openGLContext}
{
setSize(800,600);
openGLcontext.extensions.initialise();
manager.init();
}
The manager.init() function needs to call some of the openGLContext.extensions.gl* functions
I may not have the right settings as my project is an AudioPlugin
I defined JUCE_OPENGL3 though
I took a look at several posts on the forum but could not find a solution…
Do you have any clue ?
Thank you,
Adrien
fr810
July 10, 2017, 9:33am
2
Can you debug your app and step into openGLContext.extensions.initialize() to see what happens?
Thanks a lot for replying, I have been unable to work since then…
Took screenshots to make it clearer:
And so on…
In the OpenGLAppExemple, openGLContext.extensions.initialise() is called from a thread… and works !
How should i do it ?
Can’t see where this thread is created
Do you need any additional information ?
Adrien
I noticed the same in my app, and TBH it just looks like initialise() gets called at a later time - when my top-level component is made visible.
Where (or… when?) are you trying to call these GL functions?
As you can see above, at first, i tried to call these functions in my component constructor (manager.init() uses them)
Now i just tried to call manager.init() after the top level component is made visible, like so:
renderWindow = new RenderWindow(*this, “Render window”, Colour::fromFloatRGBA(0.2f, 0.2f, 0.2f, 1.f), true);
renderWindow->setVisible(true);
renderWindow->getGLComponent().openGLContext.extensions.initialise();
renderWindow->getGLComponent().getScenesManager().init();
And i got the same problem
Is there any guideline ? How things should be done ?
Can i have the control over the moment this initialisation is done ?