Пример #1
0
 void StreamRoutine()
 {
     try
     {
         System.Diagnostics.Debug.WriteLine("StreamRoutine");
         using (var byteStreamer = new ByteStreamer(
                    LaunchOpts.StreamWidth,
                    LaunchOpts.StreamHeight))
             using (var pptView = new PptView(
                        LaunchOpts.RootPath,
                        LaunchOpts.SlideShowPath,
                        LaunchOpts.StartSlide))
             {
                 System.Diagnostics.Debug.WriteLine("Loop");
                 while (!Quit)
                 {
                     int width = 0, height = 0;
                     if (pptView.Render(ref SlidePixels, ref width, ref height) &&
                         byteStreamer.NeedData)
                     {
                         byteStreamer.PushBuffer(SlidePixels);
                     }
                     System.Diagnostics.Debug.WriteLine("Render");
                     Thread.Sleep(StreamDelay);
                 }
             }
     }
     catch (Exception)
     {
         System.Diagnostics.Debug.WriteLine("done");
         Quit = true;
         return;
     }
 }
Пример #2
0
    void Start()
    {
        string root = Path.Combine(Application.streamingAssetsPath, "pptview");
        string path = Path.Combine(root, "test.pptx");

        pptView = new PptView(root, path);

        pptTexture         = new Texture2D(Screen.width, Screen.height, TextureFormat.ARGB32, false);
        pptTexHost.texture = pptTexture;

        if (!Application.runInBackground)
        {
            Application.runInBackground = true;
        }
    }