
When i try to use the function to get the temperature, everything i try writing with drawtext doesn't appear on the screen(normally it does). Did anyone have an idea of what can cause this, cause i don't see how it's related.
here's my code(the comment's are in french cause i am, but it's not important):
The function to read the temperature i had taken in a tutorial(same as the font of my earlier problem)
extern "C"
{
XBOXAPI LONG WINAPI HalReadSMBusValue(UCHAR devddress,
UCHAR offset, UCHAR readdw, LPBYTE pdata);
}
//Permet de lire la température
unsigned char *ReadTemps(void)
{
static unsigned char c[2];
int t;
memset(c,0,2);
Sleep(100);
t = 0;
while( !c[0] )
{
HalReadSMBusValue(0x99, 0, 0, c);
Sleep(10);
}
t = 1;
while( !c[1] )
{
HalReadSMBusValue(0x99, 1, 0, c+1);
Sleep(10);
}
return c;
}
my var declarations
WCHAR wPosX[4] = L"";
WCHAR wPosY[4] = L"";
WCHAR wTemp[8] = L"";
unsigned char *cTemp;
and my code to get the temperature and to convert the text in wchar so i can output it.
//Lecture de la température
cTemp = ReadTemps();
//conversion de float en wchar de la position
swprintf(wPosX,L"%g",fPosX);
swprintf(wPosY,L"%g",fPosY);
//Conversion de la température
swprintf(wTemp,L"%c",cTemp[0]);
//wTemp = (char)cTemp[0];
// Begin the scene
g_pd3dDevice->BeginScene();
//Limites Tv: 35-10, 600-160
cFont.DrawText(fPosX, fPosY,0xffff00aa,L"David Pu",XBFONT_CENTER_X);
cFont.DrawText(320, 240, 0xff00ff00, L"Testing hihoha", 2);
cFont.DrawText(50,380,0xfff00fff,wPosX,XBFONT_LEFT);
cFont.DrawText(50,420,0xfff00fff,wPosY,XBFONT_LEFT);
cFont.DrawText(50,340,0xffff00ff,wTemp,XBFONT_LEFT);