Textbox for DirectX?
Are there any examples of a textbox in DirectX c++?
I tried searching for one, but came up empty.
(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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement