예제 #1
0
 /// <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));
         }
     }
 }
예제 #2
0
        /// <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();
            }
        }
예제 #3
0
 private static extern void lglGetRenderSize(LGLContext context, uint index, [Out] out uint width, [Out] out uint height);
예제 #4
0
 private static extern void lglGetProjection(LGLContext context, uint index, out LGLProjection proj);
예제 #5
0
 private static extern void lglFinishRender(LGLContext context);
예제 #6
0
 private static unsafe extern bool lglStartRender(LGLContext context, uint index, [In] IntPtr matrix);
예제 #7
0
 private static extern uint lglGetRenderCount(LGLContext context);
예제 #8
0
 private static extern void lglDeleteContext(LGLContext context);
예제 #9
0
 /// <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));
 }
예제 #10
0
 /// <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);
 }
예제 #11
0
 /// <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);
 }
예제 #12
0
 /// <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);
 }
예제 #13
0
 /// <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);
 }
예제 #14
0
 /// <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);
 }
예제 #15
0
 private static extern void lglSetClippingPlane(LGLContext context, [In] double neard, [In] double fard);
예제 #16
0
 /// <summary>
 /// Destroys an LGL Context.
 /// </summary>
 /// <param name="context">LGL Context</param>
 public static void DeleteContext(LGLContext context)
 {
     lglDeleteContext(context);
 }
예제 #17
0
 private static extern void lglGetClippingPlane(LGLContext context, [Out] out double neard, [Out] out double fard);
예제 #18
0
 /// <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));
 }