From 70b451b323d094329a5cb8c9022a30a3af67f11c Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Tue, 20 Jul 2004 00:06:38 +0000 Subject: add playlist and gdi testbench --- main/enigma-gdi.cpp | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 main/enigma-gdi.cpp (limited to 'main/enigma-gdi.cpp') diff --git a/main/enigma-gdi.cpp b/main/enigma-gdi.cpp new file mode 100644 index 00000000..d0010adf --- /dev/null +++ b/main/enigma-gdi.cpp @@ -0,0 +1,111 @@ +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +#ifdef OBJECT_DEBUG +int object_total_remaining; + +void object_dump() +{ + printf("%d items left\n", object_total_remaining); +} +#endif + +void dumpRegion(const gRegion ®ion) +{ + fprintf(stderr, "extends: %d %d -> %d %d\n", + region.extends.left(), region.extends.top(), + region.extends.right(), region.extends.bottom()); + for (int y=0; y my_dc; + gFBDC::getInstance(my_dc); +#if 1 + + gPainter p(my_dc); + + gRGB pal[256]; + pal[0] = 0; + pal[1] = 0xff00ff; + pal[2] = 0xffFFff; + pal[3] = 0x00ff00; + + for (int a=0; a<0x10; ++a) + pal[a | 0x10] = (0x111111 * a) | 0xFF; + p.setPalette(pal, 0, 256); + + fontRenderClass::getInstance()->AddFont("/dbox2/cdkroot/share/fonts/arial.ttf", "Arial", 100); + + p.resetClip(gRegion(eRect(0, 0, 720, 576))); + + + gRegion c; + eDebug("0"); + int i; + + c |= eRect(0, 20, 100, 10); + c |= eRect(0, 50, 100, 10); + c |= eRect(10, 10, 80, 100); + + c -= eRect(20, 20, 40, 40); + + p.setForegroundColor(gColor(3)); + p.fill(eRect(0, 0, 100, 100)); + p.fill(eRect(200, 0, 100, 100)); + + for (int a=0; a %d %d", c.rects[a].left(), c.rects[a].top(), c.rects[a].right(), c.rects[a].bottom()); + eDebug("extends: %d %d %d %d", c.extends.left(), c.extends.top(), c.extends.right(), c.extends.bottom()); + p.setOffset(ePoint(100, 100)); + p.clip(c); + + p.setBackgroundColor(gColor(1)); + p.clear(); + p.setForegroundColor(gColor(2)); + p.line(ePoint(0, 0), ePoint(220, 190)); + p.clippop(); + + p.setBackgroundColor(gColor(0x1f)); + p.setForegroundColor(gColor(0x10)); + + ePtr fnt = new gFont("Arial", 70); + p.setFont(fnt); + p.renderText(eRect(100, 100, 500, 200), "Hello welt!"); + + sleep(1); + return 0; +} -- cgit v1.2.3