當前位置: 首頁>>代碼示例>>C#>>正文


C# BeginMode類代碼示例

本文整理匯總了C#中BeginMode的典型用法代碼示例。如果您正苦於以下問題:C# BeginMode類的具體用法?C# BeginMode怎麽用?C# BeginMode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BeginMode類屬於命名空間,在下文中一共展示了BeginMode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DrawableShape

 public DrawableShape( bool useDisplayList )
 {
     UseDisplayList = useDisplayList;
     PrimitiveMode = BeginMode.Triangles;
     VertexArray = null;
     IndexArray = null;
 }
開發者ID:challal,項目名稱:scallion,代碼行數:7,代碼來源:DrawableShape.cs

示例2: Mesh

 public Mesh(VertexBuffer vertexBuffer, IndexBuffer indexBuffer, 
     BeginMode mode = BeginMode.Triangles)
 {
     _vertexBuffer = vertexBuffer;
     _indexBuffer = indexBuffer;
     _renderingMode = mode;
 }
開發者ID:TekuConcept,項目名稱:Folding-Atomata,代碼行數:7,代碼來源:Mesh.cs

示例3: Mesh3D

        //public Mesh3D(BeginMode mode)
        //    :this(null, mode)
        //{
        //}

        public Mesh3D(GraphicsInterface gi, BeginMode mode)
        {
            GI = gi;
            fDrawingPrimitive = mode;
            fUseVertices = true;
            fUseIndices = true;
        }
開發者ID:Wiladams,項目名稱:NewTOAPIA,代碼行數:12,代碼來源:Mesh3D.cs

示例4: DrawableShape

 public DrawableShape(  )
 {
     
     PrimitiveMode = BeginMode.Triangles;
     VertexArray = null;
     IndexArray = null;
 }
開發者ID:meshdgp,項目名稱:MeshDGP,代碼行數:7,代碼來源:DrawableShape.cs

示例5: IndexBuffer

        public IndexBuffer(int length, BeginMode type = BeginMode.Triangles)
        {
            _acceptedAsType = type;

            //_indices.reserve(length);
            for (int j = 0; j < length; j++)
                _indices.Add((int)j);
        }
開發者ID:TekuConcept,項目名稱:Folding-Atomata,代碼行數:8,代碼來源:IndexBuffer.cs

示例6: Draw

 public void Draw(BeginMode beginMode)
 {
     Activate();
     {
         GL.DrawArrays(beginMode, 0, size);
     }
     Deactivate();
 }
開發者ID:overdrivek,項目名稱:severed-infinity,代碼行數:8,代碼來源:VBO.cs

示例7: VertexArray

 public VertexArray(float[] Verts, float[] Colors, float[] Texcoords, int Num, BeginMode Mode)
 {
     _verts = Verts;
     _colors = Colors;
     _texcoords = Texcoords;
     _num = Num;
     _mode = Mode;
 }
開發者ID:bobtwinkles,項目名稱:Defence,代碼行數:8,代碼來源:VertexArray.cs

示例8: ShaderProgram

 public ShaderProgram()
 {
     BeginMode = BeginMode.Triangles;
     _attributes = new List<AttributeInfo>();
     _textures = new Dictionary<String, TextureInfo>();
     _uniforms = new Dictionary<String, int>();
     VertexDataStride = 0;
     VertexDataSize = 0;
     _started = false;
 }
開發者ID:Metapyziks,項目名稱:ComputerGraphicsCoursework,代碼行數:10,代碼來源:ShaderProgram.cs

示例9: VBO

        public VBO(OpenGL gl, BeginMode beginMode)
        {
            Mode = beginMode;
            _gl = gl;

            var buffers = new uint[1];
            gl.GenBuffers(1, buffers);
            Handle = buffers[0];

            Count = 0;
        }
開發者ID:rho24,項目名稱:OpenCAD,代碼行數:11,代碼來源:VBO.cs

示例10: addDrawable

        public static void addDrawable(Drawable2D drawable, BeginMode begin_mode, ProgramObject program)
        {
            DrawingInfo drawing_info = new DrawingInfo();
            drawing_info.begin_mode = begin_mode;
            drawing_info.program = program;

            GL.GenVertexArrays(1, out drawing_info.VAO_ID);
            GL.GenBuffers(1, out drawing_info.VBO_ID);

            objects.Add(drawable, drawing_info);
        }
開發者ID:nicogarcia,項目名稱:cg,代碼行數:11,代碼來源:GLManager.cs

示例11: Begin

		public static void Begin(BeginMode mode)
		{
			immMode = mode;
			if(vertices == null)vertices = new List<vector3d>();
			if(colors == null)colors = new List<vector4d>();
			if(normals == null)normals = new List<vector3d>();
			if(texcoords == null)texcoords = new List<vector3d>();
			
			vertices.Clear();
			colors.Clear();
			normals.Clear();
			texcoords.Clear();
		}
開發者ID:himanshugoel2797,項目名稱:OpenTK.PSM,代碼行數:13,代碼來源:ImmediateMode.cs

示例12: Draw

        public Draw(ProgramObject program, BeginMode begin_mode)
            : base(program, begin_mode)
        {
            /*Triangle t = new Triangle(new Vertex[]{
                new Vertex(new Vector4(0, 0, 0, 1f)),
                new Vertex(new Vector4(0.5f, 0.5f, 0, 1f)),
                new Vertex(new Vector4(0.5f, 0, 0, 1f)),
            });

            triangles.Add(t);*/

            //triangles.triangulate(sweep.polynet.faces.ToArray());
        }
開發者ID:GNZ,項目名稱:CG,代碼行數:13,代碼來源:Draw.cs

