File: test_viewports.py

package info (click to toggle)
python-moderngl 5.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,700 kB
  • sloc: python: 15,758; cpp: 14,665; makefile: 14
file content (10 lines) | stat: -rw-r--r-- 320 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10

def test_viewport(ctx):
    fbo = ctx.simple_framebuffer((10, 10))
    fbo.use()
    assert ctx.viewport == (0, 0, 10, 10)
    assert fbo.viewport == (0, 0, 10, 10)
    ctx.viewport = 2, 3, 7, 8
    assert fbo.viewport == (2, 3, 7, 8)
    assert ctx.viewport == (2, 3, 7, 8)
    assert ctx.fbo.viewport == (2, 3, 7, 8)