26.09.2020
+ Added BoundingBoxes to Meshes + SM.Base.Objects.Mesh + Vertex Colors + ShowItem Collections + 2D Equlivant + Default Class to store Default Values + SM.OGL.GLSystem to store OpenGL specific system information + SM2D.DrawColor // not working yet + SM2D.DrawComplex to allow access to all features. + SM2D.DrawPolygon + Polygon system // for 2D only yet ~ Renamed SM.OGL.Mesh to SM.OGL.GenericMesh
This commit is contained in:
parent
c4a0847567
commit
617a7ef044
39 changed files with 598 additions and 66 deletions
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Graphics.OpenGL4;
|
||||
|
||||
namespace SM.OGL.Mesh
|
||||
|
|
@ -29,6 +31,12 @@ namespace SM.OGL.Mesh
|
|||
public void Add(float x, float y) => AddRange(new[] {x,y});
|
||||
public void Add(float x, float y, float z) => AddRange(new[] {x,y,z});
|
||||
public void Add(float x, float y, float z, float w) => AddRange(new[] {x,y,z,w});
|
||||
public void Add(Vector2 vector) => Add(vector.X, vector.Y);
|
||||
public void Add(Vector2 vector, float z) => Add(vector.X, vector.Y, z);
|
||||
public void Add(Vector2 vector, float z, float w) => Add(vector.X, vector.Y, z, w);
|
||||
public void Add(Vector3 vector) => Add(vector.X, vector.Y, vector.Z);
|
||||
public void Add(Vector4 vector) => Add(vector.X, vector.Y, vector.Z, vector.W);
|
||||
public void Add(Color4 color) => Add(color.R, color.G, color.B, color.A);
|
||||
|
||||
public void BindBuffer(int attribID)
|
||||
{
|
||||
|
|
@ -36,7 +44,7 @@ namespace SM.OGL.Mesh
|
|||
|
||||
int buffer = GL.GenBuffer();
|
||||
GL.BindBuffer(BufferTarget.ArrayBuffer, buffer);
|
||||
GL.BufferData(BufferTarget.ArrayBuffer, data.Length * Mesh.BufferSizeMultiplier, data, BufferUsageHint);
|
||||
GL.BufferData(BufferTarget.ArrayBuffer, data.Length * sizeof(float), data, BufferUsageHint);
|
||||
|
||||
GL.VertexAttribPointer(attribID, PointerSize, PointerType, Normalised, PointerStride, PointerOffset);
|
||||
GL.EnableVertexAttribArray(attribID);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue