public CVReturn DisplayLinkOutputCallback(CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { // There is no autorelease pool when this method is called because it will be called from a background thread // It's important to create one or you will leak objects // ReSharper disable once UnusedVariable using (var pool = new NSAutoreleasePool()) { Device.BeginInvokeOnMainThread(() => SendSignals()); } return(CVReturn.Success); }
// Private Callback function for CVDisplayLink private CVReturn MyDisplayLinkOutputCallback (CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { //CVReturn result = GetFrameForTime (inOutputTime); CVReturn result = CVReturn.Error; // There is no autorelease pool when this method is called because it will be called from a background thread // It's important to create one or you will leak objects using (NSAutoreleasePool pool = new NSAutoreleasePool ()) { // Update the animation BeginInvokeOnMainThread (RenderScene); result = CVReturn.Success; } return result; }
public CVReturn Unlock(CVOptionFlags unlockFlags) { return CVPixelBufferUnlockBaseAddress (handle, unlockFlags); }
public CVReturn MyDisplayLinkOutputCallback (CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { CVReturn result = GetFrameForTime (inOutputTime); return result; }
extern static CVReturn CVPixelBufferUnlockBaseAddress(IntPtr pixelBuffer, CVOptionFlags unlockFlags);
public void Flush(CVOptionFlags flags) { CVMetalTextureCacheFlush(handle, flags); }
static CVReturn OutputCallback(IntPtr displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut, IntPtr displayLinkContext) { GCHandle callbackHandle = GCHandle.FromIntPtr(displayLinkContext); DisplayLinkOutputCallback func = (DisplayLinkOutputCallback)callbackHandle.Target !; CVDisplayLink delegateDisplayLink = new CVDisplayLink(displayLink, false); return(func(delegateDisplayLink, ref inNow, ref inOutputTime, flagsIn, ref flagsOut)); }
public CVReturn Unlock (CVOptionFlags unlockFlags) { return CVPixelBufferUnlockBaseAddress (Handle, (CVPixelBufferLock) unlockFlags); }
public static CVReturn RequestDraw(CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { NSApplication.SharedApplication.BeginInvokeOnMainThread(() => RequestDraw()); return(CVReturn.Success); }
private static CVReturn MyDisplayLinkCallback(IntPtr displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut, IntPtr context) { //Console.WriteLine("MyDisplayLinkCallback " + inOutputTime.videoTime); MyOpenGLView view = ObjectiveCRuntime.GetInstance<MyOpenGLView> (context); return view.GetFrameForTime (ref inOutputTime); }
private CVReturn HandleDisplayLinkOutputCallback(CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { try { if (_paused) { return(CVReturn.Success); } if (GraphicsDevice != null) { if (_resized) { _resized = false; MainSwapchain.Resize(_width, _height); Resized?.Invoke(); } Rendering?.Invoke(); } } catch (Exception e) { Debug.WriteLine("Encountered an error while rendering: " + e); throw; } return(CVReturn.Success); }
public void Flush(CVOptionFlags flags) { CVMetalTextureCacheFlush (handle, flags); }
static extern void CVMetalTextureCacheFlush( /* CVMetalTextureCacheRef __nonnull */ IntPtr textureCache, CVOptionFlags flags);
// Private Callback function for CVDisplayLink static CVReturn DisplayLinkOutputCallback(IntPtr displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut, IntPtr displayLinkContext) { //CVReturn result = GetFrameForTime (inOutputTime); CVReturn result = CVReturn.Success; using (new NSAutoreleasePool()) { try { foreach (var view in _views) { view.Value.Draw(); } } catch (Exception e) { Console.Error.WriteLine(e); result = CVReturn.Error; } } return(result); }
public void Flush (CVOptionFlags flags) { CVOpenGLESTextureCacheFlush (handle, flags); }
public void Flush(CVOptionFlags flags) { CVOpenGLESTextureCacheFlush(handle, flags); }
public CVReturn DisplayLinkOutputCallback(CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { Fire?.Invoke(); return(CVReturn.Success); }
// Private Callback function for CVDisplayLink private CVReturn MyDisplayLinkOutputCallback(CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { //CVReturn result = GetFrameForTime (inOutputTime); CVReturn result = CVReturn.Error; // There is no autorelease pool when this method is called because it will be called from a background thread // It's important to create one or you will leak objects using (NSAutoreleasePool pool = new NSAutoreleasePool()) { // Update the animation RenderScene(); result = CVReturn.Success; } return(result); }
CVReturn DisplayLinkOutputCallback(CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { Game.Instance.BeginInvokeOnMainThread(() => Game.Instance.EmitTick()); return(CVReturn.Success); }
extern static void CVMetalTextureCacheFlush( /* CVMetalTextureCacheRef __nonnull */ IntPtr textureCache, CVOptionFlags flags);
private CVReturn HandleDisplayLinkOutputCallback(CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { if (_newRenderSize != null) { Callback.OnResize(Widget, new ResizeEventArgs(_newRenderSize.Value)); _newRenderSize = null; } Callback.OnDraw(Widget, EventArgs.Empty); return(CVReturn.Success); }
public CVReturn Lock(CVOptionFlags lockFlags) { return(CVPixelBufferLockBaseAddress(handle, lockFlags)); }
static CVReturn OutputCallback (IntPtr displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut, IntPtr displayLinkContext) { GCHandle callbackHandle = GCHandle.FromIntPtr (displayLinkContext); DisplayLinkOutputCallback func = (DisplayLinkOutputCallback) callbackHandle.Target; CVDisplayLink delegateDisplayLink = new CVDisplayLink(displayLink, false); return func (delegateDisplayLink, ref inNow, ref inOutputTime, flagsIn, ref flagsOut); }
public CVReturn Unlock(CVOptionFlags unlockFlags) { return(CVPixelBufferUnlockBaseAddress(handle, unlockFlags)); }
CVReturn DisplayLinkOutputCallback (CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { Game.Instance.BeginInvokeOnMainThread ( () => Game.Instance.EmitTick () ); return CVReturn.Success; }
public CVReturn Lock(CVOptionFlags lockFlags) { return CVPixelBufferLockBaseAddress (handle, lockFlags); }
public CVReturn MyDisplayLinkOutputCallback(CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { CVTimeStamp time = inOutputTime; this.InvokeOnMainThread( () => {GetFrameForTime (time);} ); return CVReturn.Success; }
static extern CVReturn CVPixelBufferUnlockBaseAddress(IntPtr pixelBuffer, CVOptionFlags unlockFlags);
extern static CVReturn CVPixelBufferLockBaseAddress (IntPtr pixelBuffer, CVOptionFlags lockFlags);
public CVReturn MyDisplayLinkOutputCallback(CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut) { CVReturn result = GetFrameForTime(inOutputTime); return(result); }
extern static void CVOpenGLESTextureCacheFlush ( /* CVOpenGLESTextureCacheRef __nonnull */ IntPtr textureCache, CVOptionFlags flags);