Exemplo n.º 1
0
     public bool Use(Action <T> callback)
     {
         if (!Compile())// Compile returns false if already compiled
         {
             Gl.glUseProgram(Program);
         }
         if (Program <= 0)
         {
             return(false);
         }
         if (null != callback)
         {
             if (null == this.uniformConfig)
             {
                 this.uniformConfig = new T {
                     program = this
                 }
             }
             ;
             ActiveTextures.Clear();
             callback.Invoke(this.uniformConfig);
         }
         return(true);
     }
 }
Exemplo n.º 2
0
 public Uniform Apply(Texture texture)
 {
     //cache.textureUnit = texture.ActiveID;
     cache.i1 = ActiveTextures.Activate(texture); //texture.ActiveID;
     ApplyCache();
     Log.LogOnGlErrF("[Uniform:Apply Texture] {0}", name);
     return(this);
 }