• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# BeginMode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BeginMode的典型用法代码示例。如果您正苦于以下问题:C# BeginMode类的具体用法?C# BeginMode怎么用?C# BeginMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BeginMode类属于命名空间,在下文中一共展示了BeginMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Drawable3D

        public Drawable3D(ProgramObject program, BeginMode begin_mode)
        {
            this.begin_mode = begin_mode;
            this.program = program;

            projection_location = GL.GetUniformLocation(program.program_handle, "projectionMatrix");
            model_view_location = GL.GetUniformLocation(program.program_handle, "modelView");
            normal_location = GL.GetUniformLocation(program.program_handle, "normalMatrix");

            light_position_location = GL.GetUniformLocation(program.program_handle, "light_position");
            light_intensity_location = GL.GetUniformLocation(program.program_handle, "light_intensity");
            material_ka_location = GL.GetUniformLocation(program.program_handle, "material_ka");
            material_kd_location = GL.GetUniformLocation(program.program_handle, "material_kd");
            material_ks_location = GL.GetUniformLocation(program.program_handle, "material_ks");
            material_shine_location = GL.GetUniformLocation(program.program_handle, "material_shine");
            colored_location = GL.GetUniformLocation(program.program_handle, "colored");
        }
开发者ID:GNZ,项目名称:CG,代码行数:17,代码来源:Drawable3D.cs


示例17: VertexArrayObject

        /// <summary>
        /// Initializes a new <see cref="VertexArrayObject"/>.
        /// </summary>
        /// <param name="indexBuffer">The <see cref="IBuffer"/> containing the index data.</param>
        /// <param name="drawMode">The <see cref="BeginMode"/>.</param>
        /// <param name="indexBufferType">The type of the indices.</param>
        /// <param name="buffers">The buffers containing the actual vertex data.</param>
        public VertexArrayObject(IReadOnlyBuffer indexBuffer, BeginMode drawMode, DrawElementsType indexBufferType, params BufferDescription[] buffers)
        {
            Contract.Requires<ArgumentNullException>(buffers != null);
            Contract.Requires<ArgumentNullException>(indexBuffer != null);
            Contract.Requires<ArgumentException>(indexBuffer.Target == BufferTarget.ElementArrayBuffer);

            this.VerifyAccess();

            this.DrawMode = drawMode;
            this.IndexBuffer = indexBuffer;
            this.IndexType = indexBufferType;
            this.VertexBuffers = buffers.ToImmutableArray();

            this.Handle = GL.GenVertexArray();

            // Can't use Binding and using clause here because it causes a stack overflow (Bindable.Bind -> Initialize)
            try
            {
                GL.BindVertexArray(this);
                foreach (BufferDescription desc in this.VertexBuffers)
                {
                    if (desc.Buffer != null)
                    {
                        using (Binding vboBinding = desc.Buffer.Bind())
                        {
                            foreach (VertexAttributePointer vertexPointer in desc.VertexAttributePointers.OrderBy(vap => vap.Index))
                            {
                                vertexPointer.Enable();
                                vertexPointer.Apply();
                            }
                        }
                    }
                }
                this.IndexBuffer.Bind();
            }
            finally
            {
                GL.BindVertexArray(0);
            }
            this.IndexBuffer.Unbind();
        }
开发者ID:ScianGames,项目名称:Engine,代码行数:48,代码来源:VertexArrayObject.cs


示例18: drawRectBase

 private static void drawRectBase(BeginMode mode, float x, float y, float z, float w, float h, bool allowSmooth)
 {
     if (allowSmooth)
     {
         GL.Enable(EnableCap.LineSmooth);
     }
     else
     {
         GL.Disable(EnableCap.LineSmooth);
     }
     rectVertices[0, 0] = x;
     rectVertices[0, 1] = y;
     rectVertices[0, 2] = z;
     rectVertices[1, 0] = x + w;
     rectVertices[1, 1] = y;
     rectVertices[1, 2] = z;
     rectVertices[2, 0] = x + w;
     rectVertices[2, 1] = y + h;
     rectVertices[2, 2] = z;
     rectVertices[3, 0] = x;
     rectVertices[3, 1] = y + h;
     rectVertices[3, 2] = z;
     GL.PushMatrix();
     //开始绘制
     GL.EnableClientState(ArrayCap.VertexArray);
     GL.VertexPointer(3, VertexPointerType.Float, 0, rectVertices);
     GL.DrawArrays(mode, 0, 4);
     GL.DisableClientState(ArrayCap.VertexArray);
     GL.PopMatrix();
     if (!allowSmooth)
     {
         GL.Enable(EnableCap.LineSmooth);
     }
     else
     {
         GL.Disable(EnableCap.LineSmooth);
     }
 }
开发者ID:AndrewFanChina,项目名称:Cyclone2D-Editor,代码行数:38,代码来源:GLGraphics.cs


示例19: Begin

 public static void Begin(BeginMode mode, Action action) {
     GL.Begin(mode);
     action();
     GL.End();
 }
开发者ID:nathanial,项目名称:GLGraph.NET,代码行数:5,代码来源:OpenGL.cs


示例20: Mesh3D

 public Mesh3D(BeginMode mode)
 {
     fMode = mode;
     fUseVertices = true;
     fUseIndices = true;
 }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:6,代码来源:Mesh3D.cs



注:本文中的BeginMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Behaviac类代码示例发布时间:2022-05-24
下一篇:
C# BeginEventHandler类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap