File: test_simple_renderbuffer.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 (29 lines) | stat: -rw-r--r-- 658 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import moderngl
import pytest


def test_renderbuffer(ctx):
    ctx.renderbuffer((64, 64))


def test_multisample_renderbuffer(ctx):
    if ctx.max_samples < 2:
        pytest.skip('multisampling is not supported')

    ctx.renderbuffer((64, 64), samples=2)


def test_depth_renderbuffer(ctx):
    ctx.depth_renderbuffer((64, 64))


def test_multisample_depth_renderbuffer(ctx):
    if ctx.max_samples < 2:
        pytest.skip('multisampling is not supported')

    ctx.depth_renderbuffer((64, 64), samples=2)


def test_renderbuffer_invalid_samples(ctx):
    with pytest.raises(moderngl.Error, match='sample'):
        ctx.renderbuffer((64, 64), samples=3)