当前位置: 首页>>代码示例>>C#>>正文


C# PrimitiveType类代码示例

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


PrimitiveType类属于命名空间,在下文中一共展示了PrimitiveType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Mesh

 public Mesh(int vbo, int ibo, int count, PrimitiveType mode)
 {
     VboId = vbo;
     IboId = ibo;
     Count = count;
     Mode = mode;
 }
开发者ID:ryanreigstad,项目名称:engine,代码行数:7,代码来源:Mesh.cs

示例2: VertexBufferObject

 /// <summary>
 /// Initializes a new <see cref="VertexBufferObject"/>
 /// </summary>
 /// <param name="vertexBufferLength">The lenght of the vertex buffer</param>
 /// <param name="elementBufferLength">The lenght of the element buffer</param>
 /// <param name="primitiveType">The <see cref="OpenTK.Graphics.OpenGL.PrimitiveType"/> used to render the <see cref="VertexBufferObject"/></param>
 public VertexBufferObject(int vertexBufferLength, int elementBufferLength, PrimitiveType primitiveType)
 {
     this.VertexBufferLength = vertexBufferLength;
     this.ElementBufferLength = elementBufferLength;
     this.PrimitiveType = primitiveType;
     this.Initialize();
 }
开发者ID:yonglehou,项目名称:Photon,代码行数:13,代码来源:VertexBufferObject.cs

示例3: AddVertex

        public void AddVertex( Vector2 vertex, Color color, PrimitiveType primitiveType )
        {
            if ( !_hasBegun )
                throw new InvalidOperationException( "Begin must be called before AddVertex can be called." );

            if ( primitiveType == PrimitiveType.LineStrip || primitiveType == PrimitiveType.TriangleStrip )
                throw new NotSupportedException( "The specified primitiveType is not supported by PrimitiveBatch." );

            if ( primitiveType == PrimitiveType.TriangleList ) {
                if ( _triangleVertsCount >= _triangleVertices.Length )
                    FlushTriangles();

                _triangleVertices[ _triangleVertsCount ].Position = new Vector3( vertex, -0.1f );
                _triangleVertices[ _triangleVertsCount ].Color = color;
                _triangleVertsCount++;
            }

            if ( primitiveType == PrimitiveType.LineList ) {
                if ( _lineVertsCount >= _lineVertices.Length )
                    FlushLines();

                _lineVertices[ _lineVertsCount ].Position = new Vector3( vertex, 0f );
                _lineVertices[ _lineVertsCount ].Color = color;
                _lineVertsCount++;
            }
        }
开发者ID:headdetect,项目名称:Flux-XNA,代码行数:26,代码来源:PrimitiveBatch.cs

示例4: Draw

        public void Draw(IndexBuffer ibo, PrimitiveType primitiveType)
        {
            ibo.Draw();

            bool bWireframe = (SceneManager.Current.RenderMode == SceneManager.RenderMeshMode.Wireframe);

            GL.BindBuffer(BufferTarget.ArrayBuffer, vbo);

            GL.EnableClientState(ArrayCap.VertexArray);
            GL.EnableClientState(ArrayCap.NormalArray);
            GL.EnableClientState(ArrayCap.TextureCoordArray);
            if (!bWireframe) { GL.EnableClientState(ArrayCap.ColorArray); }

            GL.VertexPointer(3, VertexPointerType.Float, Vertex.Stride, new IntPtr(0));
            GL.NormalPointer(NormalPointerType.Float, Vertex.Stride, new IntPtr(Vector3.SizeInBytes));
            GL.TexCoordPointer(2, TexCoordPointerType.Float, Vertex.Stride, new IntPtr(2 * Vector3.SizeInBytes));
            if (!bWireframe) { GL.ColorPointer(4, ColorPointerType.Float, Vertex.Stride, new IntPtr((2 * Vector3.SizeInBytes) + Vector4.SizeInBytes)); }

            GL.DrawElements(primitiveType, ibo.Length, DrawElementsType.UnsignedInt, IntPtr.Zero);

            GL.DisableClientState(ArrayCap.VertexArray);
            GL.DisableClientState(ArrayCap.NormalArray);
            GL.DisableClientState(ArrayCap.TextureCoordArray);
            if (!bWireframe) { GL.DisableClientState(ArrayCap.ColorArray);}

            GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
        }
开发者ID:DevilboxGames,项目名称:Flummery,代码行数:27,代码来源:VertexBuffer.cs

