Jump to content

[v2.15.1] DESTROY flag


photo

Recommended Posts

Hi there!

In some API Migration documentation I have seen that the DESTROY flag returned from the getFlags() function has been removed from the App class. In the 2.15.1 documentation the CustomApp class still have a reference to this flag but in the API I can not access to it.

In the process to move a test application from the 2.4.1 to the 2.15.1 I need to translate the next line to the new API but with the missing flag I'm not sure how to do it with this particular problem

if ((getFlags() & DESTROY) && mContext != nullptr)
{
  Unigine::CustomApp::destroy();
  GLWarpper::glDestroyContext(mDisplay, mContext);
  mContext = nullptr;
}

As bonus, I also can not find the equivalent App::destroy() function we were using in the old 2.4.1.

There are other destroy functions realted to pointers managemetn replaced by the deleteForce() function, but this destroy() I don't know how the update it.

Edited by Gmarquez
Link to comment

Hello,

We don't destroy context during the lifetime of the application anymore. So you can just delete everything related and destroy context on App destruction (or just leave it to OS)

  • Thanks 1
Link to comment
14 minutes ago, andrey-kozlov said:

Hello,

We don't destroy context during the lifetime of the application anymore. So you can just delete everything related and destroy context on App destruction (or just leave it to OS)

Thank you!

So I dont need to do the "Unigine::CustomApp::destroy();", Right?

But to do the "GLWarpper::glDestroyContext(mDisplay, mContext);" I need to know if the flag DESTROY is activated, but this flag dont exist anymore so I don't know how to check this status

Link to comment

Yeah, destroy is not needed anymore.

If you used some built-in plugin from 2.4.1 to create your custom app - could you please tell which one? That will help us to understand how to migrate your old code proprely.

Btw, if you plan to upgrade to 2.16 later I would recommend not to waste too much time in CustomApp refactoring (just make it so it would start), since with a new WindowManager and SystemProxy concepts in 2.16 you would need to fully rewrite this code. CustomApp class will be removed starting from 2.16 and onwards, context handling is moved to the engine side. You still can embed engine into the external apps, such as Qt or WPF, but in a bit different way.

This is necessary evil, since new graphics API (DX12 / Vulkan) limitations doesn't allow us to keep the previous CustomApp approach up and running anymore.

Thanks!

  • Thanks 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

I don't think we are using any plugin. I don't know if QT have something native to built the application.

The migration to the 2.15.1 is a necessary evil, as you said, i we want to do anything in a newer version, because our code is based in a very old platform.

I want to learn what is needed to change to the last stable version and if we need/want to move to the 2.16, the amount of change to our code will be dramatically lower compared if we move from the 2.15 than from the 2.4

Link to comment

I'm afraid without seeing your full CustomApp implementation it would be hard to suggest anything rather than don't use destroy methods.

You can send me PM with your CustomApp example and I think we can figure out what to do next.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...