本文整理汇总了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;
}
示例2: Mesh
public Mesh(VertexBuffer vertexBuffer, IndexBuffer indexBuffer,
BeginMode mode = BeginMode.Triangles)
{
_vertexBuffer = vertexBuffer;
_indexBuffer = indexBuffer;
_renderingMode = mode;
}
示例3: Mesh3D
//public Mesh3D(BeginMode mode)
// :this(null, mode)
//{
//}
public Mesh3D(GraphicsInterface gi, BeginMode mode)
{
GI = gi;
fDrawingPrimitive = mode;
fUseVertices = true;
fUseIndices = true;
}
示例4: DrawableShape
public DrawableShape( )
{
PrimitiveMode = BeginMode.Triangles;
VertexArray = null;
IndexArray = null;
}
示例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);
}
示例6: Draw
public void Draw(BeginMode beginMode)
{
Activate();
{
GL.DrawArrays(beginMode, 0, size);
}
Deactivate();
}
示例7: VertexArray
public VertexArray(float[] Verts, float[] Colors, float[] Texcoords, int Num, BeginMode Mode)
{
_verts = Verts;
_colors = Colors;
_texcoords = Texcoords;
_num = Num;
_mode = Mode;
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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());
}
示例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);
}
示例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;
}
示例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");
}
}