BizHawk/BizHawk.Client.Common/BitmapBufferVideoProvider.cs

49 lines
854 B
C#

using System;
using BizHawk.Emulation.Common;
using BizHawk.Bizware.BizwareGL;
namespace BizHawk.Client.Common
{
public class BitmapBufferVideoProvider : IVideoProvider, IDisposable
{
private BitmapBuffer _bb;
public BitmapBufferVideoProvider(BitmapBuffer bb)
{
_bb = bb;
}
public void Dispose()
{
_bb?.Dispose();
_bb = null;
}
public int[] GetVideoBuffer()
{
return _bb.Pixels;
}
public int VirtualWidth => _bb.Width;
public int VirtualHeight => _bb.Height;
public int BufferWidth => _bb.Width;
public int BufferHeight => _bb.Height;
public int BackgroundColor => 0;
public int VsyncNumerator
{
get { throw new InvalidOperationException(); }
}
public int VsyncDenominator
{
get { throw new InvalidOperationException(); }
}
}
}