Skip to content

Commit

Permalink
OpenGL catch attribute error
Browse files Browse the repository at this point in the history
  • Loading branch information
Baekalfen committed Oct 17, 2023
1 parent d1e7b46 commit d65033d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions pyboy/plugins/window_open_gl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging

import numpy as np

from pyboy.logger import logger
from pyboy.plugins.base_plugin import PyBoyWindowPlugin
from pyboy.utils import WindowEvent
Expand All @@ -14,18 +15,14 @@

try:
import OpenGL.GLUT.freeglut
from OpenGL.GL import (
GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, glClear, glDrawPixels, glFlush,
glPixelZoom
)
# from OpenGL.GLU import *
from OpenGL.GLUT import (
GLUT_KEY_DOWN, GLUT_KEY_LEFT, GLUT_KEY_RIGHT, GLUT_KEY_UP, GLUT_RGBA, GLUT_SINGLE, glutCreateWindow,
glutDestroyWindow, glutDisplayFunc, glutGetWindow, glutInit, glutInitDisplayMode, glutInitWindowSize,
glutKeyboardFunc, glutKeyboardUpFunc, glutReshapeFunc, glutSetWindowTitle, glutSpecialFunc, glutSpecialUpFunc
)
from OpenGL.GL import (GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, glClear,
glDrawPixels, glFlush, glPixelZoom)
from OpenGL.GLUT import (GLUT_KEY_DOWN, GLUT_KEY_LEFT, GLUT_KEY_RIGHT, GLUT_KEY_UP, GLUT_RGBA, GLUT_SINGLE,
glutCreateWindow, glutDestroyWindow, glutDisplayFunc, glutGetWindow, glutInit,
glutInitDisplayMode, glutInitWindowSize, glutKeyboardFunc, glutKeyboardUpFunc,
glutReshapeFunc, glutSetWindowTitle, glutSpecialFunc, glutSpecialUpFunc)
opengl_enabled = True
except ImportError:
except (ImportError, AttributeError):
opengl_enabled = False

ROWS, COLS = 144, 160
Expand Down

0 comments on commit d65033d

Please sign in to comment.