Hi. I'm trying to get an OpenGL 3.3 context using Pyglet. The pyglet code
only triggers on 3.2 and 4.1 version numbers.
Also, I have issue getting an nscontext. I sometimes get a None back. I can
get around the error if I don't ask for a shared context. I'm not sure this
is the right solution, as I don't really know what I'm doing. These are the
changes I made:
diff --git a/pyglet/gl/cocoa.py b/pyglet/gl/cocoa.py
--- a/pyglet/gl/cocoa.py
+++ b/pyglet/gl/cocoa.py
@@ -170,9 +170,9 @@
# check if we're wanting core or legacy
# Mavericks (Darwin 13) and up are capable of the Core 4.1
profile,
# while Lion and up are only capable of Core 3.2
- if version == (4, 1) and _os_x_version >=
os_x_release['mavericks']:
+ if version[0] == 4 and version[1] >= 1 and _os_x_version >=
os_x_release['mavericks']:
attrs.append(int(NSOpenGLProfileVersion4_1Core))
- elif version == (3, 2):
+ elif version[0] == 3 and version[1] >= 2:
attrs.append(int(NSOpenGLProfileVersion3_2Core))
else:
attrs.append(int(NSOpenGLProfileVersionLegacy))
@@ -239,6 +239,12 @@
self._pixel_format,
share_context)
+ if nscontext is None:
+ print("Unable to create nscontext.")
+ nscontext =
NSOpenGLContext.alloc().initWithFormat_shareContext_(
+ self._pixel_format,
+ None)
+
return CocoaContext(self, nscontext, share)
def compatible(self, canvas):
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.