Skip to content

Commit

Permalink
chore: update docs, use newer RGB24 update method in test app
Browse files Browse the repository at this point in the history
  • Loading branch information
jsm174 committed Feb 18, 2024
1 parent 92bbbe3 commit 20482f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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);
}
```

Expand Down
2 changes: 1 addition & 1 deletion src/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 20482f5

Please sign in to comment.