| 1 |
Description: wxWidgets 3.2 compatibility |
| 2 |
Bug-Debian: https://bugs.debian.org/1019819 |
| 3 |
Forwarded: no |
| 4 |
Author: Scott Talbert <[email protected]> |
| 5 |
Last-Update: 2022-10-23 |
| 6 |
|
| 7 |
--- a/src/main.cpp |
| 8 |
+++ b/src/main.cpp |
| 9 |
@@ -625,14 +625,16 @@ END_EVENT_TABLE() |
| 10 |
|
| 11 |
TestGLCanvas::TestGLCanvas(wxWindow *_parent, wxWindowID id, |
| 12 |
const wxPoint& pos, const wxSize& size, long style, const wxString& name) |
| 13 |
|
| 14 |
+ : wxGLCanvas(_parent, id, NULL, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name) |
| 15 |
{ |
| 16 |
initdone=false; |
| 17 |
shownHQ=false; |
| 18 |
+ m_glRC = new wxGLContext(this); |
| 19 |
} |
| 20 |
|
| 21 |
TestGLCanvas::~TestGLCanvas() |
| 22 |
{ |
| 23 |
+ delete m_glRC; |
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
@@ -660,11 +662,7 @@ void TestGLCanvas::OnPaint( wxPaintEvent |
| 28 |
/* must always be here */ |
| 29 |
wxPaintDC dc(this); |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
+ SetCurrent(*m_glRC); |
| 37 |
|
| 38 |
if (!initdone) { |
| 39 |
static bool once=false; |
| 40 |
@@ -702,18 +700,12 @@ void TestGLCanvas::OnPaint( wxPaintEvent |
| 41 |
void TestGLCanvas::OnSize(wxSizeEvent& event) |
| 42 |
{ |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
// set GL viewport (not called by wxGLCanvas::OnSize on all platforms...) |
| 48 |
|
| 49 |
GetClientSize(&winx, &winy); |
| 50 |
mainCanvas.SetVideoSize(winx); |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
{ |
| 55 |
|
| 56 |
+ SetCurrent(*m_glRC); |
| 57 |
glViewport(0, 0, (GLint) winx, (GLint) winy); |
| 58 |
} |
| 59 |
} |
| 60 |
--- a/src/main.h |
| 61 |
+++ b/src/main.h |
| 62 |
@@ -141,6 +141,7 @@ public: |
| 63 |
|
| 64 |
private: |
| 65 |
//wxWindow *parent; |
| 66 |
+ wxGLContext *m_glRC; |
| 67 |
DECLARE_EVENT_TABLE() |
| 68 |
}; |
| 69 |
|