fsleyes.gl.gl21.glmesh_funcs
¶
This module provides functions which are used by the GLMesh
class to render Mesh
overlays in an OpenGL 2.1 compatible
manner.
A GLSLShader
is used to manage the glmesh
vertex/fragment
shader programs.
-
fsleyes.gl.gl21.glmesh_funcs.
compileShaders
(self)[source]¶ Loads the
glmesh
vertex/fragment shader source and createsGLSLShader
instance(s).
-
fsleyes.gl.gl21.glmesh_funcs.
updateShaderState
(self, **kwargs)[source]¶ Updates the shader program according to the current
MeshOpts`
configuration.
-
fsleyes.gl.gl21.glmesh_funcs.
preDraw
(self)[source]¶ Must be called before
draw()
. Loads the appropriate shader program.
-
fsleyes.gl.gl21.glmesh_funcs.
draw
(self, glType, vertices, indices=None, normals=None, vdata=None)[source]¶ Called for 3D meshes, and when
MeshOpts.vertexData
is notNone
. Loads and runs the shader program.- Parameters
glType – The OpenGL primitive type.
vertices –
(n, 3)
array containing the line vertices to draw.indices – Indices into the
vertices
array. If not provided,glDrawArrays
is used.normals – Vertex normals.
vdata –
(n, )
array containing data for each vertex.