Skip to content

Commit

Permalink
Fix OpenGL in Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
Baekalfen committed Oct 17, 2023
1 parent ad5d37d commit a466ba9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
- name: Build PyBoy
run: |
python setup.py build_ext -j $(getconf _NPROCESSORS_ONLN) --inplace
- name: OpenGL dependencies
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo apt update
sudo apt install libopengl0 freeglut3-dev
- name: Run PyTest
env:
PYTEST_SECRETS_KEY: ${{ secrets.PYTEST_SECRETS_KEY }}
Expand Down
5 changes: 4 additions & 1 deletion pyboy/plugins/window_open_gl.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ def _gldraw(self):
def enabled(self):
if self.pyboy_argv.get("window_type") == "OpenGL":
if opengl_enabled:
return True
if bool(OpenGL.GLUT.freeglut.glutMainLoopEvent):
return True
else:
logger.error("Failed to load \"PyOpenGL\". OpenGL window disabled")
else:
logger.error("Missing depencency \"PyOpenGL\". OpenGL window disabled")
return False
Expand Down

0 comments on commit a466ba9

Please sign in to comment.