using SFML.Graphics; using SFML.System; using SFML.Window; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SFMLRenderer { /// /// 定义了 SFML 渲染器的基本功能和事件, 基本上是对 的抽象 /// 实现示例可以见 /// public interface ISFMLRenderer { /// /// 发生在资源首次创建完成后, 该事件发生之后渲染器才是可用的, 操作才会生效 /// public event EventHandler? RendererCreated; /// /// 发生在资源即将不可用之前, 该事件发生之后对渲染器的操作将被忽略 /// public event EventHandler? RendererDisposing; public event EventHandler? CanvasMouseMove; public event EventHandler? CanvasMouseButtonPressed; public event EventHandler? CanvasMouseButtonReleased; public event EventHandler? CanvasMouseWheelScrolled; /// /// 分辨率, 影响画面的相对比例 /// public Vector2u Resolution { get; set; } /// /// 快捷设置视区中心点 /// public Vector2f Center { get; set; } /// /// 快捷设置视区缩放 /// public float Zoom { get; set; } /// /// 快捷设置视区旋转 /// public float Rotation { get; set; } /// /// 快捷设置视区水平翻转 /// public bool FlipX { get; set; } /// /// 快捷设置视区垂直翻转 /// public bool FlipY { get; set; } /// /// 最大帧率, 影响 Draw 的最大调用频率, /// public uint MaxFps { get; set; } /// /// 垂直同步, /// public bool VerticalSync { get; set; } /// /// /// public bool SetActive(bool active); /// /// /// public View GetView(); /// /// /// public void SetView(View view); /// /// /// public Vector2f MapPixelToCoords(Vector2i point); /// /// /// public Vector2i MapCoordsToPixel(Vector2f point); /// /// /// public void Clear(); /// /// /// public void Clear(Color color); /// /// /// public void Draw(Drawable drawable); /// /// /// public void Draw(Drawable drawable, RenderStates states); /// /// /// public void Draw(Vertex[] vertices, PrimitiveType type); /// /// /// public void Draw(Vertex[] vertices, PrimitiveType type, RenderStates states); /// /// /// public void Draw(Vertex[] vertices, uint start, uint count, PrimitiveType type); /// /// /// public void Display(); } }