(self)
return program
Create shader program and attach shaders.
Create shader program and attach shaders.
Create shader program and attach shaders .
def create_program(self):
        """Create shader program and attach shaders."""
        program = gl.glCreateProgram()
        gl.glAttachShader(program, self.vs)
        gl.glAttachShader(program, self.fs)
        gl.glLinkProgram(program)

        result = gl.glGetProgramiv(program, gl.GL_LINK_STATUS)
        # check linking error
        if not(result):
            msg = "Shader program linking error:"
            info = gl.glGetProgramInfoLog(program)
            if info:
                msg += info
                raise RuntimeError(msg)
        
        self.program = program
        return program
def create_program ( self ) : program = gl . glCreateProgram ( ) gl . glAttachShader ( program , self . vs ) gl . glAttachShader ( program , self . fs ) gl . glLinkProgram ( program ) result = gl . glGetProgramiv ( program , gl . GL_LINK_STATUS ) # check linking error if not ( result ) : msg = "Shader program linking error:" info = gl . glGetProgramInfoLog ( program ) if info : msg += info raise RuntimeError ( msg ) self . program = program return program