Jose Luis Da | 17 Nov 16:06 2014

Animation slower in OSX than in Windows

Hi all, 

I wrote a code that displays an animation of a plaid, this plaid is drawn with OpenGL.

I have developed it under a Windows, but I also want to execute it under OSX. The code runs correctly, but the animation, i.e. strips of the plaid moving, is significantly slower.

Has anyone of you experienced something similar? What may be the cause of it?

I have attached the code and the files it uses for you to see.

Thank you,
jl

--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Attachment (Archive.zip): application/zip, 15 KiB
Frederick Buchanan | 16 Nov 01:15 2014
Picon

libGL error: failed to load driver: swrast

I just installed pyglet and tried to run the hello world program as outlined in the tutorial. I ran it and got this error:

libGL error: failed to load driver: swrast
libGL error
: Try again with LIBGL_DEBUG=verbose for more details.


Then I put LIBGL_DEBUG=verbose on and got:
libGL: screen 0 does not appear to be DRI2 capable
libGL
: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL
: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL
: Can't open configuration file /home/fred-buchanan/.drirc: No such file or directory.
libGL error: failed to load driver: swrast


I don't know what is happing. I'm running ubuntu 13.10. I'm using a GeForce GTX 650 TI BOOST, if that is of any help, with the propitiatory drivers.
Any help would be much appreciated.
Thanks!

--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Steve Ksh | 5 Nov 08:35 2014
Picon

Pyglet on Github + Pyglet website

Hi,
I do think that the pyglet project would really benefit from switching to Github. (much less obscure than googlecode).
A new website could also help very much with popularity, bug reports and maintenance.
The project seems not updated since 2012 on the official site, is not available on PyPI.
I would like to contribute by making a more modern website, but I don't know who is in charge, maybe someone can tell me ?
About Github, what do you think ?

--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
spu.fprob | 3 Nov 10:45 2014
Picon

AVbin is required to decode compressed media

I have installed pyglet version 1.2alpha1 and AVbin 10 for Win 64 (I am on Windows 8.1)
Trying the simple code as:

import pyglet
sound = pyglet.media.load('english.mp3', streaming=False)
sound.play()
pyglet.app.run()

I am having following error: pyglet.media.riff.WAVEFormatException: AVbin is required to decode compressed media.


I'd highly appreciate any advises, need to make it work asap.

--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
'paeron' via pyglet-users | 30 Oct 15:18 2014

batch.add() problem, hexagons

Hey everyone!

Hoping to get some help with my problem here.

Im drawing a hexagonal-grid with batches.

I've got an Hexagon class with init as following. Im passing along a batch because I taught it would be nice to add all my hexagons to a single batch.

class Hexagon(object):

    def __init__(self, x, y, size, batch, color):
        ...

After all the math I have a tuple with the vertices and adds it to the batch

self.batch.add(
            6,
            GL_LINE_LOOP,
            None,
            ('v2f', vertices_tuple),
            ('c3f', color * 6)
        )

When this gets drawn to the screen I get this:




















If I create a new batch for each hexagon and fill it with the exact same values and later loop over all the hexagons and draw their batches. 
I get the following:


















I hope Ive described the problem well enough and looking forward to any help!
/ BR Tommy

--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Haluk | 22 Oct 18:02 2014
Picon

Cocoa OSX woes (py3k, pyglet 1.2.1a latest build, 64bit)

Hi,

I've had this problem with several versions of OSX past 10.8 now, I hadn't used pyglet for about a year but when I came back to it I'm still encountering this issue. On OSX 10.9 or 10.10, when I do pyglet.gl.import *, I get a ctypes TypeError, as seen here:

Traceback (most recent call last):
  File "mainloc.py", line 3, in <module>
    from pyglet.gl import *
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/gl/__init__.py", line 221, in <module>
    from .cocoa import CocoaConfig as Config
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/gl/cocoa.py", line 15, in <module>
    from pyglet.canvas.cocoa import CocoaCanvas
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/canvas/__init__.py", line 90, in <module>
    from pyglet.canvas.cocoa import CocoaDisplay as Display
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/canvas/cocoa.py", line 15, in <module>
    from pyglet.libs.darwin.cocoapy import *
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/libs/darwin/__init__.py", line 6, in <module>
    from .cocoapy import *
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/libs/darwin/cocoapy/__init__.py", line 32, in <module>
    from .runtime import objc, send_message, send_super
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1149, in <module>
    class DeallocationObserver_Implementation(object):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1150, in DeallocationObserver_Implementation
    DeallocationObserver = ObjCSubclass('NSObject', 'DeallocationObserver', register=False)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1050, in __init__
    self.objc_cls = create_subclass(superclass, name)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 603, in create_subclass
    superclass = get_class(superclass)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 402, in get_class
    return c_void_p(objc.objc_getClass(name))
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type

Is there any solution to this? The same code works on Windows but not OSX. I'm currently on 64 bit OSX 10.10, Python 3.4.2, pyglet 1.2.1a latest repository version.

Thanks

--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Shady El Damaty | 20 Oct 06:09 2014
Picon

Major Problems with Pyglet for PsychoPy

Hello,

I am trying to use pyglet with psychopy to create a psychology experiment but am running into all sorts of issues.

I used macports to install python2.6 and psychopy in /opt/local/bin/python2.6 on OS X 10.9

I'm running everything in pyCharm using the python interperter in /opt/local/bin.  

I've also installed pyglet 1.2alpha1 and updated XQuartz to the newest version.

If I try to run 

from pyglet.window import Window

I see that python tries to launch but nothing happens.

Typing 

from pyglet import app
app.run()

Just freezes up the terminal (the prompt disappears)

All I want is for this simple code to run:
from psychopy import core, visual
import pyglet

#Create a window
win = visual.Window([400,300])
#Create a stimulus for a certain window
message = visual.TextStim(win, text='Hello World!')
# Draw the stimulus to the window
message.draw()
# Flip backside of the window
win.flip()
#Pause 5s so you get a chance to see it
core.wait(5.0)

But I get this error message:
/opt/local/bin/python2.6 /Users/shadyeldamaty/PycharmProjects/ultimatgame/psypy1.py
/Users/shadyeldamaty/.local/lib/python2.6/site-packages/psychopy/visual/helpers.py:176: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if color==None:
Traceback (most recent call last):
  File "/Users/shadyeldamaty/PycharmProjects/ultimatgame/psypy1.py", line 14, in <module>
    win = visual.Window([400,300])
  File "/Users/shadyeldamaty/.local/lib/python2.6/site-packages/psychopy/visual/window.py", line 320, in __init__
    self._setupGL()
  File "/Users/shadyeldamaty/.local/lib/python2.6/site-packages/psychopy/visual/window.py", line 1338, in _setupGL
    self._setupPyglet()
  File "/Users/shadyeldamaty/.local/lib/python2.6/site-packages/psychopy/visual/window.py", line 1212, in _setupPyglet
    self._hw_handle=self.winHandle._window.value
AttributeError: 'CocoaWindow' object has no attribute '_window'
1.6892 WARNING Creating new monitor...
1.6894 WARNING Creating new monitor...

Process finished with exit code 1

I've tried running the above code in 32bit mode in Canopy with arch -386 python and this doesn't work either.

from pyglet import app

app.run()
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-14-810b1526bc66> in <module>()
----> 1 app.run()

/Users/shadyeldamaty/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pyglet/__init__.py in __getattr__(self, name)
    304 
    305             import_name = 'pyglet.%s' % self._module_name
--> 306             __import__(import_name)
    307             module = sys.modules[import_name]
    308             object.__setattr__(self, '_module', module)

/Users/shadyeldamaty/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pyglet/app/__init__.pyc in <module>()
    289 
    290     if sys.platform == 'darwin':
--> 291         from pyglet.app.carbon import CarbonEventLoop as EventLoop
    292     elif sys.platform in ('win32', 'cygwin'):
    293         from pyglet.app.win32 import Win32EventLoop as EventLoop

/Users/shadyeldamaty/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pyglet/app/carbon.py in <module>()
     42 
     43 from pyglet.app import windows, BaseEventLoop
---> 44 from pyglet.window.carbon import carbon, types, constants, _oscheck
     45 
     46 EventLoopTimerProc = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_void_p)

/Users/shadyeldamaty/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pyglet/window/__init__.py in <module>()
   1667     # Try to determine which platform to use.
   1668     if sys.platform == 'darwin':
-> 1669         from pyglet.window.carbon import CarbonPlatform, CarbonWindow
   1670         _platform = CarbonPlatform()
   1671         Window = CarbonWindow

/Users/shadyeldamaty/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pyglet/window/carbon/__init__.py in <module>()
     47 from pyglet.window import WindowException, Platform, Display, Screen,      48     BaseWindow, MouseCursor, DefaultMouseCursor, _PlatformEventHandler
---> 49 from pyglet.window import key
     50 from pyglet.window import mouse
     51 from pyglet.window import event

ImportError: cannot import name key 


Can you please help me debug why pyglet will not work on my system and if possible how to get the psychopy script above to work?  I've been working on this issue for about 8 hours now and have tried everything I could find online.  

--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Vim | 14 Oct 22:26 2014
Picon

Pyglet 1.2+ on PyPi

Hi all,

What steps need to be taken in order to get a more recent version of pyglet onto PyPi for easy installation via pip? Getting the package into a conda repository would be even better.

If this is something simple to do, please point me in the right direction.

If this is something difficult to do, when do we plan on updating these package manager repos next?

--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Ryan Hughes | 14 Oct 17:38 2014
Picon

Vsync doesn't work.

Hi.

I'm trying to get pyglet set up, but I can't seem to get vsync to work at all.

window.set_vsync(True) does nothing as far as I can tell (as well as window.set_vsync(False)).

My application still runs at ~120 FPS either way (note my refresh rate is 60Hz).

I'm at a loss as to what is going on. I've had similar problems in the past, but nothing seems to work here. Do you have any suggestions?

I'm running Linux Mint 14, with an Nvidia GTX 660M, pyglet 1.2a, and Python 3.4.

Here's my code: http://pastie.org/9647387


--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Robert Stolarz | 12 Oct 23:01 2014
Picon

Drawing vertex lists in Pyglet

I'm trying to draw some objects in Pyglet using the same Vertex List and transforming; unfortunately, I can't get the shape to appear on my screen. Why can't I see it? Is this a good way to draw the same shape in different places with different colors?

from pyglet.gl import *
from pyglet.graphics import *


class PointySide:
    neither
= 0
    left
= 1
    right
= 2
    both
= 3


v_lists
= {}
def getVList(psTup):
   
if psTup in v_lists:
       
return v_lists[psTup];
    vs
= (0,0,3,0)
   
for i,v in enumerate(psTup):
       
if v & PointySide.right:
            vs
= vs + (4,i*4+2)
        vs
= vs + (3,i*4+4)
   
   
for i,v in enumerate(psTup[::-1]): # in reverse now
        vs
= vs + (0,i*4)
       
print v
       
if v & PointySide.left:
            vs
= vs + (1,i*4+2)
   
    v_lists
[psTup] = vs
   
return vs


# Direct OpenGL commands to this window.
window
= pyglet.window.Window()


t
= (PointySide.both,PointySide.left)
l
= getVList(t)
pointsnum
= len(l)/2
vertex_list
= pyglet.graphics.vertex_list(pointsnum,
   
('v2i/static',l),
   
('c3b/static',(255,0,0) * pointsnum) # * repeats a tuple, because python
)


<at> window.event
def on_draw():
    glClear
(GL_COLOR_BUFFER_BIT)
    glLoadIdentity
()
    glPushMatrix
()
    glTranslatef
(-10,-60,0)
   
#glScalef(2,2,1)
     
# # #
    pyglet
.graphics.draw_indexed(4, pyglet.gl.GL_TRIANGLES,
   
[0, 1, 2, 0, 2, 3],
   
('v2i', (100, 100,
             
150, 100,
             
150, 150,
             
100, 150))
   
)


    vertex_list
.draw(GL_POLYGON);
    glPopMatrix
()
   


pyglet
.app.run()



--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
John Ladasky | 10 Oct 01:40 2014
Picon
Picon

Pyglet tests, and 2to3

Hi folks,

I just set up a new OS (Windows 7, in case it matters), and installed Pyglet 1.2 alpha1 on Python 3.4.  In doing so, I was reminded of an issue that I encountered the last time I did a Pyglet installation.  While the Pyglet docs state that 2to3 is automatically run on Pyglet itself during the installation process, it would appear that the files in the "tests" directory are NOT similarly converted.  Is this intentional?  If not, would it be difficult to fix that?  Thanks for considering my suggestion.

--
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 pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Gmane