Esempio n. 1
0
 public void Start()
 {
     _previousShader       = getActiveShader();
     _taskCompletionSource = new TaskCompletionSource <object> (null);
     _shakeShader          = GLShader.FromText(VERTEX_SHADER_SHAKE,
                                               _graphics.GetStandardFragmentShader(), _graphics);
     AGSGame.Game.Events.OnBeforeRender.Subscribe(onBeforeRender);
     setActiveShader(_shakeShader);
 }
Esempio n. 2
0
        public IShader FromText(string vertexSource, string fragmentSource)
        {
            vertexSource   = vertexSource ?? _graphics.GetStandardVertexShader();
            fragmentSource = fragmentSource ?? _graphics.GetStandardFragmentShader();
            NamedParameter vertexParam   = new NamedParameter(nameof(vertexSource), vertexSource);
            NamedParameter fragmentParam = new NamedParameter(nameof(fragmentSource), fragmentSource);

            return(_resolver.Container.Resolve <IShader>(vertexParam, fragmentParam));
        }