Jump to content
  • Advertisement
Sign in to follow this  

Textbox for DirectX?

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

(I'm assuming you mean something for text entry here)

In the DirectX SDK, there is a GUI example in the DXUT (= DirectX UTilities) folder which uses subclassing to draw Win32 controls, including textboxes, onto a Direct3D surface.

Then the are game GUI libraries like CEGUI which can render controls such as buttons and text boxes onto any graphical surface. If portability was a concern, these should be preferred.

Finally, to do it yourself, you should simply catch the WM_CHAR message and append that to your text box. You can also do the trick using MapVirtualKeyEx() and ToAscii(), but international users won't be able to enter things like french accents with that method.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!