wxWidgets/include/wx/qt/glcanvas.h
dsr 2cf57fda36 Avoid crashes when destroying wxGLCanvas
Block signals that are not safe to process any more.
2021-01-27 18:42:16 +01:00

88 lines
2.8 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: include/wx/qt/glcanvas.cpp
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include <GL/gl.h>
class QGLWidget;
class QGLContext;
class QGLFormat;
class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
{
public:
wxGLContext(wxGLCanvas *win,
const wxGLContext *other = NULL,
const wxGLContextAttrs *ctxAttrs = NULL);
/// virtual ~wxGLContext();
virtual bool SetCurrent(const wxGLCanvas& win) const wxOVERRIDE;
wxDECLARE_CLASS(wxGLContext);
};
// ----------------------------------------------------------------------------
// wxGLCanvas: OpenGL output window
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase
{
public:
explicit // avoid implicitly converting a wxWindow* to wxGLCanvas
wxGLCanvas(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
explicit
wxGLCanvas(wxWindow *parent,
wxWindowID id = wxID_ANY,
const int *attribList = NULL,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
~wxGLCanvas();
bool Create(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette);
virtual bool SwapBuffers() wxOVERRIDE;
static bool ConvertWXAttrsToQtGL(const int *wxattrs, QGLFormat &format);
private:
// wxDECLARE_EVENT_TABLE();
wxDECLARE_CLASS(wxGLCanvas);
};
#endif // _WX_GLCANVAS_H_