Reputation: 1258
UPDATE:
I checked the graphics cards installed on the computers.
The one where it "works" has Nvidia Graphics and the other has Intel HD R graphics under display adapter in Device Manager. I'm assuming the Intel HD R graphics driver is not sufficient (does not contain the OpenGL required?).
What do I need to get on the Intel HD R graphics computer in order for the arcade module to work?
ORIGINAL QUESTION:
Experiencing a very weird issue where python code I've written works on one computer but not on another one and I'm not sure why...
I have Python 3.6.4 installed on both computers. Any version which is 3.6 + should be able to run the Arcade module.
This is my code, super simple stuff:
# import needed modules
import random
import arcade
arcade.open_window(800, 600,'most awesome nothing', False)
arcade.set_background_color(arcade.color.BLUE)
arcade.start_render()
python = arcade.Sprite(r"C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\diamond.png")
python.center_x = 200
python.center_y = 200
python.draw()
arcade.finish_render()
arcade.run()
Works fine on one computer, but on the other, I get this error:
Code Format:
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
RESTART: C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py
Traceback (most recent call last):
File "C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py", line 5, in <module>
arcade.open_window(800, 600,'most awesome nothing', False)
File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 384, in open_window
_window = Window(width, height, window_title, resizable, update_rate=None)
File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 56, in __init__
gl.glEnable(gl.GL_MULTISAMPLE_ARB)
File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyglet\gl\lib.py", line 105, in errcheck
raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid enumerant'
>>>
Question: Why does it work on one computer and not the other?
Any help would be greatly appreciated. Thank you!
Upvotes: 2
Views: 2225
Reputation: 2066
That line of code enables OpenGL multisampling. It is required for anti-aliasing. It appears that isn't supported with the graphics card/driver combination.
You can create an arcade.Window instance with antialiasing=False
, but the open_window
command you are using unfortunately does not support that in 2.0.1.
As issue has been opened to downgrade gracefully if multisampling isn't supported:
https://github.com/pvcraven/arcade/issues/339
Upvotes: 1