예제 #1
0
        //-------------------------------------------------------------------------------------
        static public int Load(string filename, ShaderType shaderType, bool fCheckErrors = true)
        {
            int      shaderName = 0;
            IOReader file       = null;

            try
            {
                file = new IOReader(filename);
                string shaderText = file.ReadToEnd();

                shaderName = Compile(shaderType, shaderText, fCheckErrors);
            }
            catch (IOException e)
            {
                Console.WriteLine("Shader.File IO Exception: " + e.Message);
            }

            if (file != null)
            {
                file.Close();
            }

            return(shaderName);
        }