Example #1
0
        private void compileShader(FixedFuncShaders.eFixedFuncShaderIndex id, string shaderText, string[] defines, bool vertexShader)
        {
            Macro [] Macrodefines = null;
            if (defines != null)
            {
                Macrodefines = new Macro[defines.Length];
                for (int k = 0; k < defines.Length; k++)
                {
                    Macrodefines[k].Definition = defines[k];
                }
            }
            GraphicsStream gs = ShaderLoader.CompileShader(shaderText, "main", Macrodefines, null, vertexShader ? "vs_2_0" : "ps_2_0", ShaderFlags.None);

            if (vertexShader)
            {
                BFixedFuncVS vsA = new BFixedFuncVS();
                vsA.mVS = new VertexShader(BRenderDevice.getDevice(), gs);
                vsA.mID = id;
                mVertexShaders.Add(vsA);
            }
            else
            {
                BFixedFuncPS vsA = new BFixedFuncPS();
                vsA.mPS = new PixelShader(BRenderDevice.getDevice(), gs);
                vsA.mID = id;
                mPixelShaders.Add(vsA);
            }
            gs.Close();
            gs = null;
        }
Example #2
0
 public PixelShader getFFPS(FixedFuncShaders.eFixedFuncShaderIndex id)
 {
     return(mFFS.getPixelShader(id));
 }
Example #3
0
 public VertexShader getFFVS(FixedFuncShaders.eFixedFuncShaderIndex id)
 {
     return(mFFS.getVertexShader(id));
 }