Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplementation of PaintToOpenGL #62

Open
dsn27 opened this issue Jan 6, 2022 · 0 comments
Open

Reimplementation of PaintToOpenGL #62

dsn27 opened this issue Jan 6, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@dsn27
Copy link
Collaborator

dsn27 commented Jan 6, 2022

If habe been working on a reimplementation of PaintToOpenGL is the last couple of weeks.
The first result can be seen in this Branch

Advantages

  1. Each instance has it's own OpenGL instance
  2. Each instance is Disposable on it's own
  3. Handle recreation is now possible
  4. Finalizer-Free implementation

Details
1. Each instance has it's own OpenGL instance
Each instance of the CadControl now uses a seperate instance of OpenGL. No resources are shared between different instances.

2. Each instance is Disposable on it's own
Each instance of CadControl can now be disposed seperatly. That means alle OpenGL resources of this instance are released we the Control is disposed.

3. Handle recreation is now possible
It's now possible to use the CadControl even when the Handle needs to be recreated. This can happen in a few scenarios.
See this Stackoverflow page on how to force this.

4. Finalizer-Free implementation
The new implemenation does not contain any Finalizers. One of the disadvantages of Finazlizers is the fact that they are run in a different thread by the GC. This can cause all kind of problems with OpenGL. All cleanup is now done in the Dispose methods.

Most of the work for handling OpenGL resources is now done by the OpenGLResourceManager class.

Open issues:

  1. The HandleDestroyed and HandleCreated event are raised multiple times.
    It is unkown why this happens.

  2. The gDEBugger will report Memory Leaks after recreating the handle. But it's uncertain wether this warning is because of wglShareLists or this is a real problem.

  3. Reinit is not supported yet. If you use the Tabbed View from DevExpress the Control Handle will be destroyed and created without setting RecreatingHandle to true.

@dsn27 dsn27 added the enhancement New feature or request label Jan 6, 2022
@dsn27 dsn27 self-assigned this Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant