def createShader(vert_fname, frag_fname):
 with open(op.join(this_dir, vert_fname), 'rb') as fid:
  vert = fid.read().decode('ASCII')
 with open(op.join(this_dir, frag_fname), 'rb') as fid:
  frag = fid.read().decode('ASCII')
 vertexShader = gl.glCreateShader(gl.GL_VERTEX_SHADER)
 gl.glShaderSource(vertexShader, vert)
 gl.glCompileShader(vertexShader)
 fragmentShader = gl.glCreateShader(gl.GL_FRAGMENT_SHADER)
 gl.glShaderSource(fragmentShader, frag)
 gl.glCompileShader(fragmentShader)
 programObj = gl.glCreateProgram()
 gl.glAttachShader(programObj, vertexShader)
 gl.glAttachShader(programObj, fragmentShader)
 gl.glLinkProgram(programObj)
 checkGLError()
 return programObj

def createShader ( vert_fname , frag_fname ) : with open ( op . join ( this_dir , vert_fname ) , 'rb' ) as fid : vert = fid . read ( ) . decode ( 'ASCII' ) with open ( op . join ( this_dir , frag_fname ) , 'rb' ) as fid : frag = fid . read ( ) . decode ( 'ASCII' ) vertexShader = gl . glCreateShader ( gl . GL_VERTEX_SHADER ) gl . glShaderSource ( vertexShader , vert ) gl . glCompileShader ( vertexShader ) fragmentShader = gl . glCreateShader ( gl . GL_FRAGMENT_SHADER ) gl . glShaderSource ( fragmentShader , frag ) gl . glCompileShader ( fragmentShader ) programObj = gl . glCreateProgram ( ) gl . glAttachShader ( programObj , vertexShader ) gl . glAttachShader ( programObj , fragmentShader ) gl . glLinkProgram ( programObj ) checkGLError ( ) return programObj
createshader - create .