This topic is now archived and is closed to further replies.

Problems getting text displayed in full windowed 32-bit mode!!

This topic is 5969 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, here is the code I''m using while in 32-bit full screen mode utilizing directx. The problem is that I can''t get the text displayed on the screen. Any suggestions?? .....all the directx init stuff is done here..... else if (KEY_DOWN(VK_LEFT)) { ship_angle+=45; Rotate_Polygon2D(&ship, ship_angle); ship_angle=0; ship_facing+=45; if (ship_facing>359) ship_facing-=360; } else if (KEY_DOWN(VK_RIGHT)) { ship_angle-=45; Rotate_Polygon2D(&ship, ship_angle); ship_angle=0; ship_facing-=45; if (ship_facing<0) ship_facing+=360; } else if (KEY_DOWN(VK_SPACE)) { } if (ship.xv>1000) ship.xv=1000; if (ship.yv>1000) ship.yv=1000; if (ship.xv<-1000) ship.xv=-1000; if (ship.yv<-1000) ship.yv=-1000; ship.x0+=(int)(ship.xv/100); ship.y0-=(int)(ship.yv/100); sprintf(buffer,"velocity_angle = %d",velocity_angle); Draw_Text_GDI(buffer, 100, 100, RGB(255,255,255),lpddsback); ... here is the code for Draw_Text_GDI: int Draw_Text_GDI(char *text, int x,int y,COLORREF color, LPDIRECTDRAWSURFACE4 lpdds) { // this function draws the sent text on the sent surface // using color index as the color in the palette HDC xdc; // the working dc // get the dc from surface if (FAILED(lpdds->GetDC(&xdc))) return(0); // set the colors for the text up SetTextColor(xdc,color); // set background mode to transparent so black isn''t copied SetBkMode(xdc, TRANSPARENT); // draw the text a TextOut(xdc,x,y,text,strlen(text)); // release the dc lpdds->ReleaseDC(xdc); // return success return(1); } // end Draw_Text_GDI ~ Boltimus ~

Share this post

Link to post
Share on other sites