I would like to benchmark pyglet against pygame (blit calls etc).
In pygame, I tend to use a 640 x 480 fullscreen display.
How can I create the same display (=window) in pyglet 1.2.4?
I would like to benchmark pyglet against pygame (blit calls etc).
In pygame, I tend to use a 640 x 480 fullscreen display.
How can I create the same display (=window) in pyglet 1.2.4?
If you're looking for a full screen display matching your window coordinates, use
window = pyglet.window.Window(fullscreen = True)
This will create a window which matches the dimensions of your display.
import pyglet
win = pyglet.window.Window(width=800, height=600, fullscreen=True)
pyglet.app.run()
This will create a window with your proportions and make it fullscreen.
For instance, here's a 800x600 sized image viewer that requires kitten.jpg
:
import pyglet
window = pyglet.window.Window(width=800, height=600, fullscreen=True)
image = pyglet.resource.image('kitten.jpg')
@window.event
def on_draw():
window.clear()
image.blit(0, 0)
pyglet.app.run()
The image will not stretch or scale, to fiddle around with this see image.scale = 0.5
for instance.