Textbox for DirectX?

Started by
1 comment, last by Cygon 15 years, 3 months ago
Are there any examples of a textbox in DirectX c++? I tried searching for one, but came up empty.
Advertisement
I like 3D Game Programming With DirectX 9.0c: A Shader Approach by Frank Luna
(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.
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.

This topic is closed to new replies.

Advertisement