Using latest Orbiter beta version 150307.
Writing text or drawing lines on the HUD in any of my VESSEL3 class add-ons causes a CTD when HUD is displayed(cockpit view).
Still works fine for my VESSEL2 class add-ons.
This works OK(VESSEL2 class)
This causes CTD (VESSEL3 class)
I see the default shuttle Atlantis manages to draw on the HUD with no problems, and from the sample sdk code it looks like Atlantis is VESSEL3 class - so, am I missing something from my code?
Cheers,
BrianJ
EDIT------------------------------
Compiling with the OrbiterBeta r.13 SDK libraries solves the problem.
Writing text or drawing lines on the HUD in any of my VESSEL3 class add-ons causes a CTD when HUD is displayed(cockpit view).
Still works fine for my VESSEL2 class add-ons.
This works OK(VESSEL2 class)
Code:
///// class interface
class f9h_stg2: public VESSEL2
{
public:
f9h_stg2 (OBJHANDLE hVessel, int flightmodel);
~f9h_stg2 ();
void clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, HDC hDC);
}
///// HUD
void f9h_stg2::clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, HDC hDC)
{
char kbuf[256];
sprintf(kbuf,"TEST TEST TEST");
TextOut(hDC,(100),(100),kbuf,strlen(kbuf));
}
Code:
///// class interface
class f9h_stg2: public VESSEL3
{
public:
f9h_stg2 (OBJHANDLE hVessel, int flightmodel);
~f9h_stg2 ();
bool clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, oapi::Sketchpad *skp);
}
///// HUD
bool f9h_stg2::clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, oapi::Sketchpad *skp)
{
// draw the default HUD
VESSEL3::clbkDrawHUD (mode, hps, skp);
char kbuf[256];
sprintf(kbuf,"TEST TEST TEST");
skp->Text((100),(100),kbuf,strlen(kbuf));
return true;
}
Cheers,
BrianJ
EDIT------------------------------
Compiling with the OrbiterBeta r.13 SDK libraries solves the problem.
Last edited: