Skip to content

Commit 666eb49

Browse files
committed
added AddRGB24DMD() to allow setting an "external" DMD
1 parent 1d5ac77 commit 666eb49

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

include/DMDUtil/DMD.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class DMDUTILAPI DMD
156156
void DumpDMDRaw();
157157
LevelDMD* CreateLevelDMD(uint16_t width, uint16_t height, bool sam);
158158
bool DestroyLevelDMD(LevelDMD* pLevelDMD);
159+
void AddRGB24DMD(RGB24DMD* pRGB24DMD);
159160
RGB24DMD* CreateRGB24DMD(uint16_t width, uint16_t height);
160161
bool DestroyRGB24DMD(RGB24DMD* pRGB24DMD);
161162
ConsoleDMD* CreateConsoleDMD(bool overwrite, FILE* out = stdout);

src/DMD.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,16 @@ bool DMD::DestroyLevelDMD(LevelDMD* pLevelDMD)
280280
return false;
281281
}
282282

283-
RGB24DMD* DMD::CreateRGB24DMD(uint16_t width, uint16_t height)
283+
void DMD::AddRGB24DMD(RGB24DMD* pRGB24DMD)
284284
{
285-
RGB24DMD* const pRGB24DMD = new RGB24DMD(width, height);
286285
m_rgb24DMDs.push_back(pRGB24DMD);
287286
if (!m_pRGB24DMDThread) m_pRGB24DMDThread = new std::thread(&DMD::RGB24DMDThread, this);
287+
}
288+
289+
RGB24DMD* DMD::CreateRGB24DMD(uint16_t width, uint16_t height)
290+
{
291+
RGB24DMD* const pRGB24DMD = new RGB24DMD(width, height);
292+
AddRGB24DMD(pRGB24DMD);
288293
return pRGB24DMD;
289294
}
290295

0 commit comments

Comments
 (0)