Hi everyone !
I'm currently working on Project Mercury and I have a problem with the panel. I'm trying to create a new VESSEL3 panel. I already did it on a test project and it worked very well. However, I can't do it for Project Mercury.
The Mercury capsule inherits of VESSEL3 and in clbkLoadPanel2D (the new callback), I have this :
I removed every other callbacks to check if Mercury calls some funtions that may cause a problem, but I still get a 0xC0000005 runtime error from VC++. It is an access violation error. The error does not occur in my code, it is Orbiter. The last call is d3dim700.dll. Also, if I remove
oapiAddMeshGroup (hPanelMesh, &grp); and/or
SetPanelBackground(hPanel,0, 0,hPanelMesh,panelW,panelH);, I have no error. Finally, if I return false or I do not load the panel, everything works fine.
Any idea ? :sos:
I'm currently working on Project Mercury and I have a problem with the panel. I'm trying to create a new VESSEL3 panel. I already did it on a test project and it worked very well. However, I can't do it for Project Mercury.
The Mercury capsule inherits of VESSEL3 and in clbkLoadPanel2D (the new callback), I have this :
Code:
static DWORD panelW = 1280;
static DWORD panelH = 611;
float fpanelW = (float)panelW;
float fpanelH = (float)panelH;
static DWORD texW = 2048;
static DWORD texH = 1024;
float ftexW = (float)texW;
float ftexH = (float)texH;
static NTVERTEX VTX[4] =
{
{ 0.0f, 0.0f,0.0f, 0.0f,0.0f,0.0f, 0.0f,24.0f/ftexH},
{ 0.0f,fpanelH,0.0f, 0.0f,0.0f,0.0f, 0.0f,635.0f/ftexH},
{fpanelW,fpanelH,0.0f, 0.0f,0.0f,0.0f, fpanelW/ftexW,635.0f/ftexH},
{fpanelW, 0.0f,0.0f, 0.0f,0.0f,0.0f, fpanelW/ftexW,24.0f/ftexH}
};
static WORD IDX[6] =
{
0,2,1,
2,0,3
};
MESHGROUP grp = {VTX, IDX, 4, 6, 0, 0, 0, 0, 0};
if(hPanelMesh) oapiDeleteMesh (hPanelMesh);
hPanelMesh = oapiCreateMesh(0,0);
oapiAddMeshGroup (hPanelMesh, &grp);
SetPanelBackground(hPanel,0, 0,hPanelMesh,panelW,panelH);
return true;
I removed every other callbacks to check if Mercury calls some funtions that may cause a problem, but I still get a 0xC0000005 runtime error from VC++. It is an access violation error. The error does not occur in my code, it is Orbiter. The last call is d3dim700.dll. Also, if I remove
oapiAddMeshGroup (hPanelMesh, &grp); and/or
SetPanelBackground(hPanel,0, 0,hPanelMesh,panelW,panelH);, I have no error. Finally, if I return false or I do not load the panel, everything works fine.
Any idea ? :sos:
