/// <summary> /// Creates a shader from a text file. /// </summary> /// <param name="filePath">The path to the text file containing the shader source.</param> /// <param name="shaderType">Same as the argument to glCreateShader. For example ShaderType.VertexShader /// or ShaderType.FragmentShader.</param> /// <returns></returns> public static Shader ShaderFromFile(string filePath, ShaderType shaderType) { string text = File.ReadAllText(filePath); Shader shader = new Shader(text, shaderType); return shader; }
// tdogl::Shader objects can be copied and assigned because they are reference counted // like a shared pointer public Shader(Shader other) { _object = other._object; _refCount = other._refCount; }