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

Hi Arne,

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

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 remove scale factor from opengl view, clients should use frame->getSc… · steinbergmedia/vstgui@6c5974c · GitHub

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