示例13: RenderCube

 public static void RenderCube(Vector3 location, Vector3 size, BeginMode mode, Vector3 colorMult)
 {
     MatrixHelper.SetViewProjection(ref Forgottenvoxels.lookat, ref Forgottenvoxels.perspective);
     ShaderController.Cube.UseProgram();
     ShaderController.Cube.SetUniform("colorMult", colorMult);
     GL.Enable(EnableCap.DepthTest);
     GL.Translate(location);
     GL.Scale(size * 4);
     buffer.Render(mode);
     GL.Scale(-(size * 4));
     GL.Translate(-location);
     GL.Disable(EnableCap.DepthTest);
     GL.UseProgram(0);
 }
開發者ID:eweilow,項目名稱:Forgotten-Voxels,代碼行數:14,代碼來源:CubeRenderer.cs

示例14: GetArraysforVBO

        public void GetArraysforVBO(out BeginMode primitives, out VertexT2fN3fV3f[] vertices, out uint[] indices)
        {
            primitives = PrimitiveMode;

            vertices = new VertexT2fN3fV3f[VertexArray.Length];
            for (uint i = 0; i < VertexArray.Length; i++)
            {
                vertices[i].TexCoord = (Vector2)VertexArray[i].TexCoord;
                vertices[i].Normal = (Vector3)VertexArray[i].Normal;
                vertices[i].Position = (Vector3)VertexArray[i].Position;
            }

            indices = IndexArray;
        }
開發者ID:challal,項目名稱:scallion,代碼行數:14,代碼來源:DrawableShape.cs

示例15: BeginMode

 public static void BeginMode(PrimitiveTopology bTopology, out BeginMode mode, out int patchVertexCount)
 {
     switch (bTopology)
     {
         case PrimitiveTopology.PointList: mode = OpenTK.Graphics.OpenGL.BeginMode.Points; patchVertexCount = 0; return;
         case PrimitiveTopology.LineList: mode = OpenTK.Graphics.OpenGL.BeginMode.Lines; patchVertexCount = 0; return;
         case PrimitiveTopology.LineStrip: mode = OpenTK.Graphics.OpenGL.BeginMode.LineStrip; patchVertexCount = 0; return;
         case PrimitiveTopology.TriangleList: mode = OpenTK.Graphics.OpenGL.BeginMode.Triangles; patchVertexCount = 0; return;
         case PrimitiveTopology.TriangleStrip: mode = OpenTK.Graphics.OpenGL.BeginMode.TriangleStrip; patchVertexCount = 0; return;
         case PrimitiveTopology.LineListWithAdjacency: mode = OpenTK.Graphics.OpenGL.BeginMode.LinesAdjacency; patchVertexCount = 0; return;
         case PrimitiveTopology.LineStripWithAdjacency: mode = OpenTK.Graphics.OpenGL.BeginMode.LineStripAdjacency; patchVertexCount = 0; return;
         case PrimitiveTopology.TriangleListWithAdjacency: mode = OpenTK.Graphics.OpenGL.BeginMode.TrianglesAdjacency; patchVertexCount = 0; return;
         case PrimitiveTopology.TriangleStripWithAdjacency: mode = OpenTK.Graphics.OpenGL.BeginMode.TriangleStripAdjacency; patchVertexCount = 0; return;
         case PrimitiveTopology.PatchList1: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 1; return;
         case PrimitiveTopology.PatchList2: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 2; return;
         case PrimitiveTopology.PatchList3: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 3; return;
         case PrimitiveTopology.PatchList4: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 4; return;
         case PrimitiveTopology.PatchList5: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 5; return;
         case PrimitiveTopology.PatchList6: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 6; return;
         case PrimitiveTopology.PatchList7: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 7; return;
         case PrimitiveTopology.PatchList8: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 8; return;
         case PrimitiveTopology.PatchList9: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 9; return;
         case PrimitiveTopology.PatchList10: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 10; return;
         case PrimitiveTopology.PatchList11: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 11; return;
         case PrimitiveTopology.PatchList12: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 12; return;
         case PrimitiveTopology.PatchList13: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 13; return;
         case PrimitiveTopology.PatchList14: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 14; return;
         case PrimitiveTopology.PatchList15: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 15; return;
         case PrimitiveTopology.PatchList16: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 16; return;
         case PrimitiveTopology.PatchList17: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 17; return;
         case PrimitiveTopology.PatchList18: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 18; return;
         case PrimitiveTopology.PatchList19: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 19; return;
         case PrimitiveTopology.PatchList20: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 20; return;
         case PrimitiveTopology.PatchList21: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 21; return;
         case PrimitiveTopology.PatchList22: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 22; return;
         case PrimitiveTopology.PatchList23: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 23; return;
         case PrimitiveTopology.PatchList24: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 24; return;
         case PrimitiveTopology.PatchList25: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 25; return;
         case PrimitiveTopology.PatchList26: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 26; return;
         case PrimitiveTopology.PatchList27: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 27; return;
         case PrimitiveTopology.PatchList28: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 28; return;
         case PrimitiveTopology.PatchList29: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 29; return;
         case PrimitiveTopology.PatchList30: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 30; return;
         case PrimitiveTopology.PatchList31: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 31; return;
         case PrimitiveTopology.PatchList32: mode = OpenTK.Graphics.OpenGL.BeginMode.Patches; patchVertexCount = 32; return;
         default: throw new ArgumentOutOfRangeException("bTopology");
     }
 }
開發者ID:Zulkir,項目名稱:Beholder,代碼行數:48,代碼來源:CtObjectGL.cs


注:本文中的BeginMode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。