Ejemplo n.º 1
0
 public void DrawItem(Texture targetTexture, bool clear)
 {
     try
     {
         lock (_syncObj)
         {
             using (new TemporaryRenderTarget(targetTexture))
             {
                 if (clear)
                 {
                     SkinContext.Device.Clear(ClearFlags.Target, ColorConverter.FromArgb(0, Color.Black), 1.0f, 0);
                 }
                 var surfaceDesc     = targetTexture.GetLevelDescription(0);
                 int xOffsetInPixels = 0; // TODO?
                 MpcSubtitles.Render(0, 0, surfaceDesc.Width, surfaceDesc.Height, xOffsetInPixels);
             }
         }
         if (_onTextureInvalidated != null)
         {
             _onTextureInvalidated();
         }
     }
     catch (Exception ex)
     {
         ServiceRegistration.Get <ILogger>().Error("MpcSubs: Error rendering subtitle onto video frame", ex);
     }
 }
Ejemplo n.º 2
0
 public void Dispose()
 {
     MpcSubtitles.FreeSubtitles();
 }