Esempio n. 1
0
        public override void InitOtherStuff()
        {
            OutputTexture = PrivateRendererContext.CreateTexture2D("Blur_Output_Texture_" + DateTime.Now.Ticks, PrivateRendererContext.ViewportSize.X,
                PrivateRendererContext.ViewportSize.Y, false, IntPtr.Zero, false, true);

            uShift = new FreezingArcher.Math.Vector2(1.0f / OutputTexture.Width, 1.0f / OutputTexture.Height);
        }
        public override void InitOtherStuff()
        {
            OutputTexture = PrivateRendererContext.CreateTexture2D("DistanceFog_Output_Texture_" + DateTime.Now.Ticks, PrivateRendererContext.ViewportSize.X,
                PrivateRendererContext.ViewportSize.Y, false, IntPtr.Zero, false, true);

            uShift = Math.Color4.Black;
        }
Esempio n. 3
0
        public CompositorOutputSlot(string name, int number, Texture2D output, CompositorSlotType type)
        {
            Name = name;
            SlotNumber = number;
            SlotTexture = output;
            SlotType = type;

            if ((SlotType == CompositorSlotType.Texture || SlotType == CompositorSlotType.ValueTexture) && SlotTexture == null)
                Logger.Log.AddLogEntry(LogLevel.Error, "CompositorInputSlot: " + Name, FreezingArcher.Core.Status.BadArgument);

            IsConnected = false;
        }
Esempio n. 4
0
        public bool Init(Texture2D tex)
        {
            if (tex == null || !tex.Created)
                return false;

            Scaling = new Vector2(1.0f, 1.0f);
            AbsolutePosition = new Vector2(0.0f, 0.0f);
            RelativePosition = new Vector2(0.0f, 0.0f);
            Rotation = 0;
            RotationPoint = new Vector2(0.0f, 0.0f);

            MyTexture = tex;
            MyTexture.SetUseCount(MyTexture.InternalUseCount + 1);

            return true;
        }
Esempio n. 5
0
        public EndScreen (Application application, RendererContext rc, IEnumerable<Tuple<string, GameStateTransition>> from = null)
        {
            Renderer = rc;

            Application = application;

            if (!Application.Game.AddGameState ("endscreen_state", FreezingArcher.Content.Environment.Default, from))
            {
                Logger.Log.AddLogEntry (LogLevel.Error, "EndScreen", "Could not add Endscreen-State!");
            }

            State = Application.Game.GetGameState ("endscreen_state");
            MessageProvider = State.MessageProxy;
            BackgroundTexture = null;
            ValidMessages = new int [] { (int) MessageId.GameEnded, (int) MessageId.GameEndedDied,
                (int) MessageId.WindowResize, (int) MessageId.UpdateLocale };
            MessageProvider += this;
        }
Esempio n. 6
0
 public override void InitOtherStuff ()
 {
     OutputTexture = PrivateRendererContext.CreateTexture2D("Warping_Output_Texture_" + DateTime.Now.Ticks,
         PrivateRendererContext.ViewportSize.X, PrivateRendererContext.ViewportSize.Y, false, IntPtr.Zero,
         false, true);
 }
Esempio n. 7
0
        public void AddTexture(Texture2D tex, AttachmentUsage au)
        {
            if(!m_PrepareMode)
                GL.BindFramebuffer(FramebufferTarget.Framebuffer, ID);

            DeleteTexture(au, true);

            if((tex != null) && (tex.Created))
            {
                tex.SetUseCount(tex.InternalUseCount + 1);
                m_Textures.Add(new TextureAttachment(tex, au));

                GL.FramebufferTexture2D(FramebufferTarget.Framebuffer, (FramebufferAttachment)au, TextureTarget.Texture2D, tex.ID, 0);
            }

            if(!m_PrepareMode)
                GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
        }
Esempio n. 8
0
 public void Destroy()
 {
     MyTexture.SetUseCount(MyTexture.InternalUseCount - 1);
     MyTexture = null;
 }
Esempio n. 9
0
 public Sprite()
 {
     MyTexture = null;
 }