Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am playing around with pyglet 1.2alpha-1 and Python 3.3. I have the following (extremely simple) application and cannot figure out what my issue is:

import pyglet

window = pyglet.window.Window()
#image = pyglet.resource.image('img1.jpg')
image = pyglet.image.load('img1.jpg')
label = pyglet.text.Label('Hello, World!!',
                      font_name='Times New Roman',
                      font_size=36,
                      x=window.width//2, y=window.height//2,
                      anchor_x='center', anchor_y='center')

@window.event
def on_draw():
    window.clear()
    label.draw()
    #    image.blit(0,0)

pyglet.app.run()

With the above code, my text label will appear as long as image.blit(0, 0) is commented out. However, if I try to display the image, the program crashes with the following error:

  File "C:\Python33\lib\site-packages\pyglet\gl\lib.py", line 105, in errcheck
raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid value'

I also get the above error if I try to use pyglet.resource.image instead of pyglet.image.load (the image and py file are in the same directory).

Any one know how I can fix this issue?

I am using Python 3.3, pyglet 1.2alpha-1, and Windows 8.

share|improve this question

1 Answer 1

The code -including the image.blit- runs fine for me. I'm using python 2.7.3, pyglet 1.1.4 There's nothing wrong with the code. You might consider trying other python and pyglet versions for the time being (until pyglet has a new stable release)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.