49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using Dashboard.Drawing.OpenGL.Pal;
|
|
using Dashboard.Pal;
|
|
using Dashboard.Windowing;
|
|
using OpenTK.Graphics;
|
|
using OpenTK.Platform;
|
|
using TK = OpenTK.Platform.Toolkit;
|
|
|
|
namespace Dashboard.OpenTK.PAL2
|
|
{
|
|
public class Pal2Application : Application
|
|
{
|
|
public override string DriverName => "Dashboard OpenTK PAL2.0 Driver";
|
|
public override string DriverVendor => "Dashboard";
|
|
public override Version DriverVersion => new Version(0, 1);
|
|
public GraphicsApiHints GraphicsApiHints { get; set; } = new OpenGLGraphicsApiHints();
|
|
|
|
private readonly List<PhysicalWindow> _windows = new List<PhysicalWindow>();
|
|
|
|
public override IPhysicalWindow CreatePhysicalWindow()
|
|
{
|
|
PhysicalWindow window = new PhysicalWindow(GraphicsApiHints);
|
|
_windows.Add(window);
|
|
|
|
return window;
|
|
}
|
|
|
|
public override IWindow CreateWindow()
|
|
{
|
|
return CreatePhysicalWindow();
|
|
}
|
|
|
|
public override void RunEvents(bool wait)
|
|
{
|
|
TK.Window.ProcessEvents(wait);
|
|
|
|
for (int i = 0; i < _windows.Count; i++)
|
|
{
|
|
if (_windows[i].IsDisposed)
|
|
{
|
|
_windows.RemoveAt(i);
|
|
continue;
|
|
}
|
|
|
|
_windows[i].Paint();
|
|
}
|
|
}
|
|
}
|
|
}
|