aboutsummaryrefslogtreecommitdiff
path: root/Unicity.Renderer/Shapes
diff options
context:
space:
mode:
Diffstat (limited to 'Unicity.Renderer/Shapes')
-rw-r--r--Unicity.Renderer/Shapes/Rectangle.cs26
-rw-r--r--Unicity.Renderer/Shapes/Shape.cs17
-rw-r--r--Unicity.Renderer/Shapes/Triangle.cs50
3 files changed, 0 insertions, 93 deletions
diff --git a/Unicity.Renderer/Shapes/Rectangle.cs b/Unicity.Renderer/Shapes/Rectangle.cs
deleted file mode 100644
index 2239426..0000000
--- a/Unicity.Renderer/Shapes/Rectangle.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-namespace Unicity.Renderer.Shapes
-{
- public class Rectangle : Shape
- {
- Triangle rect1 = null;
- Triangle rect2 = null;
-
- public Rectangle(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)
- {
- rect1 = new Triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3);
- rect2 = new Triangle(x3, y3, z3, x2, y2, z2, x4, y4, z4);
- }
-
- internal override void Draw(Shader shader, GraphicsRenderer renderer)
- {
- rect1.Draw(shader, renderer);
- rect2.Draw(shader, renderer);
- }
-
- public override void Dispose()
- {
- rect1.Dispose();
- rect2.Dispose();
- }
- }
-}
diff --git a/Unicity.Renderer/Shapes/Shape.cs b/Unicity.Renderer/Shapes/Shape.cs
deleted file mode 100644
index 8e6e322..0000000
--- a/Unicity.Renderer/Shapes/Shape.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace Unicity.Renderer.Shapes
-{
- public class Shape : IDisposable
- {
- internal virtual void Draw(Shader shader, GraphicsRenderer renderer)
- {
-
- }
-
- public virtual void Dispose()
- {
-
- }
- }
-}
diff --git a/Unicity.Renderer/Shapes/Triangle.cs b/Unicity.Renderer/Shapes/Triangle.cs
deleted file mode 100644
index 7ab94e2..0000000
--- a/Unicity.Renderer/Shapes/Triangle.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using OpenTK.Graphics.OpenGL4;
-
-namespace Unicity.Renderer.Shapes
-{
- public class Triangle : Shape
- {
- int vao = 0;
- int vbo = 0;
-
- float[] vertices = null;
-
- public Triangle(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3)
- {
- vertices = new float[]
- {
- x1, y1, z1,
- x2, y2, z2,
- x3, y3, z3
- };
-
- vao = GL.GenVertexArray();
- vbo = GL.GenBuffer();
-
- GL.BindVertexArray(vao);
- GL.BindBuffer(BufferTarget.ArrayBuffer, vbo);
-
- GL.BufferData(BufferTarget.ArrayBuffer, vertices.Length * sizeof(float), vertices, BufferUsageHint.StaticDraw);
-
- GL.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, false, 3 * sizeof(float), 0);
- GL.EnableVertexAttribArray(0);
-
- }
-
- internal override void Draw(Shader shader, GraphicsRenderer renderer)
- {
- GL.BindVertexArray(vao);
- GL.BindBuffer(BufferTarget.ArrayBuffer, vbo);
-
- float[] newVertices = new float[vertices.Length];
-
- GL.DrawArrays(PrimitiveType.Triangles, 0, 3);
- }
-
- public override void Dispose()
- {
- GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
- GL.DeleteBuffer(vbo);
- }
- }
-}