コード例 #1
0
ファイル: SdlBuffer.cs プロジェクト: MananAdhvaryu/GWS
        public unsafe SdlBuffer(int *data, int w, int h, bool makeCopy = false) : this()
        {
            if (makeCopy)
            {
                Handle = SdlFactory.CreateSurface(w, h);
            }
            else
            {
                Handle = SdlFactory.CreateSurface((IntPtr)data, w, h, Factory.PixelFormat);
            }


            surface = Handle.ToStruct <SurfaceInfo>();

            if (makeCopy)
            {
                Implementation.CopyMemory(data, 0, (int *)surface.Pixels, 0, w * h);
            }
        }
コード例 #2
0
ファイル: SdlBuffer.cs プロジェクト: MananAdhvaryu/GWS
 public unsafe SdlBuffer(int w, int h) : this()
 {
     Handle  = SdlFactory.CreateSurface(w, h);
     surface = Handle.ToStruct <SurfaceInfo>();
 }