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
. See docs at http://docs.wxwidgets.org/trunk/classwx ... attrs.html
and related. This is the way the pyramid sample
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:
// Suppress warnings when including gl3.h
#include <OpenGL/gl3.h> // For Core Profile
//Create an use window features by wxGLAttributes
wAtt.PlatformDefaults().Defaults().Stero().EndList(); //Stereo is rarely supported
... check the attributes are available
//Context 4.1 version
//Add new attribute NSOpenGLProfileVersion4_1Core is defined in Apple's gl3.h
cxtAttrs.EndList(); // Don't forget this
// Other platforms
... 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