Fix missing gl functions in WXQT

This commit is contained in:
Maarten Bent
2018-09-26 19:57:42 +02:00
parent 487a3854a3
commit bb82470640
2 changed files with 66 additions and 2 deletions

View File

@@ -17,7 +17,9 @@ class QGLFormat;
class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
{
public:
wxGLContext(wxGLCanvas *win, const wxGLContext* other = NULL);
wxGLContext(wxGLCanvas *win,
const wxGLContext *other = NULL,
const wxGLContextAttrs *ctxAttrs = NULL);
/// virtual ~wxGLContext();
virtual bool SetCurrent(const wxGLCanvas& win) const wxOVERRIDE;
@@ -36,6 +38,16 @@ 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,
@@ -45,6 +57,15 @@ public:
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
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,

View File

@@ -329,7 +329,7 @@ void wxGLAttributes::AddDefaultsForWXBefore31()
wxIMPLEMENT_CLASS(wxGLContext, wxWindow);
wxGLContext::wxGLContext(wxGLCanvas *WXUNUSED(win), const wxGLContext* WXUNUSED(other))
wxGLContext::wxGLContext(wxGLCanvas *WXUNUSED(win), const wxGLContext* WXUNUSED(other), const wxGLContextAttrs *WXUNUSED(ctxAttrs))
{
// m_glContext = win->GetHandle()->context();
}
@@ -347,6 +347,18 @@ bool wxGLContext::SetCurrent(const wxGLCanvas&) const
wxIMPLEMENT_CLASS(wxGLCanvas, wxWindow);
wxGLCanvas::wxGLCanvas(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name,
const wxPalette& palette)
{
Create(parent, dispAttrs, id, pos, size, style, name, palette);
}
wxGLCanvas::wxGLCanvas(wxWindow *parent,
wxWindowID id,
const int *attribList,
@@ -359,6 +371,19 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent,
Create(parent, id, pos, size, style, name, attribList, palette);
}
bool wxGLCanvas::Create(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name,
const wxPalette& palette)
{
wxLogError("Missing implementation of " + wxString(__FUNCTION__));
return false;
}
bool wxGLCanvas::Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
@@ -509,4 +534,22 @@ wxGLCanvasBase::IsDisplaySupported(const int *attribList)
return QGLWidget(format).isValid();
}
/* static */
bool
wxGLCanvasBase::IsDisplaySupported(const wxGLAttributes& dispAttrs)
{
wxLogError("Missing implementation of " + wxString(__FUNCTION__));
return false;
}
// ----------------------------------------------------------------------------
// wxGLApp
// ----------------------------------------------------------------------------
bool wxGLApp::InitGLVisual(const int *attribList)
{
wxLogError("Missing implementation of " + wxString(__FUNCTION__));
return false;
}
#endif // wxUSE_GLCANVAS