Search code examples
python2d-gamespygletarcade

How to fix a MissingFunctionException with Arcade library


I'm practicing Arcade Library for 2D-game development. But my first program ends up with an error!

I want to make my first 2D-game with an easy-to-learn Arcade Library in Python - A Happy Smiley Face -.

import arcade

# set constants for the screen size:
SCREEN_WIDTH = 600
SCREEN_HEIGHT = 600

# open the window, set screen size & dimension:
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Hello, World! [Smiley]")

# set the bgcolor to white:
arcade.set_background_color(arcade.color.WHITE)

# start the render process, this must done before any drawing commands:
arcade.start_render()

# draw the face:
x, y, r = 300, 300, 200
arcade.draw_circle_filled(x, y, r, arcade.color.YELLOW)

# draw the right eye:
x = 370
y = 350
r = 20
arcade.draw_circle_filled(x, y, r, arcade.color.BLACK)

# draw the left eye:
x = 230
y = 350
r = 20
arcade.draw_circle_filled(x, y, r, arcade.color.BLACK)

# draw the smile:
x = 300
y = 280
width = 120
height = 100
start_angle = 190
end_angle = 350
arcade.draw_arc_outline(x, y, width, height, arcade.color.BLACK, start_angle, end_angle)

# finish drawing and display the result:
arcade.finish_render()

# keep the window open until the user hits the 'close' button:
arcade.run()

I expected a 'Yellow Emoji with a smile'. But I'm stuck with an unexpected error:

Start
Start
Traceback (most recent call last):
  File "E:/Python/#Programs/arcade_pract/Hello, arcade!.py", line 18, in <module>
    arcade.draw_circle_filled(x, y, r, arcade.color.YELLOW)
  File "C:\Users\AVD\AppData\Roaming\Python\Python37\site-packages\arcade\draw_commands.py", line 629, in draw_circle_filled
    draw_ellipse_filled(center_x, center_y, width, height, color, num_segments=num_segments)
  File "C:\Users\AVD\AppData\Roaming\Python\Python37\site-packages\arcade\draw_commands.py", line 696, in draw_ellipse_filled
    _generic_draw_line_strip(point_list, color, gl.GL_TRIANGLE_FAN)
  File "C:\Users\AVD\AppData\Roaming\Python\Python37\site-packages\arcade\draw_commands.py", line 795, in _generic_draw_line_strip
    fragment_shader=line_fragment_shader,
  File "C:\Users\AVD\AppData\Roaming\Python\Python37\site-packages\arcade\shader.py", line 226, in program
    (fragment_shader, GL_FRAGMENT_SHADER)
  File "C:\Users\AVD\AppData\Roaming\Python\Python37\site-packages\arcade\shader.py", line 111, in __init__
    self.prog_id = prog_id = glCreateProgram()
  File "C:\Users\AVD\AppData\Roaming\Python\Python37\site-packages\pyglet\gl\lib_wgl.py", line 107, in __call__
    return self.func(*args, **kwargs)
  File "C:\Users\AVD\AppData\Roaming\Python\Python37\site-packages\pyglet\gl\lib.py", line 64, in MissingFunction
    raise MissingFunctionException(name, requires, suggestions)
pyglet.gl.lib.MissingFunctionException: glCreateProgram is not exported by the available OpenGL driver.  VERSION_2_0 is required for this functionality.
Warning: Anti-aliasing not supported on this computer.


Solution

  • So, I have found it. I don't have a Dedicated Graphics card and Anti-aliasing is not supported by my In-build Intel Graphics.