Archived

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

Boltimus

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

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
Are you sure lpddsback is correctly initialized? Did you forget to include the code that flip lpddsback with the primary surface?

Edited by - Strange Monkey on August 14, 2001 1:06:46 PM

Share this post


Link to post
Share on other sites