move basic drawing interface to the shared interface file color.d

This commit is contained in:
Adam D. Ruppe 2025-05-20 10:02:08 -04:00
parent 71e20933af
commit 5a25404ede
2 changed files with 15 additions and 10 deletions

15
color.d
View File

@ -1335,6 +1335,21 @@ interface MemoryImage {
alias fromImageFile = fromImage; alias fromImageFile = fromImage;
} }
/++
This interface is likely going to grow, so if you implement it, expect to have to add more methods as you update the library.
History:
Added to arsd.game August 26, 2024, moved to arsd.color April 20, 2025
+/
@system
interface BasicDrawing {
void fillRectangle(Rectangle r, Color c);
void outlinePolygon(Point[] vertexes, Color c);
void drawText(Rectangle boundingBox, string text, Color c);
}
/// An image that consists of indexes into a color palette. Use [getAsTrueColorImage]() if you don't care about palettes /// An image that consists of indexes into a color palette. Use [getAsTrueColorImage]() if you don't care about palettes
class IndexedImage : MemoryImage { class IndexedImage : MemoryImage {
bool hasAlpha; bool hasAlpha;

10
game.d
View File

@ -1542,16 +1542,6 @@ void clearOpenGlScreen(SimpleWindow window) {
} }
/++
History:
Added August 26, 2024
+/
interface BasicDrawing {
void fillRectangle(Rectangle r, Color c);
void outlinePolygon(Point[] vertexes, Color c);
void drawText(Rectangle boundingBox, string text, Color c);
}
/++ /++
NOT fully compatible with simpledisplay's screenpainter, but emulates some of its api. NOT fully compatible with simpledisplay's screenpainter, but emulates some of its api.