示例#1
0
        public RenderTarget(int width, int height)
            : base(width, height)
        {
            if (ImageHandle == IntPtr.Zero)
            {
                var msg = $"Failed to create texture handle: {SDL2.SDL_GetError()}";
                Log.Error(msg);
                throw new Exception(msg);
            }

            TargetHandle = SDL_gpu.GPU_LoadTarget(ImageHandle);

            if (TargetHandle == IntPtr.Zero)
            {
                var msg = $"Failed to create render target handle: {SDL2.SDL_GetError()}";

                Log.Error(msg);
                throw new Exception(msg);
            }
        }
示例#2
0
 public RenderTarget(int width, int height)
     : base(width, height)
 {
     TargetHandle = SDL_gpu.GPU_LoadTarget(ImageHandle);
 }