GLSL shader object loaded and compiled from a *.glsl shader file.
More...
|
| Shader (string name, string file, ShaderType type) |
| Creates a new shader from specified GLSL source file. More...
|
|
void | Dispose () |
|
|
static string | GetDefaultName (string file) |
| Returns an auto-generated shader name based on the file name. More...
|
|
|
readonly int | ID |
| ID of the shader compiled by OpenGL. More...
|
|
|
string | Name [get] |
| The name of this shader object. More...
|
|
string | File [get] |
| The file containing the source for this shader. More...
|
|
string | Name [get] |
| Gets the name associated with this resource. More...
|
|
GLSL shader object loaded and compiled from a *.glsl shader file.
TriDevs.TriEngine.Shaders.Shader.Shader |
( |
string |
name, |
|
|
string |
file, |
|
|
ShaderType |
type |
|
) |
| |
Creates a new shader from specified GLSL source file.
- Parameters
-
name | The name to give to this shader, or null to let constructor auto-generate a name based on the file name. |
file | GLSL source to use. |
type | The type of shader to create. |
66 ID = GL.CreateShader(type);
67 var source = System.IO.File.ReadAllText(_file);
68 GL.ShaderSource(
ID, source);
void TriDevs.TriEngine.Shaders.Shader.Dispose |
( |
| ) |
|
static string TriDevs.TriEngine.Shaders.Shader.GetDefaultName |
( |
string |
file | ) |
|
|
static |
Returns an auto-generated shader name based on the file name.
- Parameters
-
- Returns
- The auto-generated shader name.
79 return Path.GetFileNameWithoutExtension(file);
readonly int TriDevs.TriEngine.Shaders.Shader.ID |
ID of the shader compiled by OpenGL.
string TriDevs.TriEngine.Shaders.Shader.File |
|
get |
The file containing the source for this shader.
string TriDevs.TriEngine.Shaders.Shader.Name |
|
get |
The name of this shader object.
The documentation for this class was generated from the following file: