Exemplo n.º 1
0
        public GraphicsContext(GraphicsDevice Device, Box Viewport)
        {
            this.CoreNum = 6;

            this.Device     = Device;
            this.Viewport   = Viewport;
            this.FrameCount = 0;

            this.ColorBuffer = null;
            this.ZBuffer     = new float[Viewport.Width * Viewport.Height];

            this.Vertices  = new ListCore <Vertex>(this.CoreNum);
            this.Fragments = new ListCore <Fragment>(this.CoreNum);
            this.Indices   = null;

            this.ClearColor         = Colorf.Black;
            this.FillModeState      = FillMode.Solid;
            this.CullFaceModeState  = CullFaceMode.Back;
            this.FrontFaceModeState = FrontFaceMode.CCW;
            this.Shader             = null;
            this.VertexBuffer       = null;
            this.IndexBuffer        = null;
        }
Exemplo n.º 2
0
 /// <summary>
 /// This function sets what defines a front face. Counter ClockWise by default.
 /// <para>作用是控制多边形的正面是如何决定的。在默认情况下,mode是GL_CCW。</para>
 /// </summary>
 /// <param name="mode"></param>
 public FrontFaceState(FrontFaceMode mode)
 {
     this.Mode = mode;
 }
Exemplo n.º 3
0
 /// <summary>
 /// define front- and back-facing polygons
 /// </summary>
 /// <param name="mode">Specifies the orientation of front-facing polygons. GL_CW and GL_CCW are accepted. The initial value is GL_CCW.</param>
 /// <remarks>
 /// In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has the obvious benefit of speeding up the rendering of the image. To enable and disable elimination of back-facing polygons, call glEnable and glDisable with argument GL_CULL_FACE.
 /// The projection of a polygon to window coordinates is said to have clockwise winding if an imaginary object following the path from its first vertex, its second vertex, and so on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction about the interior of the polygon. The polygon's winding is said to be counterclockwise if the imaginary object following the same path moves in a counterclockwise direction about the interior of the polygon. glFrontFace specifies whether polygons with clockwise winding in window coordinates, or counterclockwise winding in window coordinates, are taken to be front-facing. Passing GL_CCW to mode selects counterclockwise polygons as front-facing; GL_CW selects clockwise polygons as front-facing. By default, counterclockwise polygons are taken to be front-facing.
 /// </remarks>
 public static void FrontFace(FrontFaceMode mode)
 {
     Delegates.glFrontFace(mode);
 }
Exemplo n.º 4
0
 public static extern void glFrontFace(FrontFaceMode mode);
Exemplo n.º 5
0
 /// <summary>
 /// This function sets what defines a front face. Counter ClockWise by default.
 /// <para>作用是控制多边形的正面是如何决定的。在默认情况下,mode是GL_CCW。</para>
 /// </summary>
 /// <param name="mode"></param>
 public FrontFaceSwitch(FrontFaceMode mode)
 {
     this.Mode = mode;
 }
Exemplo n.º 6
0
 public void SetFrontFaceMode(FrontFaceMode Mode)
 {
     Context_.FrontFaceModeState = Mode;
 }
Exemplo n.º 7
0
 /// <summary>
 /// This function sets what defines a front face. Counter ClockWise by default.
 /// <para>作用是控制多边形的正面是如何决定的。在默认情况下,mode是GL_CCW。</para>
 /// </summary>
 /// <param name="mode"></param>
 public FrontFaceState(FrontFaceMode mode)
 {
     this.Mode = mode;
 }