/
PlatformDrawer.cs
27 lines (22 loc) · 1.07 KB
/
PlatformDrawer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ClassicalSharp copyright 2014-2016 UnknownShadow200 | Licensed under MIT
using System;
using System.Drawing;
using ClassicalSharp;
namespace Launcher.Drawing {
/// <summary> Per-platform class used to transfer a framebuffer directly to the native window. </summary>
public abstract class PlatformDrawer {
internal OpenTK.INativeWindow window;
/// <summary> Initialises the variables for this platform drawer. </summary>
public abstract void Init();
/// <summary> Creates a framebuffer bitmap of the given dimensions. </summary>
public virtual Bitmap CreateFrameBuffer(int width, int height) {
return Platform.CreateBmp(width, height);
}
/// <summary> Updates the variables when the native window changes dimensions. </summary>
public virtual void Resize() { }
/// <summary> Redraws a portion of the framebuffer to the window. </summary>
/// <remarks> r is only a hint, the entire framebuffer may still be
/// redrawn on some platforms. </remarks>
public abstract void Redraw(Bitmap framebuffer, Rectangle r);
}
}