示例5: CreateConstant

 public Constant CreateConstant(ImmediateOperand imm, PrimitiveType dataWidth)
 {
     if (dataWidth.BitSize > imm.Width.BitSize)
         return Constant.Create(dataWidth, imm.Value.ToInt64());
     else
         return Constant.Create(imm.Width, imm.Value.ToUInt32());
 }
开发者ID:killbug2004,项目名称:reko,代码行数:7,代码来源:OperandRewriter.cs

示例6: InsertBinaryOperationMethod

        private static void InsertBinaryOperationMethod(Core core, CodeBlockNode root, Operator op, PrimitiveType r, PrimitiveType op1, PrimitiveType op2, int retRank = 0, int op1rank = 0, int op2rank = 0)
        {
            FunctionDefinitionNode funcDefNode = new FunctionDefinitionNode();
            funcDefNode.access = CompilerDefinitions.AccessModifier.kPublic;
            funcDefNode.IsAssocOperator = true;
            funcDefNode.IsBuiltIn = true;
            funcDefNode.Name = Op.GetOpFunction(op);
            funcDefNode.ReturnType = new Type() { Name = core.TypeSystem.GetType((int)r), UID = (int)r, rank = retRank };
            ArgumentSignatureNode args = new ArgumentSignatureNode();
            args.AddArgument(new VarDeclNode()
            {
                Access = CompilerDefinitions.AccessModifier.kPublic,
                NameNode = AstFactory.BuildIdentifier(DSASM.Constants.kLHS),
                ArgumentType = new Type { Name = core.TypeSystem.GetType((int)op1), UID = (int)op1, rank = op1rank }
            });
            args.AddArgument(new VarDeclNode()
            {
                Access = CompilerDefinitions.AccessModifier.kPublic,
                NameNode = AstFactory.BuildIdentifier(DSASM.Constants.kRHS),
                ArgumentType = new Type { Name = core.TypeSystem.GetType((int)op2), UID = (int)op2, rank = op2rank }
            });
            funcDefNode.Signature = args;

            CodeBlockNode body = new CodeBlockNode();

            var lhs = AstFactory.BuildIdentifier(DSASM.Constants.kLHS);
            var rhs = AstFactory.BuildIdentifier(DSASM.Constants.kRHS);
            var binaryExpr = AstFactory.BuildBinaryExpression(lhs, rhs, op);
            body.Body.Add(AstFactory.BuildReturnStatement(binaryExpr));

            funcDefNode.FunctionBody = body;
            root.Body.Add(funcDefNode);
        }
开发者ID:nmeek,项目名称:Dynamo,代码行数:33,代码来源:CoreUtils.cs

示例7: ConvertPrimitiveType

 public static PrimitiveTopology ConvertPrimitiveType(PrimitiveType primitiveType)
 {
     switch (primitiveType)
     {
         case PrimitiveType.PointList:
             return PrimitiveTopology.PointList;
         case PrimitiveType.LineList:
             return PrimitiveTopology.LineList;
         case PrimitiveType.LineStrip:
             return PrimitiveTopology.LineStrip;
         case PrimitiveType.TriangleList:
             return PrimitiveTopology.TriangleList;
         case PrimitiveType.TriangleStrip:
             return PrimitiveTopology.TriangleStrip;
         case PrimitiveType.LineListWithAdjacency:
             return PrimitiveTopology.LineListWithAdjacency;
         case PrimitiveType.LineStripWithAdjacency:
             return PrimitiveTopology.LineStripWithAdjacency;
         case PrimitiveType.TriangleListWithAdjacency:
             return PrimitiveTopology.TriangleListWithAdjacency;
         case PrimitiveType.TriangleStripWithAdjacency:
             return PrimitiveTopology.TriangleStripWithAdjacency;
         default:
             throw new ArgumentOutOfRangeException(nameof(primitiveType));
     }
 }
开发者ID:Kryptos-FR,项目名称:xenko-reloaded,代码行数:26,代码来源:VulkanConvertExtensions.cs

