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

A user interface toolkit mainly for audio plug-ins (VST, AudioUnit, etc).
Post Reply
bx_andreas
Posts: 6
Joined: Fri Jul 13, 2018 12:31 pm

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

Post by bx_andreas » Fri Oct 04, 2019 1:07 pm

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

Arne Scheffler
Posts: 304
Joined: Mon Jun 20, 2016 7:53 am

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

Post by Arne Scheffler » Fri Oct 04, 2019 3:31 pm

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

bx_andreas
Posts: 6
Joined: Fri Jul 13, 2018 12:31 pm

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

Post by bx_andreas » Mon Oct 21, 2019 2:23 pm

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

Arne Scheffler
Posts: 304
Joined: Mon Jun 20, 2016 7:53 am

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

Post by Arne Scheffler » Mon Oct 21, 2019 3:49 pm

Yes, kAccelerated is now mandatory.

Cheers,
Arne

Post Reply