Prevent a null pointer dereference if updatePosition is called
before the enemy gets a chance to think, such as when loading
a game involving a flying bat with unlucky timing.
Fixes#362.
The macOS platform currently creates and uses an OpenGL 2.1 profile,
but it can still achieve high graphics detail in theory. In practice,
that ability regressed.
Prior to PR #355, extSupport made use of an undeclared glGetStringi,
a build error. That was fixed by importing a header that declared it.
That caused extSupport to start reporting false for any input. This
is due to the (glGetStringi != NULL) check not having the intended
effect on macOS, as reported in #357.
As long as OpenGL 2.1 profile is used, extSupport can't make use
of the glGetStringi + GL_NUM_EXTENSIONS code path, so explicitly
disable it on macOS for now via a preprocessor guard.
Another regression introduced by #355 is the removal of redefines
of glGenVertexArrays, glDeleteVertexArrays, glBindVertexArray with
Apple-specific versions, needed to get VAO alongside OpenGL 2.1.
So, bring this back, along with the comment justifying why they're
needed (as was done before 6e6ed3b2d0e8c0c9af83d5cb9653793ca76047f4).
Import OpenGL/glext.h to get definitions of those APPLE functions.
With these changes, high graphics detail settings are available on
macOS once again.
Fixes#356.
Updates #357.
fix build on macOS 11 and 10.15, including on Apple silicon
There was a build error on macOS due to use of undeclared identifiers
glGetStringi and GL_NUM_EXTENSIONS. Those identifiers are declared in
OpenGL 3.0.
Switch from importing OpenGL/{gl.h,glext.h} to OpenGL/{gl3.h,gl3ext.h},
which fixes the problem. It also allows removing many OpenGL 3+ #defines,
though we do need to #define GL_LUMINANCE as was done in OpenGL/gl.h.
(It's also possible to keep the OpenGL/gl.h import, but it seems worse
to be importing both.)
Also remove #includes of Carbon/Carbon.h, OpenGL/OpenGL.h, AGL/agl.h,
since they don't seem to be needed.
Tested on macOS 11.4 (Big Sur) with Xcode 12.5.1 on Apple silicon,
and on macOS 10.15.7 (Catalina) with Xcode 12.4 on an Intel-based Mac.
(Hopefully this doesn't break older macOS platforms,
but unfortunately I can't test that easily.)
Fixes#354.