State of pyglet on OS X

69 views
Skip to first unread message

Richard Jones

unread,
Oct 20, 2010, 1:41:51 AM10/20/10
to pyglet-users
Hi all,

pyglet on OS X appears to be in a bit of a bad state at the moment.
The current development version is based on Carbon, which is a number
of years out of date, and broken to boot (e.g. on_mouse_drag doesn't
get buttons). There's an initial implementation of a Cocoa version
thanks to Tristam and a couple of people indicated they would work on
it. Has there been any progress?


Richard

Steve

unread,
Oct 20, 2010, 10:42:10 AM10/20/10
to pyglet-users
I asked a similar question a few weeks ago (http://groups.google.com/
group/pyglet-users/browse_thread/thread/0c7e31a92a27066a). The upshot
seems to be that the basics work, but a *lot* of polish and feature
implementation remains.

I think I am in a very good position to work on the Cocoa port right
now, except for two things:
- I am a student and have a lot to do
- It is difficult for me as someone who was not previously a pyglet
contributor to know how to approach the code base and start fixing
things

I would really appreciate some temporary hand-holding to get me
started. My preferred methods of communication are Gtalk (this same
address) and phone. I will have more time in December during my winter
break, but I can probably start fixing things before then.

I have a very strong interest in seeing pyglet progress to the Cocoa
API. I like writing games, Python is my favorite language, and pyglet
is my favorite framework. I now have the knowledge and skills to make
this port happen if I can just spend enough time in front of the code.

In summary, I need accountability and someone to help me learn the
code base.

Bruce Smith

unread,
Oct 20, 2010, 1:58:16 PM10/20/10
to pyglet...@googlegroups.com
On Tue, Oct 19, 2010 at 10:41 PM, Richard Jones <r1char...@gmail.com> wrote:
Hi all,

pyglet on OS X appears to be in a bit of a bad state at the moment.
The current development version is based on Carbon, which is a number
of years out of date, and broken to boot (e.g. on_mouse_drag doesn't
get buttons). ...

About that bug specifically (on_mouse_drag doesn't get buttons) -- I think this showed up for me when I switched to Snow Leopard. I use pyglet 1.2dev, and a microsoft USB mouse. Is it known to be impossible to support this in Carbon now, or is it just a bug like any other which might be fixable within Carbon?

(FYI, there is an unrelated bug (unreported AFAIK) in processing unicode characters typed using the option key, in 1.2dev only, but I have a fix for that which I haven't committed yet.)

- Bruce

Patrick Devine

unread,
Oct 20, 2010, 6:01:15 PM10/20/10
to pyglet...@googlegroups.com
I nominate Richard or Alex. ;-D

--Patrick.

> --
> You received this message because you are subscribed to the Google Groups "pyglet-users" group.
> To post to this group, send email to pyglet...@googlegroups.com.
> To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
>
>

Richard Jones

unread,
Oct 20, 2010, 7:00:39 PM10/20/10
to pyglet...@googlegroups.com
On Thu, Oct 21, 2010 at 4:58 AM, Bruce Smith <ore...@gmail.com> wrote:
> On Tue, Oct 19, 2010 at 10:41 PM, Richard Jones <r1char...@gmail.com>
> wrote:
>> pyglet on OS X appears to be in a bit of a bad state at the moment.
>> The current development version is based on Carbon, which is a number
>> of years out of date, and broken to boot (e.g. on_mouse_drag doesn't
>> get buttons). ...
>
> About that bug specifically (on_mouse_drag doesn't get buttons) -- I think
> this showed up for me when I switched to Snow Leopard. I use pyglet 1.2dev,
> and a microsoft USB mouse. Is it known to be impossible to support this in
> Carbon now, or is it just a bug like any other which might be fixable within
> Carbon?

The big problem is that as far as Apple's concerned Carbon doesn't
exist on Snow Leopard - I can't even get to the documentation any
more. It must be replaced.

I have zero experience with Cocoa ... but then I guess I had zero
experience with Carbon at one point too. I just loathe Objective-C :-)


Richard

Steve

unread,
Oct 20, 2010, 7:08:41 PM10/20/10
to pyglet-users
> I nominate Richard or Alex.  ;-D
>
> --Patrick.

This response bugs me. Alex has more or less abdicated as pyglet-
master and Richard would have helped already if he could. Please don't
"nominate" people.

Patrick Devine

unread,
Oct 20, 2010, 7:49:54 PM10/20/10
to pyglet...@googlegroups.com
Steve,

It was meant to be in jest. I don't know the code base well enough
otherwise I'd offer to help myself. I too would really like to see
the OSX side of things fixed up.

--Patrick.

Casey Duncan

unread,
Oct 20, 2010, 8:02:35 PM10/20/10
to pyglet...@googlegroups.com

I'd love to step up and take this on, but realistically I won't have
any time until about Feb. I'm no expert on Cocoa, but I don't loathe
objective-C. pyObjC I'm not so sure about though ;^) I'm assuming it'd
need to depend on that, correct?

I'm thinking this is not a huge job, but getting it properly tested
may be challenging.

-Casey

Tristam MacDonald

unread,
Oct 20, 2010, 8:38:40 PM10/20/10
to pyglet...@googlegroups.com
On Wed, Oct 20, 2010 at 8:02 PM, Casey Duncan <casey....@gmail.com> wrote:
pyObjC I'm not so sure about though ;^) I'm assuming it'd
need to depend on that, correct?

Yes, it is the only (feasible) way to access Cocoa APIs directly from within Python. Luckily, apart from some quirks here and there, pyObjC is pretty straightforward.
 
I'm thinking this is not a huge job, but getting it properly tested
may be challenging.

It isn't that hard, and there seem to be plenty of willing testers. I would finish the job, but I don't have access to a Mac these days, and sadly don't have the grand to shell out for a new one ;)

--
Tristam MacDonald
http://swiftcoder.wordpress.com/

Richard Jones

unread,
Oct 21, 2010, 12:51:20 AM10/21/10
to pyglet...@googlegroups.com
On Thu, Oct 21, 2010 at 4:58 AM, Bruce Smith <ore...@gmail.com> wrote:
> On Tue, Oct 19, 2010 at 10:41 PM, Richard Jones <r1char...@gmail.com>
>> pyglet on OS X appears to be in a bit of a bad state at the moment.
>> The current development version is based on Carbon, which is a number
>> of years out of date, and broken to boot (e.g. on_mouse_drag doesn't
>> get buttons). ...
>
> About that bug specifically (on_mouse_drag doesn't get buttons) -- I think
> this showed up for me when I switched to Snow Leopard.

It's not just drag - it's any mouse event involving buttons with any
device (including trackpad). Attempting to get the
kEventParamMouseChord results in nothing being returned.

I think it's dead Jim.


Richard

Richard Jones

unread,
Oct 21, 2010, 1:23:38 AM10/21/10
to pyglet...@googlegroups.com
A little more...

I'm kinda new to Mercurial and just noticed that Richard Thomas has a
branch in the repository called "cocoa-port" which has a bunch of work
in it. It doesn't work, but could be a good place to start - Tristam's
code appears to be based on the pre-1.2 structure.


Richard

Tristam MacDonald

unread,
Oct 21, 2010, 8:56:46 AM10/21/10
to pyglet...@googlegroups.com
I am pretty sure I posted this back when the problem first surfaced, but anyway, for some reason you need to use GetCurrentEventButtonState() instead.

Richard Jones

unread,
Nov 4, 2010, 7:11:12 PM11/4/10
to pyglet...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages