public unsafe void RenderPresent() { fixed(ushort *surface = &_framebuffer[0]) { var res = ArvidClient.arvid_client_blit_buffer( surface, Width, Height, Width ); if (res != 0) { throw new Exception("Error blitting to arvid"); } } }
public void RenderPresent() { SDL.SDL_RenderPresent(_sdlRenderer); try { SDL.SDL_LockSurface(_sdlSurface); unsafe { fixed(ushort *tempDestPtr = &_tempDestination[0]) { var surface = (SDL.SDL_Surface *)_sdlSurface.ToPointer(); for (var i = 0; i < Height; i++) { Buffer.MemoryCopy( (ushort *)(surface->pixels + i * surface->pitch), tempDestPtr + i * Width, Width * 2, Width * 2 ); } var res = ArvidClient.arvid_client_blit_buffer( tempDestPtr, Width, Height, Width ); if (res != 0) { throw new Exception("Error blitting to arvid"); } } } } finally { SDL.SDL_UnlockSurface(_sdlSurface); } }