Since the original code of IMS was written for Orbiter 2006, it doesn't yet have a sketchpad, so I'm about to switch all drawing events from WinAPI.
The trouble is, I don't really know how to define a sketchpad. Usually, functions provide it directly, like for example MFD::update. But already when it comes to drawing the text for MFD buttons, I hit a wall, as there seems to be no version of clbkPanelRedrawEvent that would pass me a sketchpad. I assume I have to define and register one myself (I'll need to do that anyways for drawing the custom displays), but I am unable to find a tutorial or other documentation on it.
---------- Post added 01-26-12 at 09:16 AM ---------- Previous post was 01-25-12 at 10:24 AM ----------
Sorry for posting this in the wrong place initially, completely forgott that we have a dedicated SDK forum.
Anyways, I took a good look at the DG sample, and to be honest, it confuses me.
So far, I learned that there is clbkLoadPanel2D, which is the newer version. What I don't get is why the DG uses both clbkLoadPanel and clbkLoadPanel2D. It seems that clbkLoadPanel2d is only responsible for the scaling, is that correct?
Also, I figured by now that sketchpad is used exclusively for MFDs, and that on a panel, I have to use oapiBlt even for text. That might complicate things a bit, but should be doable (although I'm not yet exactly sure how the DG sample converts its text into bitmaps, but I guess I'll figure it out with some trial and error). The only question left is: Did I get this right, or am I missing something?
The trouble is, I don't really know how to define a sketchpad. Usually, functions provide it directly, like for example MFD::update. But already when it comes to drawing the text for MFD buttons, I hit a wall, as there seems to be no version of clbkPanelRedrawEvent that would pass me a sketchpad. I assume I have to define and register one myself (I'll need to do that anyways for drawing the custom displays), but I am unable to find a tutorial or other documentation on it.
---------- Post added 01-26-12 at 09:16 AM ---------- Previous post was 01-25-12 at 10:24 AM ----------
Sorry for posting this in the wrong place initially, completely forgott that we have a dedicated SDK forum.
Anyways, I took a good look at the DG sample, and to be honest, it confuses me.
So far, I learned that there is clbkLoadPanel2D, which is the newer version. What I don't get is why the DG uses both clbkLoadPanel and clbkLoadPanel2D. It seems that clbkLoadPanel2d is only responsible for the scaling, is that correct?
Also, I figured by now that sketchpad is used exclusively for MFDs, and that on a panel, I have to use oapiBlt even for text. That might complicate things a bit, but should be doable (although I'm not yet exactly sure how the DG sample converts its text into bitmaps, but I guess I'll figure it out with some trial and error). The only question left is: Did I get this right, or am I missing something?
Last edited: