Change To OpenGL

This commit is contained in:
Mueller Wayan
2025-08-15 10:44:29 +02:00
parent 1862530728
commit a36789dd7e
101 changed files with 2981 additions and 1027 deletions
@@ -0,0 +1,102 @@
using SFML.Graphics;
using SFML.System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Firebird2D.Interfaces.Actors
{
public enum ResizeMode
{
Resize,
DontResize,
CutImage
}
public enum AnchorPoint
{
topLeft,
topMiddle,
topRight,
bottomLeft,
bottomMiddle,
bottomRight,
LeftMiddle,
RightMiddle,
Center
}
public enum AnchorMode
{
stayInValue,
stayInRatio,
stayInPlace
}
public struct Anchors
{
public bool top;
public bool left;
public bool right;
public bool bottom;
AnchorPoint anchorPoint;
AnchorMode anchorMode;
public Anchors() : this(true, true, false, false, AnchorPoint.Center, AnchorMode.stayInValue) { }
public Anchors(bool top, bool left, bool right, bool bottom) : this(top, left, right, bottom, AnchorPoint.Center, AnchorMode.stayInValue) { }
public Anchors(bool top, bool left, bool right, bool bottom, AnchorPoint anchorPoint) : this(top, left, right, bottom, anchorPoint, AnchorMode.stayInValue) { }
public Anchors(bool top, bool left, bool right, bool bottom, AnchorPoint anchorPoint, AnchorMode anchorMode)
{
this.top = top;
this.left = left;
this.right = right;
this.bottom = bottom;
this.anchorPoint = anchorPoint;
this.anchorMode = anchorMode;
}
}
public interface IRenderable
{
public void Render(RenderWindow window);
}
public interface IUpdatable
{
void Tick(int timeDifference);
}
public interface IResizable : IRenderable
{
void Resize(int width, int height);
void OnWindowResize(int width, int height);
}
public interface I_BaseActor : IRenderable, IUpdatable, IComparable
{
public string Name { get; }
public ResizeMode resizeMode { get; set; }
public Anchors Anchors { get; set; }
public Vector2f Position { get; set; }
public Vector2f Size { get; set; }
public float Rotation { get; set; }
public int Z_Index { get; set; }
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Firebird2D.Interfaces.Actors
{
public interface I_Clickable : I_BaseActor
{
public event EventHandler Click;
}
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Firebird2D.Interfaces.Actors
{
public interface I_HitboxActor
{
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Firebird2D.Interfaces.Actors
{
public interface I_InteractableActor : I_BaseActor
{
public bool Interact(I_PlayerActor player);
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Firebird2D.Interfaces.Actors
{
public interface I_PlayerActor : I_BaseActor
{
}
}