diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 1da1bd1788..fa4316611c 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -52,11 +52,10 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener, nonCachedManager( false ), overlayManager( false ) { - // Create the OpenGL-Context - glContext = new wxGLContext( this ); parentWindow = aParent; mouseListener = aMouseListener; paintListener = aPaintListener; + glContext = NULL; // Initialize the flags isGlewInitialized = false; @@ -113,6 +112,9 @@ OPENGL_GAL::~OPENGL_GAL() void OPENGL_GAL::BeginDrawing() { + if( !glContext ) + glContext = new wxGLContext( this ); + SetCurrent( *glContext ); clientDC = new wxClientDC( this ); diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 72e1c575b8..4602111ee7 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -293,9 +293,6 @@ bool EDA_APP::OnInit() frame->SetFocus(); frame->GetCanvas()->SetFocus(); - // Activate the GAL - frame->UseGalCanvas( true ); - return true; }