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
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;
wxGLAttributes m_GLAttrs;

View File

@ -501,9 +501,14 @@ bool wxGLCanvas::Create(wxWindow *parent,
// Make a copy of attributes. Will use at wxGLContext ctor
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) )
return false;
#endif
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
NSOpenGLPixelFormatAttribute data[512];
@ -349,7 +352,7 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *attribList)
return [[NSOpenGLPixelFormat alloc] initWithAttributes:(NSOpenGLPixelFormatAttribute*) attribs];
#endif
return NULL;
return @"dummy";
}
bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
@ -364,14 +367,12 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
#define USE_SEPARATE_VIEW 1
bool wxGLCanvas::Create(wxWindow *parent,
bool wxGLCanvas::DoCreate(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name,
const int *attribList,
const wxPalette& WXUNUSED(palette))
const wxString& name)
{
/*
m_glFormat = WXGLChoosePixelFormat(attribList);