/// <summary> /// Issues starting of rendering to the destination framebuffer of the view associated with index. /// </summary> /// <param name="context">Represent an LGL context.</param> /// <param name="index">The index of the view to be rendered.</param> /// <param name="matrix">Pointer to 16 consecutive double values, which are set by the function as the elements of a 4x4 column-major matrix.</param> /// <returns></returns> public static bool StartRender(LGLContext context, uint index, [In] double[] matrix) { unsafe { fixed(double *matrix_ptr = matrix) { return(lglStartRender(context, index, matrix_ptr)); } } }
/// <summary> /// Issues starting of rendering to the destination framebuffer of the view associated with index. /// </summary> /// <param name="context">Represent an LGL context.</param> /// <param name="index">The index of the view to be rendered.</param> /// <param name="matrix">Pointer to 16 consecutive double values, which are set by the function as the elements of a 4x4 column-major matrix.</param> /// <returns></returns> public static bool StartRender <T>(LGLContext context, uint index, [In] T matrix) where T : struct { GCHandle matrix_ptr = GCHandle.Alloc(matrix, GCHandleType.Pinned); try { return(lglStartRender(context, index, matrix_ptr.AddrOfPinnedObject())); } finally { matrix_ptr.Free(); } }
private static extern void lglGetRenderSize(LGLContext context, uint index, [Out] out uint width, [Out] out uint height);
private static extern void lglGetProjection(LGLContext context, uint index, out LGLProjection proj);
private static extern void lglFinishRender(LGLContext context);
private static unsafe extern bool lglStartRender(LGLContext context, uint index, [In] IntPtr matrix);
private static extern uint lglGetRenderCount(LGLContext context);
private static extern void lglDeleteContext(LGLContext context);
/// <summary> /// Issues starting of rendering to the destination framebuffer of the view associated with index. /// </summary> /// <param name="context">Represent an LGL context.</param> /// <param name="index">The index of the view to be rendered.</param> /// <param name="matrix">Pointer to 16 consecutive double values, which are set by the function as the elements of a 4x4 column-major matrix.</param> /// <returns></returns> public static unsafe bool StartRender(LGLContext context, uint index, [In] IntPtr matrix) { return(lglStartRender(context, index, matrix)); }
/// <summary> /// Returns the near and far clipping distances. /// </summary> /// <param name="context">Represent an LGL context.</param> /// <param name="neard">Near clipping distance.</param> /// <param name="fard">Far clipping distance.</param> public static void GetClippingPlane(LGLContext context, [Out] out double neard, [Out] out double fard) { lglGetClippingPlane(context, out neard, out fard); }
/// <summary> /// Sets the near and far clipping distances. /// </summary> /// <param name="context">Represent an LGL context.</param> /// <param name="neard">Near clipping distance.</param> /// <param name="fard">Far clipping distance.</param> public static void SetClippingPlane(LGLContext context, [In] double neard, [In] double fard) { lglSetClippingPlane(context, neard, fard); }
/// <summary> /// Returns the dimensions of the framebuffer associated with index. /// </summary> /// <param name="context">Represent an LGL context.</param> /// <param name="index">The index of the view.</param> /// <param name="width"></param> /// <param name="height"></param> public static void GetRenderSize(LGLContext context, uint index, [Out] out uint width, [Out] out uint height) { lglGetRenderSize(context, index, out width, out height); }
/// <summary> /// Returns the projection parameters for a given view. /// </summary> /// <param name="context">Represent an LGL context.</param> /// <param name="index">The index of the view.</param> /// <param name="proj">Pointer to an LGLProjection structure that will be filled by the function.</param> public static void GetProjection(LGLContext context, uint index, out LGLProjection proj) { lglGetProjection(context, index, out proj); }
/// <summary> /// Creates the proper output that to be derived from all rendered views. /// <para>This will refresh the contents of the default framebuffers associated with the LGLContext, that is it calls SwapBuffers() for each device.</para> /// <para>Therefore, you shouldn't call SwapBuffers() at any time.</para> /// </summary> /// <param name="context">Represent an LGL context.</param> public static void FinishRender(LGLContext context) { lglFinishRender(context); }
private static extern void lglSetClippingPlane(LGLContext context, [In] double neard, [In] double fard);
/// <summary> /// Destroys an LGL Context. /// </summary> /// <param name="context">LGL Context</param> public static void DeleteContext(LGLContext context) { lglDeleteContext(context); }
private static extern void lglGetClippingPlane(LGLContext context, [Out] out double neard, [Out] out double fard);
/// <summary> /// Returns the number of views to render. /// </summary> /// <param name="context">Represent an LGL context.</param> /// <returns>Number of views to render.</returns> public static uint GetRenderCount(LGLContext context) { return(lglGetRenderCount(context)); }