From 20482f522a561e0f5c02743f6fc09cef30c41a06 Mon Sep 17 00:00:00 2001 From: Jason Millard Date: Sun, 18 Feb 2024 12:46:26 -0500 Subject: [PATCH] chore: update docs, use newer RGB24 update method in test app --- README.md | 16 +++++++++------- src/test.cpp | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3679765..22639af 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A cross platform library for performing DMD tasks. -This library is currently used by [Visual Pinball Standalone](https://github.com/vpinball/vpinball/tree/standalone) for processing [PinMAME](https://github.com/vpinball/pinmame/tree/master/src/libpinmame) and [FlexDMD](https://github.com/vbousquet/flexdmd) DMD frames. It supports colorizing using [Serum](https://github.com/zesinger/libserum), outputing to [ZeDMD](https://github.com/ppuc/zedmd) and [Pixelcade](https://pixelcade.org) devices, and providing intensity and RGB32 buffers that can be used to render in table and external DMDs for [Visual Pinball](https://github.com/vpinball/vpinball). +This library is currently used by [Visual Pinball Standalone](https://github.com/vpinball/vpinball/tree/standalone) for processing [PinMAME](https://github.com/vpinball/pinmame/tree/master/src/libpinmame) and [FlexDMD](https://github.com/vbousquet/flexdmd) DMD frames. It supports colorizing using [Serum](https://github.com/zesinger/libserum), outputing to [ZeDMD](https://github.com/ppuc/zedmd) and [Pixelcade](https://pixelcade.org) devices, and providing intensity and RGB24 buffers that can be used to render in table and external DMDs for [Visual Pinball](https://github.com/vpinball/vpinball). ## Usage: @@ -20,22 +20,24 @@ void setup() void test() { - DMDUtil::DMD* pDmd = new DMDUtil::DMD(128, 32, false, "t2_l8"); - DMDUtil::VirtualDMD* pVirtualDMD = pDmd->CreateVirtualDMD(); + DMDUtil::DMD* pDmd = new DMDUtil::DMD(); + pDmd->FindDisplays(); - uint8_t* pData = (uint8_t*)malloc(128 * 32); + DMDUtil::RGB24DMD* pRGB24DMD = pDmd->CreateRGB24DMD(128, 32); + + uint8_t* pData = (uint8_t*)malloc(128 * 32 * 3); . . . - pDmd->UpdateData((const UINT8*)pData, 2, 255, 0, 0); + pDmd->UpdateRGB24Data((const UINT8*)pData, 128, 32); - uint8_t* pRGB24Data = pVirtualDMD->GetRGB24Data(); + uint8_t* pRGB24Data = pRGB24DMD->GetRGB24Data(); if (pRGB24Data) { // Render pRGB24Data } - pDmd->DestroyVirtualDMD(pVirtualDMD); + pDmd->DestroyRGB24DMD(pRGB24DMD); } ``` diff --git a/src/test.cpp b/src/test.cpp index e009037..47b9a5b 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -155,7 +155,7 @@ int main(int argc, const char* argv[]) pDmd->UpdateRGB24Data(pImage24, 4, 128, 32, 255, 255, 255); std::this_thread::sleep_for(std::chrono::milliseconds(ms)); - pDmd->UpdateRGB24Data(pImage24, 24, 128, 32, 0, 0, 0); + pDmd->UpdateRGB24Data(pImage24, 128, 32); std::this_thread::sleep_for(std::chrono::milliseconds(ms)); pDmd->UpdateRGB16Data(image16, 128, 32);