If you are working with shaders (it seems so), then have a mismatch between the OpenGL version you ask for (3.2) and the one you require in your shaders (3.3).
I hope you don't use the old gl-commads (glBegin, glMatrixMode, etc) that the cube sample uses. They won't work on Core Profile.
Notice that the cube sample works with old OGL (<=2.1), where no Core Profile context is set. You can not just take the cube sample, change the context version to a Core Profile one and expect it to work.
Some (most of after 2007) Apple machines support OGL 3.3, even 4.1. See
https://support.apple.com/en-euro/HT202823
Apple decided not to support OGL > 4.1 any more, they prefer their own "Metal" API.
While using the old array "list of attributes" is still supported by wxWidgets, starting with wx 3.1.0 the prefered way is with
wxGLAttributes and
wxGLContextAttrs. See docs at
http://docs.wxwidgets.org/trunk/classwx ... attrs.html and related. This is the way the
pyramid sample uses.
Apple creates one of three types of contexts: The old (OGL <= 2.1), the 3.2 Core and the 4.1 Core. This is controlled by an attribute.
Currently wxWidgets does not provide an attribute for 4.1 version. Perhaps just setting the
CoreProfile() attribute is enough for Apple to set the 4.1 version if the machine allows it.
But you can ask specifically for it:
Code: Select all
//Early in your code:
#ifdef __APPLE__
// Suppress warnings when including gl3.h
#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
#include <OpenGL/gl3.h> // For Core Profile
#endif
//Create an use window features by wxGLAttributes
wxGLAttributes wAtt;
wAtt.PlatformDefaults().Defaults().Stero().EndList(); //Stereo is rarely supported
... check the attributes are available
//Context 4.1 version
wxGLContextAttrs cxtAttrs;
#ifdef __APPLE__
//Add new attribute NSOpenGLProfileVersion4_1Core is defined in Apple's gl3.h
cxtAttrs.AddAttribute(WXOpenGLPFAOpenGLProfile);
cxtAttrs.AddAttribute(NSOpenGLProfileVersion4_1Core);
cxtAttrs.EndList(); // Don't forget this
#else
// Other platforms
cxtAttrs.PlatformDefaults().CoreProfile().OGLVersion(4, 1).EndList();
#endif
... check the context is OK
Some notes about your attributes:
* Some tutorials in the web say that
WX_GL_FORWARD_COMPAT is required in Apple. I don't think so, Apple does not define an attribute for it. In other words, it's useless for Apple.
* There are not many cards that support
WX_GL_STEREO