c++ directx9 center background
-
Hello, i am trying to code some graphics for a little game in c++ and winapi / directx9. I have established a background as a surface. Then i put some sprites on the background. The problem is, as i call a function that has to center the screen on the active sprite, it doesn't show the background. Here is the code so far, if you miss an information, please ask and i will answer. First, the part of main, that is called, when user pushes button (winapi)
case ID_ZENTRIEREN:
{
for (int x=0;x<4;x++)
if (Spieler[x].Rundenaktiv==true)
{
Spielx=Spieler[x].posx;
Spiely=Spieler[x].posy;
d3ddev->Clear(0,NULL,D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f), 1.0f, 0);
render_frame_center(hDlg1, Worldposx, Worldposy, Bildschirmbreite, Bildschirmhoehe, Spielx, Spiely);
if (Spieler[x].Mobilart==0) //Schuerfer
{
float Mobilposx, Mobilposy;
Mobilposx=Spieler[x].posx;
Mobilposy=Spieler[x].posy;
render_Schuerfer(oWorldposx, oWorldposy, Mobilposx, Mobilposy);
}
else if (Spieler[x].Mobilart==1) //Frachter
{
float Mobilposx, Mobilposy;
Mobilposx=Spieler[x].posx;
Mobilposy=Spieler[x].posy;
render_Frachter(oWorldposx, oWorldposy, Mobilposx, Mobilposy);
}
else if (Spieler[x].Mobilart==2) //Flugwaechter
{
float Mobilposx, Mobilposy;
Mobilposx=Spieler[x].posx;
Mobilposy=Spieler[x].posy;
render_Flugwaechter(oWorldposx, oWorldposy, Mobilposx, Mobilposy);
}
else if (Spieler[x].Mobilart==3) //Jaeger
{
float Mobilposx, Mobilposy;
Mobilposx=Spieler[x].posx;
Mobilposy=Spieler[x].posy;
render_Jaeger(oWorldposx, oWorldposy, Mobilposx, Mobilposy);
}render\_Zeichenak