Fixing Creation of wxGLCanvas on iOS

This commit is contained in:
Stefan Csomor
2017-09-25 17:42:11 +02:00
parent 9e88518eb2
commit 3063ea6ca9
3 changed files with 22 additions and 7 deletions

View File

@@ -158,6 +158,15 @@ public:
// implementation-only from now on // implementation-only from now on
protected: protected:
#if wxOSX_USE_IPHONE
bool DoCreate(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name);
#endif
WXGLPixelFormat m_glFormat; WXGLPixelFormat m_glFormat;
wxGLAttributes m_GLAttrs; wxGLAttributes m_GLAttrs;

View File

@@ -501,9 +501,14 @@ bool wxGLCanvas::Create(wxWindow *parent,
// Make a copy of attributes. Will use at wxGLContext ctor // Make a copy of attributes. Will use at wxGLContext ctor
m_GLAttrs = dispAttrs; m_GLAttrs = dispAttrs;
#if wxOSX_USE_IPHONE
if ( !wxGLCanvas::DoCreate(parent,id,pos,size,style,name) )
return false;
#else
if ( !wxWindow::Create(parent, id, pos, size, style, name) ) if ( !wxWindow::Create(parent, id, pos, size, style, name) )
return false; return false;
#endif
return true; return true;
} }

View File

@@ -205,7 +205,10 @@ void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat )
} }
WXGLPixelFormat WXGLChoosePixelFormat(const int *attribList) WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs,
int n1,
const int *ctxAttrs,
int n2)
{ {
#if 0 #if 0
NSOpenGLPixelFormatAttribute data[512]; NSOpenGLPixelFormatAttribute data[512];
@@ -349,7 +352,7 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *attribList)
return [[NSOpenGLPixelFormat alloc] initWithAttributes:(NSOpenGLPixelFormatAttribute*) attribs]; return [[NSOpenGLPixelFormat alloc] initWithAttributes:(NSOpenGLPixelFormatAttribute*) attribs];
#endif #endif
return NULL; return @"dummy";
} }
bool wxGLContext::SetCurrent(const wxGLCanvas& win) const bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
@@ -364,14 +367,12 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
#define USE_SEPARATE_VIEW 1 #define USE_SEPARATE_VIEW 1
bool wxGLCanvas::Create(wxWindow *parent, bool wxGLCanvas::DoCreate(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
long style, long style,
const wxString& name, const wxString& name)
const int *attribList,
const wxPalette& WXUNUSED(palette))
{ {
/* /*
m_glFormat = WXGLChoosePixelFormat(attribList); m_glFormat = WXGLChoosePixelFormat(attribList);