File: test_framebuffer_read_channels.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 (12 lines) | stat: -rw-r--r-- 361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12

def test_framebuffer_read_channels(ctx):
    fbo = ctx.framebuffer([
        ctx.renderbuffer((4, 4)),
    ])

    fbo.clear(65 / 255, 66 / 255, 67 / 255, 68 / 255)

    assert fbo.read(components=1) == b'A' * 16
    assert fbo.read(components=2) == b'AB' * 16
    assert fbo.read(components=3) == b'ABC' * 16
    assert fbo.read(components=4) == b'ABCD' * 16