fsleyes.gl.gl14.glmesh_funcs
¶
This module provides functions which are used by the GLMesh
class to render Mesh
overlays in an OpenGL 1.4 compatible
manner.
An ARBPShader
is used to manage the glmesh
vertex/fragment
programs.
-
fsleyes.gl.gl14.glmesh_funcs.
compileShaders
(self)[source]¶ Loads the
glmesh
vertex and fragment shader program source, and createsARBPShader
instance(s).
-
fsleyes.gl.gl14.glmesh_funcs.
updateShaderState
(self, **kwargs)[source]¶ Updates the state of the vertex/fragment shaders according to the current
MeshOpts
configuration. This involves setting the parameter values used by the shaders.
-
fsleyes.gl.gl14.glmesh_funcs.
preDraw
(self)[source]¶ Must be called before
draw()
. Loads the appropriate shader program.
-
fsleyes.gl.gl14.glmesh_funcs.
draw
(self, glType, vertices, indices=None, normals=None, vdata=None)[source]¶ Called for 3D meshes, and
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.