Jump to content
  • Advertisement
Sign in to follow this  
kingpinzs

How to display text in a child window

This topic is 4847 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

How to display text in a child window? I can get the text to display in the parten window but I cant do anything with the child window. this is how I am displaying the text if (g_pddsback->GetDC(&hDC) == DD_OK) { char buffer[ 200 ]; char buffer2[ 200 ]; wsprintf( buffer, "mouse Posetion x %d", posX ); wsprintf( buffer2, "mouse Posetion x %d", posY ); // Paint the text SetBkColor(hDC, RGB(0, 0, 255)); SetTextColor(hDC, RGB(255, 255, 0)); hOldBrush = (HBRUSH )SelectObject(hDC, GetStockObject(LTGRAY_BRUSH)); hOldPen = (HPEN )SelectObject(hDC, GetStockObject(WHITE_PEN)); SelectObject(hDC, hOldPen); SelectObject(hDC, hOldBrush); TextOut(hDC, 0, 0,buffer , 20); TextOut(hDC, 0, 20, buffer2 , 20); g_pddsback->ReleaseDC(hDC); }

Share this post


Link to post
Share on other sites
Advertisement
Judging from the variable name g_pddsback, I'm assuming you're using DirectDraw. I don't have much experience with it; I used it for maybe a month before switching to Direct3D, so I'm not really sure how it accomplishes child windows. I did a little digging, and found that clippers can be used to draw to child windows. Is this the method you use?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!