Questions tagged [pyglet]

Pyglet is a cross-platform windowing and multimedia library for Python which provides interface to the platform's OpenGL library.

Pyglet is a cross-platform windowing and multimedia library for Python which provides interface to the platform's OpenGL library.

Pyglet has built-in support for mouse and keyboard events, and can load several multimedia file formats (optionally via AVbin). OpenAL, DirectSound or ALSA can be used for audio playback, with 3D positional audio support.

Pyglet is divided into several interdependent modules such as pyglet.gl, pyglet.graphics, pyglet.image, pyglet.media, pyglet.text, and pyglet.window.

919 questions
10
votes
0 answers

Problems with OpenGL 4 VBOs and Numpy arrays, Pyglet/Python

I'm getting started with using OpenGL 4 in Python (through Pyglet and some framework code I got off the net/wrote myself for loading Shaders/Programs), but I think I understand things fairly well, so I don't think there is a problem somewhere in my…
10
votes
3 answers

Pyglet 1.2alpha1 not working on Python 3.3.0

I can't use Pyglet 1.2alpha1 (which should be able to run under Py3) from Python 3. I followed the instructions and installed it correctly, yet it doesn't run on Py3, but I know I installed everything right because I can use it from Python…
AndPassa
  • 131
  • 1
  • 3
9
votes
6 answers

Resource Not Found Exception in pyglet

I'm using Python 2.6.6 and pyglet 1.1.4. In my "Erosion" folder, I have "Erosion.py" and a folder named "Images." Inside images, there are .png images. One image is named "Guard.png." In "Erosion.py" there is a segment that goes like…
Jack
  • 91
  • 1
  • 4
9
votes
2 answers

Trying to use Pyglet - what does this error mean?

I am running Mac OS X Mountain Lion, with Python 2.7. I did a source install of Pyglet that seemed to go without errors, but any time I try to run a program I get a longish error that I don't understand. It sounds like it has something to do with…
Kate
  • 219
  • 2
  • 3
9
votes
1 answer

How to avoid copying the level Surface every frame in worms-like game?

I am working on a game that has destructible terrain (like in the game Worms, or Scorched Earth) and uses pixel perfect collision detection via masks. The level is a single surface and how it works now is that I create a copy every frame, draw all…
Kiril
  • 2,091
  • 7
  • 33
  • 43
7
votes
2 answers

Taking a screenshot with Pyglet [Fix'd]

In the pyglet docs, I found: The following example shows how to grab a screenshot of your application window: pyglet.image.get_buffer_manager().get_color_buffer().save('screenshot.png') However when using this, everything will stop until I…
PrettyPrincessKitty FS
  • 6,117
  • 5
  • 36
  • 51
7
votes
2 answers

basic openGL, vertex buffers and pyglet

Edit: rotoglup found the problems in my code, adding the shaders I had removed completed the solution. See my answer below for the correct code (with shaders). Hi all ! I'm trying to learn some basics of modern OpenGL from this tutorial. I'd like…
Nicolas Lefebvre
  • 4,247
  • 1
  • 25
  • 29
7
votes
12 answers

how to play mp3

my problem starts here: pyttsx and gTTS module errors gTTS works well, takes text from text file, but first creates mp3 file, then if I want listen, I must call this mp3, so it is good but it would be better if I can avoid any audio files, and get…
user6067640
7
votes
2 answers

pixelwise drawing in pyglet (python)

OK. I'm tired of googling and reading throught lots of documentation with no results. My aim is simple: get pyglet to draw an image pixel by pixel. I've been searching for hours with no results. Can anyone give an example of a short program that…
Manuel Araoz
  • 15,962
  • 24
  • 71
  • 95
7
votes
1 answer

Why does referring to a class in (python) pyglet.image cause heavy cpu load on Windows?

I'm using python's pyglet module (python 3 on Windows). When I refer to any classes within pyglet.image, python's CPU usage jumps up and doesn't drop until I exit python. For example: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft…
Andrew
  • 2,842
  • 5
  • 31
  • 49
7
votes
2 answers

Why is pyglet so slow compared to pygame?

Here is the code. 5000 bouncing spinning red squares. (16x16 png) On the pygame version I get 30 fps but 10 fps with pyglet. Isnt OpenGl supposed to be faster for this kind of thing? pygame version: import pygame, sys, random from pygame.locals…
No Harm In Trying
  • 483
  • 1
  • 6
  • 12
7
votes
1 answer

How do I bind a Pyglet sprite with a Pymunk shape so they rotate together?

How do I bind a pyglet sprite to a pymunk body so that if the body is rotating the sprite also rotates?
7
votes
2 answers

Sub-pixel rendering in OpenGL - accuracy issue

I need to generate a few series of test images for a photogrammetric application. These should contain simple objects (disks, rectangles, etc) with a very precisely known position. Considering a 8bit grayscale image of a black rectangle on white…
Pietro
  • 121
  • 5
6
votes
5 answers

Python - Is it worthwhile to invest time in apparently stagnant modules?

To make it quick and dirty - I'm a newb programmer who's looking hard at Pyglet, it looks like a really clean and friendly module to use, unlike something like PyGame which is, even by looking with my own inexperienced eyes, a beast. However. …
user890167
6
votes
4 answers

pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None" only happens in VSCode terminal

If I run this code in the VSCode terminal import pyglet window = pyglet.window.Window(500, 500) I get Traceback (most recent call last): File "/home/justin/.local/lib/python3.8/site-packages/pyglet/__init__.py", line 334, in __getattr__ …
retrosnob
  • 113
  • 1
  • 7
1
2
3
61 62