INNER CODE UNIT · Python

TexturedQuadShader

mosra/magnum-examples · src/python/magnum-texturedquad.py:40

class TexturedQuadShader(gl.AbstractShaderProgram):
    POSITION = gl.Attribute(
        gl.Attribute.Kind.GENERIC, 0,
        gl.Attribute.Components.TWO,
        gl.Attribute.DataType.FLOAT)
    TEXTURE_COORDINATES = gl.Attribute(
        gl.Attribute.Kind.GENERIC, 1,
        gl.Attribute.Components.TWO,
        gl.Attribute.DataType.FLOAT)

    _texture_unit = 0

    def __init__(self):
        super().__init__()

        vert = gl.Shader(gl.Version.GL330, gl.Shader.Type.VERTEX)
        vert.add_source("""
layout(location = 0) in vec4 position;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…