9
« on: July 17, 2022, 03:51:37 PM »
I'm able to display display multiple image/bitmaps as long as each image is set up with HANDLE, SOURCE, etc immediately prior to display.
If I try to set up multiple bitmaps parameters in advance, and then add a bitmap using VERTEX2F, I get a corrupted screen/display.
Below is an example of what does NOT work:
Note, the image data is already loaded into RAM and imageTable array contains valid bitmap attributes.
char handles[] = { 8,9 };
uint32_t addresses[] = { ramBitmapAddress1,ramBitmapAddress2};
int count = 1; // if count == sizeof(handles) the display gets corrupted
for (int i = 0; i < sizeof(handles); i++) {
App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(handles[i]));
App_WrCoCmd_Buffer(phost, BITMAP_SOURCE(addresses[i]);
App_WrCoCmd_Buffer(phost, BITMAP_LAYOUT(L1, imageTable[i]->Stride, imageTable[i]->Height));
App_WrCoCmd_Buffer(phost, BITMAP_SIZE(NEAREST, BORDER, BORDER, imageTable[i]->Width, imageTable[i]->Height));
}
//Place the image
App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS)); // start drawing bitmaps
App_WrCoCmd_Buffer(phost, COLOR_RGB(0,255,0));
App_WrCoCmd_Buffer(phost, VERTEX2F(685 * 16, 380 * 16, 8, 0));
App_WrCoCmd_Buffer(phost, END());
What is the correct way of doing this? It seems inefficient to have to set up the bitmap attributes every time it's being used.