PYME.LMVis.shader_programs.shader_loader module

exception PYME.LMVis.shader_programs.shader_loader.GLShaderLoadException(*args, **kwargs)

Bases: exceptions.Exception

This class is used if an error in the ShaderLoader occurs You usually only pass the text message to the constructor and raise the exception

class PYME.LMVis.shader_programs.shader_loader.ShaderLoader

Bases: object

This class is used to load shader source code and deliver it to programs that need it.

It could be used to read any text based file. But this would be confusing and should’t be done.

Methods

get_code()
read_file(path) Read a shader source file.
read_file_with_path(path, file_name) Read a shader source file.
get_code()
read_file(path)

Read a shader source file. :param path: the directory and the filename as the shader is saved on the disk

it can be relative or absolute
Returns:a string representing the source code of the shader
read_file_with_path(path, file_name)

Read a shader source file. :param path: the directory on the disk, including the last ‘/’

it can be relative or absolute
Parameters:file_name – the filename of the shader source
Returns:a string representing the source code of the shader