From 713df6d111b7b742c387e450e538355ad81e9439 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 12 Dec 2019 14:44:51 -0500 Subject: [PATCH] Beginning work on render components of framework. --- RecrownedAthenaeum/Render/SpriteBatch.cs | 13 ++++++++++++ RecrownedAthenaeum/Types/IDrawable.cs | 12 +++++++++++ RecrownedAthenaeum/Types/ISpecialDrawable.cs | 20 ------------------- RecrownedAthenaeum/Types/Texture.cs | 21 ++++++++++++++++++++ 4 files changed, 46 insertions(+), 20 deletions(-) create mode 100644 RecrownedAthenaeum/Render/SpriteBatch.cs create mode 100644 RecrownedAthenaeum/Types/IDrawable.cs delete mode 100644 RecrownedAthenaeum/Types/ISpecialDrawable.cs create mode 100644 RecrownedAthenaeum/Types/Texture.cs diff --git a/RecrownedAthenaeum/Render/SpriteBatch.cs b/RecrownedAthenaeum/Render/SpriteBatch.cs new file mode 100644 index 0000000..4f64bce --- /dev/null +++ b/RecrownedAthenaeum/Render/SpriteBatch.cs @@ -0,0 +1,13 @@ +namespace RecrownedAthenaeum.Render { + public class SpriteBatch { + public SpriteBatch() { + } + public void Begin() { + + } + + public void End() { + + } + } +} \ No newline at end of file diff --git a/RecrownedAthenaeum/Types/IDrawable.cs b/RecrownedAthenaeum/Types/IDrawable.cs new file mode 100644 index 0000000..d034038 --- /dev/null +++ b/RecrownedAthenaeum/Types/IDrawable.cs @@ -0,0 +1,12 @@ +using RecrownedAthenaeum.Render; + +namespace RecrownedAthenaeum.Types +{ + /// + /// A wrapper that makes sure anything implementing can be drawn with options. + /// + public interface IDrawable + { + + } +} diff --git a/RecrownedAthenaeum/Types/ISpecialDrawable.cs b/RecrownedAthenaeum/Types/ISpecialDrawable.cs deleted file mode 100644 index 27c6eb1..0000000 --- a/RecrownedAthenaeum/Types/ISpecialDrawable.cs +++ /dev/null @@ -1,20 +0,0 @@ -using RecrownedAthenaeum.Render; - -namespace RecrownedAthenaeum.Types -{ - /// - /// A wrapper that makes sure anything implementing can be drawn with options. - /// - public interface ISpecialDrawable - { - /// - /// Should draw whatever implements this. - /// - /// The batch to be used. - /// The location and dimensions to draw to. - /// The color tint to draw with. - /// The rotation to be used. - /// The origin for the rotation. - void Draw(ConsistentSpriteBatch spriteBatch, Rectangle destination, Color color, float rotation = 0f, Vector2 origin = default(Vector2)); - } -} diff --git a/RecrownedAthenaeum/Types/Texture.cs b/RecrownedAthenaeum/Types/Texture.cs new file mode 100644 index 0000000..4aa0399 --- /dev/null +++ b/RecrownedAthenaeum/Types/Texture.cs @@ -0,0 +1,21 @@ +using System.IO; +namespace RecrownedAthenaeum.Types { + public class Texture { + byte[] textureData; + public Texture() { + Image img = Image.FromFile() + } + + public Texture(byte[] textureData) { + this.textureData = textureData; + } + + public void LoadFromPNG(string path) { + using (FileStream file = new FileStream(path, FileMode.Open)) { + Image img = new Image(); + img.LoadFromPNG(file); + } + + } + } +} \ No newline at end of file