← Back to team overview

kicad-developers team mailing list archive

Re: mode openGL issues after latest updates

 

Hi Orson,

I am back on testing this openGL issues.
I implemented your context manager in my branch.
It looks good the implementation (still need a bit style clean up your source code file, eg: gl_context_mgr.cpp line 86)

I didn't tried it properly on Windows yet.
I am debugging (on debug mode) it on Linux.

Running in debug mode, the only issue that remains is the one with the windows is not visible when the context is set.
For instance, now every time I run pcbnew in debug more, just open and close it will make an ASSERT while closing the GAL.
The windows is probably already gone at that time..

I also having some difficulties in the module editor.
I implemented on my branch a object->close(); feature so I can try early to destroy the context, hopefully while the windows is still visible.
I found for example if I close the windows (of module editor) by pressing X it will follow a path.. if I close is by "Cancel" it will follow other path.. 
So this get difficult to solve..

Anyway, some of this issues now are in the end to try to destroy the context because using your lock feature, it is trying to set the context always. (Before that was not true, or we implemented it different for Linux vs Windows)

I have one suggestion for your context manager.
In the lock, maybe we can try to set the context just if it changed.

>From our experience and from the wxwidget (opengl) samples, they delete the context without set it.
I also found this on some samples, on the OnPaint event:
    // This is normally only necessary if there is more than one wxGLCanvas
    // or more than one wxGLContext in the application.
    SetCurrent(*m_glRC);

So it may mean that the SetCurrent does not need to take place on all paint events.
Also, in the end, when destroy it, if it didn't change, there is no need to SetCurrent again and it will not ASSERT .. (if the context didn't change.. so I expect that it is still on a valid state and can be used..)

Hope you can have a thought about this.. cheers!

Regards,
Mario Luzeiro

Follow ups

References