Issues with COpenGLView::setVisible() and addView()

Hi Arne,

I have two related questions concerning COpenGLView. The first concerns the changes made in this commit:

https://github.com/steinbergmedia/vstgui/commit/809652687223b80e7d01a542cfc4d535cea524f8#diff-de2d26da6665a73f6ec01e60488f9e11

When you changed over to using nullptr, you changed

if (state && platformOpenGLView == 0)
{
	createPlatformOpenGLView ();
}

to

if (state && platformOpenGLView)
{
	createPlatformOpenGLView ();
}

which seems wrong to me, shouldn’t it be

if (state && (platformOpenGLView==nullptr))

?

My second question is a conundrum with using setVisible() as I have the following scenario: There are a couple of views, one of them containing a COpenGLView. When the viewcontainer is initialized, the platformOpenGLView is created, it is then subsequently destroyed by setVisible(false). So far so good, but when I remove the view and later do another addView(), the platformOpenGlView is again created, but in the next call to setVisible(), the value I get from isVisible() is false, so that I skip over destroyPlatformOpenGLView(), which means that my view is visible where I don’t want it.

Am I doing something fundamentally wrong here? And what is the reason behind if (state&&platformOpenGLView) instead of if(state&&(platformOpenGLView==nullptr))?

Best regards,
Andreas

Hi,
indeed the first one is a refactoring bug. For the second issue, can you write down the calls you make? That makes it more clear to me what you are doing.

Cheers,
Arne

Hi Arne,

I’m sorry, I was out of office due to illness and worked on some other issues in the meantime. I realized that I need to check if the issue is possibly related to another issue I’m currently investigating. If necessary, I’ll be back with a more precise question on the original topic.

In the meantime I have another ogl-related question though, in this commit https://github.com/steinbergmedia/vstgui/commit/6c5974c6f3ed64f3a9b1d2b576b96aecd3289295#diff-8a300c04df5cdd605ceda59b744124ba

you removed the kAccelerated flag. I’m not an expert in OpenGL, can I safely remove all references to that in the code I’m working with?

Best regards,
Andreas

Yes, kAccelerated is now mandatory.

Cheers,
Arne