Page 1 of 1

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

Posted: Fri Oct 04, 2019 1:07 pm
by bx_andreas
Hi Arne,

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

https://github.com/steinbergmedia/vstgu ... 60488f9e11

When you changed over to using nullptr, you changed

Code: Select all

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

Code: Select all

if (state && platformOpenGLView)
{
	createPlatformOpenGLView ();
}
which seems wrong to me, shouldn't it be

Code: Select all

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

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

Posted: Fri Oct 04, 2019 3:31 pm
by Arne Scheffler
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

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

Posted: Mon Oct 21, 2019 2:23 pm
by bx_andreas
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/vstgu ... 9b744124ba

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

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

Posted: Mon Oct 21, 2019 3:49 pm
by Arne Scheffler
Yes, kAccelerated is now mandatory.

Cheers,
Arne