Replaced color usage with OpenTK's implementation.
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
using OpenTK;
|
||||
namespace RecrownedAthenaeum.Graphics.Render
|
||||
{
|
||||
/// <summary>
|
||||
|
13
RecrownedAthenaeum/Graphics/Render/Batch.cs
Normal file
13
RecrownedAthenaeum/Graphics/Render/Batch.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
namespace RecrownedAthenaeum.Graphics.Render {
|
||||
public class Batch {
|
||||
private bool begun;
|
||||
public Batch() {
|
||||
|
||||
}
|
||||
public void Begin() {
|
||||
if (begun) throw new InvalidOperationException("This batch has already been started.");
|
||||
begun = true;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using OpenTK;
|
||||
using System;
|
||||
|
||||
namespace RecrownedAthenaeum.Graphics.Render
|
||||
|
@@ -1,5 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK;
|
||||
using System;
|
||||
|
||||
namespace RecrownedAthenaeum.Graphics.Render
|
||||
@@ -78,7 +78,7 @@ namespace RecrownedAthenaeum.Graphics.Render
|
||||
/// </summary>
|
||||
/// <param name="vertex">The vector that represents the vertex.</param>
|
||||
/// <param name="color">The color of that vertex.</param>
|
||||
public void AddVertex(Vector2 vertex, Color color)
|
||||
public void AddVertex(Vector2 vertex, Color4 color)
|
||||
{
|
||||
if (!began) throw new InvalidOperationException("Begin needs to be called before adding vertex.");
|
||||
if (disposed) throw new ObjectDisposedException(this.GetType().Name);
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK;
|
||||
using RecrownedAthenaeum.Types;
|
||||
using System;
|
||||
|
||||
namespace RecrownedAthenaeum.Graphics.Render
|
||||
@@ -73,7 +74,7 @@ namespace RecrownedAthenaeum.Graphics.Render
|
||||
/// <param name="height">Height of rectangle.</param>
|
||||
/// <param name="color">Color of all vertices of this rectangle.</param>
|
||||
/// <param name="rotation">Rotation of rectangle. Default is 0 radians.</param>
|
||||
public void Draw(int x, int y, int width, int height, Color color, float rotation = 0)
|
||||
public void Draw(int x, int y, int width, int height, Color4 color, float rotation = 0)
|
||||
{
|
||||
primitiveBatch.primitiveCount = filled ? 3 : 4;
|
||||
Vector2[] corners = new Vector2[4];
|
||||
@@ -110,7 +111,7 @@ namespace RecrownedAthenaeum.Graphics.Render
|
||||
/// </summary>
|
||||
/// <param name="rectangle">Uses the x, y and dimensions to draw a rectangle.</param>
|
||||
/// <param name="color">The color of the rectangle.</param>
|
||||
public void Draw(Rectangle rectangle, Color color)
|
||||
public void Draw(Rectangle rectangle, Color4 color)
|
||||
{
|
||||
Draw(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, color);
|
||||
}
|
||||
|
Reference in New Issue
Block a user