Beispiel #1
0
        private static void render_buffer(ScreenBuffer source_buffer, ScreenBuffer target_buffer, EffectInstance effect)
        {
            var img = source_buffer.render_image as SFML.Graphics.RenderImage;
            if (img != null)
            {
                SFML.Graphics.Sprite sfml_spr = new SFML.Graphics.Sprite(img.Image);

                //sfml_spr.FlipY(true); 
                sfml_spr.Scale = new Vector2f((float)screen_w / source_buffer.w, (float)screen_h / source_buffer.h);

                

                effect.prepare();
                var so = effect.shader.sfml_shader_object;
                if (so == null) target_buffer.render_image.Draw(sfml_spr);
                else            target_buffer.render_image.Draw(sfml_spr, so);
            }
        }
Beispiel #2
0
 //////////////////////////////////////////////////////////////////////////////////////////////////////
 public static Directive add_directive(Directives which_directive, ScreenBuffer target_buffer = null, List<Layer> layers = null, ScreenBuffer source_buffer = null, EffectInstance shader = null, uint color = 0xff000000)
 {
     Directive D = new Directive(which_directive, source_buffer, target_buffer, layers, shader, color);
     program.Add(D);
     return D;
 }
 public EffectInstance(EffectInstance copy)
 {
     shader = copy.shader;
     parameters = new List<shader_param>(copy.parameters);
 }
Beispiel #4
0
 public Directive(Directives wat, ScreenBuffer source, ScreenBuffer target, List<Layer> layers, EffectInstance effect = null, uint color = 0xff000000)
 {
     this.do_what        = wat;
     this.source_buffer  = source;
     this.target_buffer  = target;
     this.layers         = layers;
     this.color          = color;
     this.effect         = effect;
     if (this.effect == null) this.effect = EffectInstance.empty;
 }