Improve wxQt OpenGL canvas implementation:
- Support wxGLContext::SetCurrent. - Pass GL canvas attributes via ParseAttribList to handle defaults. - Remove OpenGL not implemented message. - Prevent QGLWidget from changing OpenGL state before we paint. - Set Qt::StrongFocus for wxQtGLWidget to allow keyboard input. - Use QtCanPaintWithoutActivePainter to fix wxPaintDCImpl assert when using wxGLCanvas.
This commit is contained in:
parent
57349c2aaa
commit
966b6e9460
5 changed files with 184 additions and 69 deletions
|
|
@ -24,6 +24,9 @@ public:
|
|||
|
||||
virtual bool SetCurrent(const wxGLCanvas& win) const override;
|
||||
|
||||
private:
|
||||
QGLContext* m_glContext = nullptr;
|
||||
|
||||
wxDECLARE_CLASS(wxGLContext);
|
||||
};
|
||||
|
||||
|
|
@ -78,7 +81,9 @@ public:
|
|||
|
||||
virtual bool SwapBuffers() override;
|
||||
|
||||
static bool ConvertWXAttrsToQtGL(const int *wxattrs, QGLFormat &format);
|
||||
virtual bool QtCanPaintWithoutActivePainter() const override;
|
||||
|
||||
static bool ConvertWXAttrsToQtGL(const wxGLAttributes &glattrs, const wxGLContextAttrs ctxAttrs, QGLFormat &format);
|
||||
|
||||
private:
|
||||
wxDECLARE_CLASS(wxGLCanvas);
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ public:
|
|||
void QtSetPicture( QPicture* pict );
|
||||
|
||||
QPainter *QtGetPainter();
|
||||
virtual bool QtCanPaintWithoutActivePainter() const;
|
||||
|
||||
virtual bool QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event );
|
||||
virtual bool QtHandleResizeEvent ( QWidget *handler, QResizeEvent *event );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue