Cloud Strife | 12 Sep 18:42 2014
Picon

Display errors.

Whenever I run the astraea.py example, the display is messed up.
The arrows don't have transparent backgrounds. Shots don't show up (although they are being fired at
asteroids). Explosions show up sometimes and then stop. The asteroid image may hang after being shot,
then spliting afterwards.
What could have caused this?

--

-- 
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.

feenuks | 6 Sep 18:23 2014
Picon

Pyglet player

I have code like this:
import pyglet

class Video():
   
def __init__(self, engine):
       
self._engine = engine
       
self._player = pyglet.media.Player()

   
<at> property
   
def window(self):
       
return self._engine.window

   
def play(self, filename):
       
def on_draw():
           
self.window.clear()
           
print('video on draw')
           
if self._player.source and self._player.source.video_format:
               
self._player.get_texture().blit(0, 0)


        source
= pyglet.media.load(filename, streaming=True)
       
self._player.push_handlers(on_eos, on_player_eos)
       
self._player.queue(source)
       
self._player.play()
       
self.window.push_handlers(on_draw)

class Engine():
   
def __init__(self):
       
self.window = pyglet.window.Window()
       
self.video = Video(self)
   
def show_menu(self):
        image
= pyglet.image.load('some/file.jpg')
       
<at> self.window.event
       
def on_draw():
           
self.window.clear()
            image
.blit(0, 0)

e
= Engine()
e
.video.play('some/movie.avi')
e
.show_menu()
pyglet
.app.run()

I have problem with video player. How can I made it to block executing rest of code until video ends (i.e. e.show_menu() is called after whole movie is played). Any suggestions? Thank you.
Tutaj wprowadź kod...

--
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.
Joker Qyou | 5 Sep 05:41 2014
Picon

Working with PIL

Hi guys! 
I'm working on a small program and want to do the following things:
Create a window with transparency, which means the user could see what's behind the window. 
If the above is not possible, I want t manually draw what's behind the window onto the window. 
And I'm currently using PIL.ImageGrab, it could do a job like 'take a screenshot'. 
But I'm have problems on using the image I get from ImageGrab (which is a PIL.Image.Image instance). How should I put the image data onto the window?
I've tried to create a image using
a = pyglet.image.create(1366, 768)

and set the image data by
a.set_data('RGB', -1366*3, image.getdata())

, but they does not work. 

So it's there a way to create a window with transparency? If not, how should I simulate this effect?
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.
Richard Jones | 4 Sep 15:19 2014
Picon

pyglet.org back online

Sorry about that folks, my contact details with the registrar got stale and they took the domain offline. It's all better now.


    Richard

--
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.
Raymond Liu | 3 Sep 20:16 2014
Picon

Is Pyglet website down?

I can't access the Pyglet website (from UK). My friend from Singapore has confirmed this. Is anyone else experiencing problems with the Pyglet website?

--
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.
Raymond Liu | 19 Aug 21:26 2014
Picon

Memory-efficient way of getting a single pixel colour value from an image?

Suppose I have an image, obtained by

img = pyglet.image.load("dog.jpg")

I know I can access the image data by using, for example,

data = img.get_image_data().get_data("RGB", img.width*3)

But the problems is that the object `data` obtained as above is very very big, since it contains the RBG value of each pixel a potentially large image. For a 1024 by 768 image, the size of `data` is well over 2GB. That feels like it's a lot to keep in memory, even if temporarily. All I need for my program is to access the RGB value of one particular pixel of my choosing. Is there a memory-efficient way of doing that in Pyglet? In PyGame for example, there is `pygame.Surface.get_at()`. Is there a similar thing in Pyglet?

--
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.
Eduard Nicodei | 19 Aug 16:09 2014
Picon

pyglet.window.Window(800,600) hangs with X11 error: BadWindow

Hello everybody,

I have a very basic python script:
import pyglet
window = pyglet.window.Window(800, 600)
pyglet.app.run()
When I run it, however, nothing happens and pressing ctrl+c on the terminal does nothing.
I used pdb to investigate the problem and it seems the script hangs on the "window = pyglet.window.Window(800, 600)" line.
I dug deeper and I rerun the script with PYGLET_DEBUG_X11 set to 1.
This gave me the following stacktrace: http://pastebin.com/GMex4dkd

I should note that no more text appeared on the terminal and pressing ctrl+c didn't close python (I had to pkill it)

python version 2.7.8
pyglet version 1.1.4 (installed from vanilla source)
X.org version 1.15.0

I know X.org version 1.15 had some ABI changes, but I don't know if those might be the cause of this.

