I have successfully drawn a datatype (a picture) in a Docky. It is however in 256 color mode. I am sending enDockyRenderMode.DOCKYRENDERMODE_RP as answer to DOCKYGET_RenderMode.
I assume I'm supposed to answer with DOCKYRENDERMODE_RGB or any of the other instead. But this is where I'm at loss.
1. How do I know which DOCKYRENDERMODE to send? I've found some way to get my current screenmode, but how do I map it to the corrent DOCKYRENDERMODE? I'm naïvely looking for some define or enum having RGB ARGB or RGBA in its name, but I can't find any, nor any appropriate fields (like in DrawInfo). I also looked at the bitdepth, and if it was more than 8 I simply send an _RGB mode. But then I face my 2nd problem:
2. How do I use what I receive from AmiDock via DOCKYSET_RenderDestination?
- struct DockyRenderDestination
- uint32 renderMode; // enum enDockyRenderMode
- struct DockySize renderSize;
- UBYTE pad; // for future extension
- UBYTE *map; // currently unused
- struct RastPort *RP; // RP->BitMap is of type RGBFB_ALPHA8
- } alpha;
- UBYTE *RGB;
- struct RastPort *RP;
- } render;
Am I supposed to use the RGB pointer? and what do i do with it?
I'm currently doing this to draw the datatype:
- pictureObject = IDataTypes->NewDTObject("ram:mypic.png",
- PDTA_Screen, screen, /*<- screen from AmiDock dockyset_screen */
- IDataTypes->ObtainDTDrawInfo(pictureObject, NULL);
- IDataTypes->DrawDTObject(rastPort, pictureObject,
- size.width, size.height,0,0,NULL)
- IDataTypes->ReleaseDTDrawInfo(pictureObject, handle);
And it doesn't work when I just changed the render mode I returned. So I guess I am doing something wrong.