Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyopengl as a wheel #25

Open
andreagalle opened this issue Oct 23, 2023 · 3 comments
Open

pyopengl as a wheel #25

andreagalle opened this issue Oct 23, 2023 · 3 comments

Comments

@andreagalle
Copy link

I added this wheel below, because I need to use OpenGL in my pygame project (using pygbag):

https://files.pythonhosted.org/packages/99/48/00e31747821d3fc56faddd00a4725454d1e694a8b67d715cf20f531506a5/PyOpenGL-3.1.7-py3-none-any.whl

of course I am pointing to my own cdn, but I am getting the following error:

pkg : http://localhost:8000/archives/repo/pkg/PyOpenGL-3.1.7-py3-none-any.whl
 |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX| 100.0% 
1202: want='PIL' found : True
pkg : http://localhost:8000/archives/repo/pkg/PIL-9.1.1-cp311-cp311-wasm32_mvp_emscripten.whl
 |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX| 100.0% 
646: starting shell
996: 122 lines queued for async eval
going interactive
643: TODO detect input/print to select repl debug
Traceback (most recent call last):
  File "/usr/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: ('Could not load dynamic lib: GLX\nError: http://localhost:8000//archives/0.7/python311/GLX: file not found, and synchronous loading of external files is not available', 'GLX', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: ('Could not load dynamic lib: OpenGL\nError: http://localhost:8000//archives/0.7/python311/OpenGL: file not found, and synchronous loading of external files is not available', 'OpenGL', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: ('Could not load dynamic lib: GL\nError: http://localhost:8000//archives/0.7/python311/GL: file not found, and synchronous loading of external files is not available', 'GL', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/OpenGL/platform/glx.py", line 25, in GL
    raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 'Could not load dynamic lib: GL\nError: http://localhost:8000//archives/0.7/python311/GL: file not found, and synchronous loading of external files is not available', 'GL', None)

Is there any shortcoming you forsee doing this? Is there any possibility that pygbag can support openGL?

@pmp-p
Copy link
Member

pmp-p commented Oct 24, 2023

WebGL uses GLES not OpenGL, it is possible to have OpenGL 1.0 emulation but it is only usefull for initial window setup. You should go for something modern like ZenGL ( which is expected to be pygbag compatible at some point).

But the most important is that WebGPU is coming soon so more power to game engines that deal with low level WGPU/Vulkan/DX12/Metal.

OpenGL - is - dead and will have backport layer anyway at some point to resurrect old programs.

So meanwhile please save your time and use/learn/teach 3D game engines that provide abstraction.

A perfectly decent FOSS alternative to competitors around is Panda3D. eg on itch https://itch.io/c/3724091/panda3d-wasm

transfering to porting.

@pmp-p pmp-p transferred this issue from pygame-web/pygbag Oct 24, 2023
@andreagalle
Copy link
Author

What about Godot (https://godotengine.org/), I see Panda3D is a game engine too. Isn't there the possibility just to import a 3D rendering engine to feed pygame (as well as pygbag) with sequences of PNG files to be blitted on the screen?

@pmp-p
Copy link
Member

pmp-p commented Oct 24, 2023

Godot is great, but it does not use Python (gdscript instead)

Panda3D is as powerfull and C++ built around python interpreter from the start, it can interface with pygame/matplotlib/etc with only a few lines eg https://pygame-web.github.io/showroom/pypad_git.html#src/test_pgp3d.py

@pmp-p pmp-p changed the title importing pyopengl as a wheel pyopengl as a wheel Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants