← Back to team overview

kicad-developers team mailing list archive

Re: mode openGL issues after latest updates

 

Hi Orson,

I understand, but my question was, since that check is inside the "BeginUpdate" I am supposing that you will do in any case every time that redraw update: i.e in this case you will call GL functions and in the worst case when the windows is not displayed and you have no context.

For comparison (what I mean is) on 3d-viewer on the function redraw:
https://github.com/KiCad/kicad-source-mirror/blob/master/3d-viewer/3d_draw.cpp#L294

void EDA_3D_CANVAS::Redraw()
{
    // SwapBuffer requires the window to be shown before calling
    if( !IsShownOnScreen() )
        return;

it will return immediately and will not continue to call any oGL functions.

Looking on overall on your source code you have different points of return related with IsShownOnScreen
So is this condition guarantee on this case?

Mario
________________________________________
From: Maciej Sumiński [maciej.suminski@xxxxxxx]
Sent: 04 May 2016 08:57
To: Mário Luzeiro; kicad-developers@xxxxxxxxxxxxxxxxxxx
Subject: Re: mode openGL issues after latest updates

Hi Mario,

wxWidgets will trigger an assert in Linux if you try to set OpenGL
context when the parent window is not yet visible. It may happen only
when a window is created upon pcbnew launch, but anyway it is enough to
require such condition there. It is also necessary to set the right
context if there are multiple contexts available, that is why I have
added the two lines you asked about.

Earlier, OpenGL context is bound by the OpenGL test window (that detects
capabilities), hence all subsequent OGL calls are called using the right
context.

Regards,
Orson

On 05/03/2016 05:48 PM, Mário Luzeiro wrote:
> Hi Orson,
>
> I tested your new change, still working but I was wondering:
>
> void OPENGL_GAL::BeginUpdate()
> {
>     if( IsShownOnScreen() )
>         SetCurrent( *OPENGL_GAL::glContext );
>
> On this case shouldn't you not allow the begin of the update at all? (As you will not be able to render it)... but I dont know exactly how it is supposed to work.
>
> Regards,
> Mario
>
> ________________________________________
> From: Kicad-developers [kicad-developers-bounces+mrluzeiro=ua.pt@xxxxxxxxxxxxxxxxxxx] on behalf of Mário Luzeiro [mrluzeiro@xxxxx]
> Sent: 03 May 2016 15:27
> To: Maciej Sumiński; kicad-developers@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [Kicad-developers] mode openGL issues after latest updates
>
> I tested (on Windows) and it works!
> I didn't feel any issues.
> Thanks,
> Mario
> ________________________________________
> From: Maciej Sumiński [maciej.suminski@xxxxxxx]
> Sent: 03 May 2016 15:20
> To: Mário Luzeiro; kicad-developers@xxxxxxxxxxxxxxxxxxx
> Subject: Re: mode openGL issues after latest updates
>
> On 05/03/2016 12:06 PM, Mário Luzeiro wrote:
>> Hi Orson,
>> I tested the new updates on my branch code, and now on Windows I got this issues after I close the 3d-viewer windows:
>>
>> Error: mapping vertices buffer: invalid operation
>> Error: unmapping vertices buffer: invalid operation
>> Error: unbinding vertices buffer:  invalid operation
>>
>> My guess is that it may be related with oGL context? :S
>>
>> https://code.launchpad.net/~mrluzeiro/kicad/kicad_new3d-viewer
>>
>> On Linux it works fine.
>>
>> Any ideas?
>> Regards,
>> Mario Luzeiro
>
> Hi Mario,
>
> Thank you for the report. You are right, it was due to invalid OpenGL
> context. I was able to recreate the problem on Linux and it should be
> fixed now (revision 6769).
>
> Regards,
> Orson
>




Follow ups

References