Thread: [Pyobjc-dev] Fwd: PyObjC and NSOpenGLView
Brought to you by:
ronaldoussoren
From: Tobias W. <t.w...@im...> - 2010-01-04 23:47:04
|
Sorry for the forwarded message below, have just realised I responded to Ronald only and failed to cc the list. Has anyone else successfully run the OpenGL example on Snow Leopard? Toby Begin forwarded message: > From: Tobias Wood <tw...@im...> > Date: 3 January 2010 20:00:48 GMT > To: Ronald Oussoren <ron...@ma...> > Subject: Re: [Pyobjc-dev] PyObjC and NSOpenGLView > > Thanks for the prompt reply. > > On 3 Jan 2010, at 17:26, Ronald Oussoren wrote: >> >> I don't use NSOpenGLView myself, maybe someone else knows the answer. Does the OpenGL example work for you? <http://pyobjc.sourceforge.net/examples/pyobjc-framework-Cocoa/OpenGL/OpenGLDemo/index.html> >> > > Unfortunately not. After doing "python setup.py py2app -A" from within the demo directory, running the resulting app in /dist fails with: > > 03/01/2010 19:51:40 [0x0-0x53053].org.pythonmac.unspecified.OpenGLDemo[539] File "/Users/Tobias/Downloads/PyObjCExample-OpenGLDemo/dist/OpenGLDemo.app/Contents/Resources/__boot__.py", line 46, in _run > 03/01/2010 19:51:40 [0x0-0x53053].org.pythonmac.unspecified.OpenGLDemo[539] target, wasChanged = alias.ResolveAlias(None) > 03/01/2010 19:51:40 [0x0-0x53053].org.pythonmac.unspecified.OpenGLDemo[539] AttributeError: 'Carbon.File.Alias' object has no attribute 'ResolveAlias' > 03/01/2010 19:51:41 OpenGLDemo[539] OpenGLDemo Error > 03/01/2010 19:51:41 OpenGLDemo[539] OpenGLDemo Error > An unexpected error has occurred during execution of the main script > > AttributeError: 'Carbon.File.Alias' object has no attribute 'ResolveAlias' > 03/01/2010 19:51:47 com.apple.launchd.peruser.501[89] ([0x0-0x53053].org.pythonmac.unspecified.OpenGLDemo[539]) Exited with exit code: 255 > > Apologies, I should have mentioned that I'm running Snow Leopard (Which I think will be why Carbon fails) using the system Python (2.6). > > Toby |
From: Ronald O. <ron...@ma...> - 2010-01-05 10:44:05
Attachments:
smime.p7s
|
On 5 Jan, 2010, at 0:46, Tobias Wood wrote: > Sorry for the forwarded message below, have just realised I responded to Ronald only and failed to cc the list. Has anyone else successfully run the OpenGL example on Snow Leopard? Sorry about not replying sooner. "py2app -A" doesn't work at the moment on SL, IIRC someone has sent me a fix for that. You should be able to run the example using 'python setup.py py2app' without the -A. Ronald, who's too lazy to run the example himself ;-) > > Toby > > Begin forwarded message: > >> From: Tobias Wood <tw...@im...> >> Date: 3 January 2010 20:00:48 GMT >> To: Ronald Oussoren <ron...@ma...> >> Subject: Re: [Pyobjc-dev] PyObjC and NSOpenGLView >> >> Thanks for the prompt reply. >> >> On 3 Jan 2010, at 17:26, Ronald Oussoren wrote: >>> >>> I don't use NSOpenGLView myself, maybe someone else knows the answer. Does the OpenGL example work for you? <http://pyobjc.sourceforge.net/examples/pyobjc-framework-Cocoa/OpenGL/OpenGLDemo/index.html> >>> >> >> Unfortunately not. After doing "python setup.py py2app -A" from within the demo directory, running the resulting app in /dist fails with: >> >> 03/01/2010 19:51:40 [0x0-0x53053].org.pythonmac.unspecified.OpenGLDemo[539] File "/Users/Tobias/Downloads/PyObjCExample-OpenGLDemo/dist/OpenGLDemo.app/Contents/Resources/__boot__.py", line 46, in _run >> 03/01/2010 19:51:40 [0x0-0x53053].org.pythonmac.unspecified.OpenGLDemo[539] target, wasChanged = alias.ResolveAlias(None) >> 03/01/2010 19:51:40 [0x0-0x53053].org.pythonmac.unspecified.OpenGLDemo[539] AttributeError: 'Carbon.File.Alias' object has no attribute 'ResolveAlias' >> 03/01/2010 19:51:41 OpenGLDemo[539] OpenGLDemo Error >> 03/01/2010 19:51:41 OpenGLDemo[539] OpenGLDemo Error >> An unexpected error has occurred during execution of the main script >> >> AttributeError: 'Carbon.File.Alias' object has no attribute 'ResolveAlias' >> 03/01/2010 19:51:47 com.apple.launchd.peruser.501[89] ([0x0-0x53053].org.pythonmac.unspecified.OpenGLDemo[539]) Exited with exit code: 255 >> >> Apologies, I should have mentioned that I'm running Snow Leopard (Which I think will be why Carbon fails) using the system Python (2.6). >> >> Toby > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Tobias W. <t.w...@im...> - 2010-01-05 12:00:59
Attachments:
OpenGLDemo.py
|
On 5 Jan 2010, at 10:43, Ronald Oussoren wrote: > > Sorry about not replying sooner. "py2app -A" doesn't work at the moment on SL, IIRC someone has sent me a fix for that. > > You should be able to run the example using 'python setup.py py2app' without the -A. > > Ronald, who's too lazy to run the example himself ;-) Thanks Ronald, I seem to have things working now. I ran py2app without -A, and then had to correct a couple of other problems with the OpenGL demo - 1) py2app was not copying ctypes.utils into Resources/ properly, this is used somewhere deep in PyOpenGL. Fixed by importing in OpenGLDemo.py so py2app picks it up (Ugly but works) 2) The call to glViewport needs a cast to int for the width and height of the view rect, which are passed in as floats. I've attached my modified OpenGLDemo.py below. I then used this as the basis for my WorldView class, and it seems to be working including the call to gluPerspective. I'll let you know if I have any more trouble. Thanks for the help, it is much appreciated. Toby |
From: James R E. <Jam...@lr...> - 2010-03-10 13:50:20
|
Le 5 janv. 2010 à 11:43, Ronald Oussoren a écrit : > "py2app -A" doesn't work at the moment on SL, IIRC someone has sent me a fix for that. > > You should be able to run the example using 'python setup.py py2app' without the -A. I know I've submitted other py2app-related patches before, but mine didn't fix a bug related to alias builds on 64-bit Snow Leopard systems (I'm still in 32-bit land, so I never noticed before). (You might have also been talking someone else, but Carly Simon did once write a song about me.) For some reason, Carbon.File.Alias on 64-bit only has the FS* functions, but not their aliases with the FS prefix removed. This is probably a bug in Python-mac rather than in py2app or pyobjc. But here's a workaround for it in py2app, made off of PyObjC trunk/py2app : |
From: Ronald O. <ron...@ma...> - 2010-03-10 20:22:55
Attachments:
smime.p7s
|
On 10 Mar, 2010, at 14:26, James R Eagan wrote: > > Le 5 janv. 2010 à 11:43, Ronald Oussoren a écrit : > >> "py2app -A" doesn't work at the moment on SL, IIRC someone has sent me a fix for that. >> >> You should be able to run the example using 'python setup.py py2app' without the -A. > > I know I've submitted other py2app-related patches before, but mine didn't fix a bug related to alias builds on 64-bit Snow Leopard systems (I'm still in 32-bit land, so I never noticed before). (You might have also been talking someone else, but Carly Simon did once write a song about me.) > > For some reason, Carbon.File.Alias on 64-bit only has the FS* functions, but not their aliases with the FS prefix removed. This is probably a bug in Python-mac rather than in py2app or pyobjc. But here's a workaround for it in py2app, made off of PyObjC trunk/py2app : Good catch. I've applied your patch to the repository (r89). someAlias.ResolveAlias and someAlias.FSResolveAlias map onto C functions with the same name, and the ones without 'FS' prefix aren't available in 64-bit code (not just in Python, but in C as well). Have I mentioned yet that the 'Carbon' wrappers in the stdlib suck? <0.5 wink> Ronald |