示例8: RewriteAcbi

        private void RewriteAcbi(PrimitiveType width)
        {
            var limit = RewriteSrcOp(0, width);
            var add = RewriteSrcOp(1, width);
            var index = RewriteDstOp(2, width, e => emitter.IAdd(e, add));
            NZV(index);
            var cAdd = add as Constant;
            if (cAdd == null)
                throw new AddressCorrelatedException(
                    dasm.Current.Address,
                    "Instruction {0] too complex to rewrite.",
                    dasm.Current);
            if (cAdd.ToInt32() >= 0)
            {
                emitter.Branch(
                          emitter.Le(index, limit),
                          ((AddressOperand)dasm.Current.Operands[3]).Address,
                          RtlClass.ConditionalTransfer);
            }
            else
            {
                emitter.Branch(
                    emitter.Ge(index, limit),
                    ((AddressOperand)dasm.Current.Operands[3]).Address,
                    RtlClass.ConditionalTransfer);
            }
            rtlc.Class = RtlClass.ConditionalTransfer;

        }
开发者ID:relaxar,项目名称:reko,代码行数:29,代码来源:VaxRewriter.Control.cs

示例9: DrawMeshArraysSUN

		public static void DrawMeshArraysSUN(PrimitiveType mode, Int32 first, Int32 count, Int32 width)
		{
			Debug.Assert(Delegates.pglDrawMeshArraysSUN != null, "pglDrawMeshArraysSUN not implemented");
			Delegates.pglDrawMeshArraysSUN((Int32)mode, first, count, width);
			LogFunction("glDrawMeshArraysSUN({0}, {1}, {2}, {3})", mode, first, count, width);
			DebugCheckErrors(null);
		}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:7,代码来源:Gl.SUN_mesh_array.cs

示例10: Draw

 public void Draw(PrimitiveType mode, IElementArray elements)
 {
     using (elements.Bind())
     {
         _gl.DrawElements(mode, (int)elements.Elements, (uint)elements.Type, IntPtr.Zero);
     }
 }
开发者ID:GeirGrusom,项目名称:ModGL,代码行数:7,代码来源:Renderer.cs

示例11: OperandRewriter

 public OperandRewriter(M68kArchitecture arch, RtlEmitter emitter, Frame frame, PrimitiveType dataWidth)
 {
     this.arch = arch;
     this.m = emitter;
     this.frame = frame;
     this.DataWidth = dataWidth;
 }
开发者ID:nemerle,项目名称:reko,代码行数:7,代码来源:OperandRewriter.cs

示例12: RewriteFpu3

 private void RewriteFpu3(PrimitiveType width, Func<Expression, Expression, Expression> fn, Action<Expression> genFlags)
 {
     var op1 = RewriteSrcOp(0, width);
     var op2 = RewriteSrcOp(1, width);
     var dst = RewriteDstOp(2, width, e => fn(op2, op1));
     genFlags(dst);
 }
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:VaxRewriter.Fpu.cs

示例13: CreateInstancedRequest

 public IRenderRequest CreateInstancedRequest(IRenderContext renderContext, RasterizerState rasterizerState,
     BlendState blendState, DepthStencilState depthStencilState, IEffect effect, IEffectParameterSet effectParameterSet,
     VertexBuffer meshVertexBuffer, IndexBuffer meshIndexBuffer, PrimitiveType primitiveType,
     Matrix[] instanceWorldTransforms, Action<List<Matrix>, VertexBuffer, IndexBuffer> computeCombinedBuffers)
 {
     throw new NotImplementedException();
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:7,代码来源:NullRenderBatcher.cs

示例14: RrdPrimitive

    public RrdPrimitive(RrdUpdater updater, PrimitiveType type, int count, bool isConstant)
   {
		backend = updater.getRrdBackend();
		byteCount = RRD_PRIM_SIZES[(int)type] * count;
		pointer = updater.getRrdAllocator().allocate(byteCount);
		cachingAllowed = isConstant || backend.isCachingAllowed();
	}
开发者ID:mujing,项目名称:rrd4net,代码行数:7,代码来源:RrdPrimitive.cs

示例15: Element

			/// <summary>
			/// Specify which elements shall be drawn by indexing them, specifying an offset and the number of elements.
			/// </summary>
			/// <param name="vao">
			/// The <see cref="VertexArrayObject"/> to which this element belongs to.
			/// </param>
			/// <param name="mode">
			/// A <see cref="PrimitiveType"/> that indicates how elements are interpreted.
			/// </param>
			protected Element(VertexArrayObject vao, PrimitiveType mode)
			{
				if (vao == null)
					throw new ArgumentNullException("vao");
				_VertexArrayObject = vao;
				ElementsMode = mode;
			}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:16,代码来源:VertexArrayObject.Elements.cs


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