Any ideas on what might cause the BadWindow errors?

--
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.
Raymond Liu | 19 Aug 00:42 2014
Picon

PyCharm can't fine pyglet.window.mouse but can find pyglet window.key???

If you use PyCharm, the attached screenshot explains it all.

Any idea why? I'm chronically confused as to how PyCharm sometimes finds packages and sometimes doesn't.

I'm using Python 3.4.1, Pyglet 1.2 Alpha, and PyCharm 3.4.1.

--
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.
Raymond Liu | 13 Aug 13:51 2014
Picon

vertex_list doesn't work, GL version mismatch?

Hi! I typed the following example code, found in the Graphics section of the programming guide.


vertex_list = pyglet.graphics.vertex_list(2, ('v2i', (10, 15, 30, 35)), ('c3B', (0, 0, 255, 0, 255, 0)) )


But it gives me the following error.


Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pyglet\graphics\__init__.py", line 445, in _get_domain
domain = domain_map[key]
KeyError: (('v2i', 'c3B'), 0, False)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
vl = pyglet.graphics.vertex_list(2, ("v2i", (10, 15, 30, 35)), ("c3B", (0, 0, 255, 0, 255, 0)))
File "C:\Python34\lib\site-packages\pyglet\graphics\__init__.py", line 289, in vertex_list
return _get_default_batch().add(count, 0, None, *data)
File "C:\Python34\lib\site-packages\pyglet\graphics\__init__.py", line 364, in add
domain = self._get_domain(False, mode, group, formats)
File "C:\Python34\lib\site-packages\pyglet\graphics\__init__.py", line 451, in _get_domain
domain = vertexdomain.create_domain(*formats)
File "C:\Python34\lib\site-packages\pyglet\graphics\vertexdomain.py", line 135, in create_domain
return VertexDomain(attribute_usages)
File "C:\Python34\lib\site-packages\pyglet\graphics\vertexdomain.py", line 186, in __init__
usage=usage, vbo=vbo)
File "C:\Python34\lib\site-packages\pyglet\graphics\vertexbuffer.py", line 116, in create_mappable_buffer
return MappableVertexBufferObject(size, target, usage)
File "C:\Python34\lib\site-packages\pyglet\graphics\vertexbuffer.py", line 382, in __init__
super(MappableVertexBufferObject, self).__init__(size, target, usage)
File "C:\Python34\lib\site-packages\pyglet\graphics\vertexbuffer.py", line 300, in __init__
glGenBuffers(1, id)
File "C:\Python34\lib\site-packages\pyglet\gl\lib_wgl.py", line 82, in __call__
return self.func(*args, **kwargs)
File "C:\Python34\lib\site-packages\pyglet\gl\lib.py", line 62, in MissingFunction
raise MissingFunctionException(name, requires, suggestions)
pyglet.gl.lib.MissingFunctionException: glGenBuffers is not exported by the available OpenGL driver. VERSION_1_5 is required for this functionality.


What does this error mean? Does it mean that I don't have the right version of OpenGL? How do I update OpenGL in a way that pyglet will support it properly?

--
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.
Henry Harrison | 2 Aug 19:17 2014
Picon

2D shape primitives for Pyglet

Hello,

I wanted to share this with the pyglet community. I created a library called "pygelt2d" that offers shape primitives for pyglet, so you can easily draw rectangles, circles, and other polygons. It's on PyPi as pyglet2d or check out the repo at github.com/hsharrison/pyglet2d.

Right now it's only tested with Python >= 3.3 and pyglet 1.2alpha1. Also required is a geometry library Polygon3 (will be automatically installed as a dependency).

--
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.
BigD | 2 Aug 03:48 2014
Picon

batch.migrate does not work for indexed vertexlist?


Hi Everyone,

   I am working creating a 3d graphics engine and using the concepts behind sprite.Sprite and the graphics.py demo to create a 3d set of primitive objects (using pyglet 1.1.4 btw).  Now to implement picking I want to be able to change the group the primitive belongs to.  Based on sprite.Sprite, changing groups basically calls self._batch.migrate(self._vertex_list, GL_QUADS, self._group, self._batch).  Note that self._vertexlist in sprite.Sprite is not an indexed list (see Sprite._create_vertex_list).  When I try to do the same thing with an indexed vertexlist in my 3d engine I am getting some strange behavior. Looking at Batch.migrate in pyglet\graphics\__init__.py it seems that the batch._get_domain function is always called with False as the first argument, indicating that it's a regular vertexlist.  Does this mean indexed vertexlists cannot be migrated?  Has anyone tried to do something similar.

Denis

--
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