-1

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?

Don Polettone
  • 185
  • 1
  • 14
  • You really should try something before asking questions like these. This is basic information found under the [Quickstart guide](http://pyglet.readthedocs.io/en/pyglet-1.2-maintenance/programming_guide/quickstart.htm) and also under [pyglet.window.Window](http://pyglet.readthedocs.io/en/pyglet-1.2-maintenance/api/pyglet/window/pyglet.window.Window.html#pyglet.window.Window) documentation. – Torxed Oct 26 '16 at 08:40

2 Answers2

0

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.

learner
  • 3,168
  • 3
  • 18
  • 35
0
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.

Torxed
  • 22,866
  • 14
  • 82
  • 131