本文整理汇总了C#中BizHawk.Bizware.BizwareGL.BitmapBuffer.YFlip方法的典型用法代码示例。如果您正苦于以下问题:C# BitmapBuffer.YFlip方法的具体用法?C# BitmapBuffer.YFlip怎么用?C# BitmapBuffer.YFlip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BizHawk.Bizware.BizwareGL.BitmapBuffer
的用法示例。
在下文中一共展示了BitmapBuffer.YFlip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResolveTexture2d
public unsafe BitmapBuffer ResolveTexture2d(Texture2d tex)
{
//TODO - lazy create and cache resolving target in RT
var target = new d3d9.Texture(dev, tex.IntWidth, tex.IntHeight, 1, d3d9.Usage.None, d3d9.Format.A8R8G8B8, d3d9.Pool.SystemMemory);
var tw = tex.Opaque as TextureWrapper;
dev.GetRenderTargetData(tw.Texture.GetSurfaceLevel(0), target.GetSurfaceLevel(0));
var dr = target.LockRectangle(0, LockFlags.ReadOnly);
if (dr.Pitch != tex.IntWidth * 4) throw new InvalidOperationException();
int[] pixels = new int[tex.IntWidth * tex.IntHeight];
dr.Data.ReadRange(pixels, 0, tex.IntWidth * tex.IntHeight);
var bb = new BitmapBuffer(tex.IntWidth, tex.IntHeight, pixels);
target.UnlockRectangle(0);
target.Dispose(); //buffer churn warning
//TEMPORARY until flipping is sorted out
bb.YFlip();
return bb;
}