public VideoTexture(Stream s)
        {
            Avi = new AviLib.AviFile(s);
            try
            {
                XviD = new XviD.XviD(Avi.Width, Avi.Height);
            }
            catch (Exception e)
            {
                Cheetah.Console.WriteLine("xvid doesnt work");
                XviD = null;
                return;
            }



            Frame = new byte[Avi.MaxFrameSize];
            int l = Avi.ReadFrame(Frame);

            ActiveSurface   = new byte[Avi.Width * Avi.Height * 3];
            DecodingSurface = new byte[Avi.Width * Avi.Height * 3];

            XviD.Decode(Frame, l, ActiveSurface);
            Id           = Root.Instance.UserInterface.Renderer.CreateTexture(ActiveSurface, Avi.Width, Avi.Height, false);
            DecodedFrame = LoadedFrame = 0;
            UpdateThread = new Thread(new ThreadStart(UpdateFunc));
            UpdateThread.Start();
        }
        public VideoTexture(Stream s)
        {
            Avi = new AviLib.AviFile(s);
            try
            {
                XviD = new XviD.XviD(Avi.Width, Avi.Height);
            }
            catch (Exception e)
            {
                Cheetah.Console.WriteLine("xvid doesnt work");
                XviD = null;
                return;
            }

            Frame = new byte[Avi.MaxFrameSize];
            int l = Avi.ReadFrame(Frame);

            ActiveSurface = new byte[Avi.Width * Avi.Height * 3];
            DecodingSurface = new byte[Avi.Width * Avi.Height * 3];

            XviD.Decode(Frame, l, ActiveSurface);
            Id = Root.Instance.UserInterface.Renderer.CreateTexture(ActiveSurface, Avi.Width, Avi.Height, false);
            DecodedFrame = LoadedFrame = 0;
            UpdateThread = new Thread(new ThreadStart(UpdateFunc));
            UpdateThread.Start();
        }