Skip to content

Commit 737e12f

Browse files
committed
Update to latest pyopengl
and the last pyglet 1.x, and use uv instead of pipfile.
1 parent dcdc5a8 commit 737e12f

64 files changed

Lines changed: 164 additions & 351 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.14

CHANGES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
# 0.2 Aug 2026
3+
4+
Fixup to work with uv instead of Pipenv, latest PyOpenGL, last v1.x pyglet,
5+
and Python 3.14.
6+
7+
Add --screen command-line option to choose a screen to run on (integers from 0,
8+
detected screen numbers are printed on startup.)
9+
10+
# 0.1.3a April 2011
11+
12+
* Public announcement of code at PyCon talk
13+

CHANGES.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

Makefile

Lines changed: 13 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -7,73 +7,31 @@
77

88

99
NAME := gloopy
10-
SCRIPT := run.py
11-
VERSION := $(shell python -c "from ${NAME} import VERSION; print(VERSION)")
10+
VERSION := $(shell uv run python -c "from ${NAME} import VERSION; print(VERSION)")
1211

12+
help: ## Show this help.
13+
@# Optionally add 'sort' before 'awk'
14+
@grep -E '^[^_][a-zA-Z_\/\.%-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}'
15+
.PHONY: help
1316

14-
help:
15-
@echo This Makefile has no default target.
17+
get-version: ## Print version number to stdout
18+
@echo $(VERSION)
1619

17-
18-
test:
19-
python -m unittest discover gloopy
20+
test: ## Run tests
21+
uv run python -m unittest discover gloopy
2022
.PHONY: tests
2123

22-
23-
# runsnake is a GUI profile visualiser, very useful.
24-
# http://www.vrplumber.com/programming/runsnakerun/
25-
profile:
26-
python -O -m cProfile -o profile.out ${SCRIPT}
27-
runsnake profile.out
28-
.PHONY: profile
29-
30-
31-
clean:
24+
clean: ## Delete generated files
3225
rm -rf build dist *.egg-info tags pip-log.txt
3326
-find . \( -name "*.py[oc]" -o -name "*.orig" -o -name "*.rej" \) -exec rm {} \;
3427
$(MAKE) -C docs clean
3528
.PHONY: clean
3629

37-
3830
tags:
3931
ctags -R ${NAME}
4032
.PHONY: tags
4133

42-
43-
docs:
44-
@$(MAKE) -C docs
45-
.PHONY: docs
46-
47-
48-
sdist: docs
49-
rm -rf dist/${NAME}-${VERSION}.* build
50-
python setup.py sdist
51-
.PHONY: sdist
52-
53-
54-
register: docs
55-
rm -rf dist/${NAME}-${VERSION}.* build
56-
python setup.py --quiet sdist register
57-
.PHONY: register
58-
59-
60-
upload: docs
61-
rm -rf dist/${NAME}-${VERSION}.* build
62-
python setup.py --quiet sdist register upload
63-
.PHONY: upload
64-
65-
66-
py2exe:
67-
rm -rf dist/${NAME}-${VERSION}-windows build
68-
python setup.py --quiet py2exe
69-
.PHONY: py2exe
70-
71-
72-
stats:
73-
@echo "non-blank lines of code:"
74-
@echo -n 'product: '
75-
@find ${NAME} -name '*.py' | grep -v "/tests/" | xargs cat | grep -cve "^\W*$$"
76-
@echo -n 'tests: '
77-
@find ${NAME} -name '*.py' | grep "/tests/" | xargs cat | grep -cve "^\W*$$"
78-
.PHONY: stats
34+
# Building docs doesn't currently work
35+
# It was a bit misguided, this project is a wacky personal experiment,
36+
# it doesn't need that kind of documentation anyway
7937

Pipfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

Pipfile.lock

Lines changed: 0 additions & 63 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ but pyglet.gl for performance critical OpenGL calls.
3131

3232
# Dependencies
3333

34-
- Originally written on Windows, run occasionally on OSX, and all recent
35-
development on Ubuntu.
34+
- Originally written on Windows, then on OSX, and all recent development on
35+
Ubuntu.
3636

37-
- Python 3.6
37+
- Dependencies are managed by uv.
3838

39-
This project does not use pip. Instead we track our dependencies using
40-
the newer '[Pipenv](https://docs.pipenv.org/)', built
41-
on top of pip. So instead of `pip install ...`, it should just be a `pipenv
42-
install`, but:
39+
- Python 3.x, tried up to 3.14
4340

4441
- Our Python dependencies (PyOpenGL, etc) aren't available as pre-compiled
45-
wheels, so installing them requires you are able to compile and link:
42+
wheels, so installing them requires you are able to compile and link. uv
43+
might take care of this automatically, but if not, try:
4644

4745
# On Ubuntu
4846
sudo apt-get update
@@ -53,16 +51,10 @@ install`, but:
5351
# On Ubuntu, if your Python3 was installed using 'apt', then:
5452
sudo apt install python3.6-dev
5553

56-
- Then you can install Python dependencies, as specified in 'Pipfile':
57-
58-
pip install --user pipenv
59-
pipenv install
60-
6154
# Running
6255

63-
Execute `run.py` from within the gloopy virtualenv, eg:
64-
65-
pipenv run ./run.py
56+
Execute `run.py` from within the gloopy virtualenv, see the script 'run'
57+
for the reference example of how to do that.
6658

6759
You should be presented with an orange fullscreen window.
6860

TODO.md

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
- Delete examples that do not work.
44
- Tidy the changes from pyMNtos
55
(one of the new features I thought was coded foolishly)
6-
- Update to pyopengl3.1 (requires new approach to buffers or something)
76
- faces, instead of having integer attributes, should be grouped into
87
a set of sets, or something. This actually lends itself to adding
98
transparent stuff later.
10-
- MANIFEST.in should be generated by setup.py
119
- space invaders show seam glitches (remove size mults to fix this and
1210
to understand how it was introduced)
13-
11+
- space invaders should be oriented differently. All facing the direction of
12+
rotation?
1413
- Consider eliminating the ability to modify shapes in-place, especially since
15-
this doesn't play nice with multishapes generator properties.
14+
this doesn't play nice with multishapes generator properties. Instead replace
15+
a shape with a modified copy.
1616
- if same shape is assigned to many items, it gets a separate glyph in each
1717
case. glyphs should not be stored as attribute of item. They should be
1818
stored in the view, in a dictionary of {shape_id: glyph}.
@@ -25,65 +25,6 @@
2525
- When an in-world item is assigned a new shape, or when a shape is modified,
2626
it should fire an event that causes the corresponding glyph to be regenerated.
2727

28-
# Inspiration
29-
30-
complicated saddle surfaces with holes:
31-
http://www.cs.berkeley.edu/~sequin/SCULPTS/scherk.html
32-
33-
building skyline at night:
34-
http://www.openbusiness.cc/wp-content/uploads/hk1.jpg
35-
36-
bulbous blobs with holes
37-
http://www.cs.berkeley.edu/~sequin/MVS/index.html
38-
http://www.graphica.com/gallery/trott1.html
39-
40-
Sections of a sphere:
41-
http://www.cs.berkeley.edu/~sequin/ART/MaxBill/MBTy5.jpg
42-
43-
screenshots on the geexlab website
44-
45-
Seirpinky cubes with floating debris:
46-
http://www.youtube.com/user/xenopusRTRT#p/u/2/SDzZchuhECY
47-
48-
# Rendering
49-
50-
* better shaders:
51-
* ambient light level should be a uniform
52-
* demo should populate this using world.background_color
53-
* directional light position & color should be uniforms
54-
* demo should assign these
55-
* point light source position & color should be uniforms
56-
* demo should attach point light source to a moving item
57-
* specular highlights from directional light
58-
* specular highlights from point light
59-
* per pixel lighting so that specular highlights in middle of flat faces
60-
look good
61-
* Textures. See:
62-
http://www.lighthouse3d.com/opengl/glsl/index.php?textureComb
63-
* demo should draw a 'sun' or 'moon' or somesuch
64-
in direction of directional light source
65-
66-
* fix your timestep. In particular, some way to reduce jittery movement
67-
caused by isolated slow or fast frames.
68-
69-
# Documentation
70-
71-
* sdist documentation images are included twice
72-
* sdist documentation should not be in html subdir
73-
* documentation should not include test packages
74-
* pip install should install deps, e.g. pyglet, popengl
75-
* Readme cannot contain class links, but we'd like the intro.rst (derived
76-
from it) to do so. Some sort of copy with a search-and-replace?
77-
78-
# Screen resolution
79-
80-
* key to flip from one screen to another when fullscreen
81-
* Convert options to use argparse, so that it can provide command line usage
82-
* command-line option to select screen resolution on startup (if used, then
83-
restore desktop resolution on exit)
84-
* keys or something to select new screen resolution during runtime
85-
* persist user's chosen screen resolution
86-
8728
# OpenGL 3
8829

8930
* VBO the index array

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[project]
2+
name = "gloopy"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jonathan Hartley", email = "tartley@tartley.com" }
8+
]
9+
requires-python = ">=3.14"
10+
dependencies = [
11+
"numpy>=2.5.1",
12+
"pyglet<2",
13+
"pyopengl",
14+
"pyopengl-accelerate",
15+
]
16+
17+
[project.scripts]
18+
gloopy = "gloopy:main"
19+
20+
[build-system]
21+
requires = ["uv_build>=0.12.2,<0.13.0"]
22+
build-backend = "uv_build"

run

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/usr/bin/env bash
2-
pipenv run python -O gloopy/run.py 2>gloopy.log
3-
2+
uv run python -O src/gloopy/run.py "$@"

0 commit comments

Comments
 (0)