|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| Game Programming Genesis Part III : Tracking Your Window and Using GDI |
|
![]() Myopic Rhino Staff Member since: The dawn of time
From: Temecula, CA, United States |
||||
|
|
||||
| Comments for the article Game Programming Genesis Part III : Tracking Your Window and Using GDI |
||||
|
||||
![]() Pipo DeClown Member since: 2/16/2002 From: Amsterdam, Netherlands |
||||
|
|
||||
| How does it work? ive blitted everything, it compiles, but i get a white screen! plz send answer to my mail! _________________________________________________________________________ Can someone be nice and help me on my way to be the next Hideo Kojima? Thought So... |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| I've been using TextOut() in my tetris clone, and I need to display the player's score (an integer). Now, TextOut() needs a pointer to a string; is there another GDI function that will display an integer? I've got a (convoluted) function that will make a string out of an integer, so I can use TextOut(). There's got to be an easier way though Ideas? Thanks |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Use wsprintf to build the string buffer, then pass it to TextOut. Example: TCHAR szBuf [1024] ; // String buffer to store message LONG nScore ; // Integer to store player's score HDC hDC ; // Handle to a device context LONG X, Y ; // Coordinates of output text // Initialise these variables here // ... // ... // ... // Build the string like this wsprintf (szBuf, TEXT ("Your score is : %d" // Pass it to Text out TextOut (hDC, X, Y, szBuf, lstrlen (szBuf)) ; |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|