How to put edit box in DirectX

Started by
5 comments, last by gnohnum 21 years, 5 months ago
hi all, im developing a game with directx. My game will required input from users (getting from edit box). I''ve tried to use win32 way of prompting a dialog with edit box. but the screen stays as if it''s hang. but i know the dialog box is being called out but only it''s not displaying correctly. This is how i called the dialog box DialogBox(hInstance,MAKEINTRESOURCE(IDD_DIALOG),NULL, (DLGPROC)DlgProc); pls comment... it will be better if there''s any small sample programs as reference for me, thanks guys!
Advertisement
You can''t use Windows dialog boxes when you are in a directX game because the directX game takes over the screen. If you want to take user input through a textbox within your game then you will have to either write some code for an editbox control or use someone else''s code for doing this in a dx app.

I am currently writing something like this myself. It''s not really hard, just takes some knowhow and you have to start with the simple stuff then work up to the actual editbox. For example, get some textboxes and input handling working then you can create an edit-textbox.
DirectX only takes control if you use full screen mode.
I decided not to use full screen so I could use windows
dialog boxes and everything worked out fine.
quote:Original post by Igilima
You can''t use Windows dialog boxes when you are in a directX game because the directX game takes over the screen. If you want to take user input through a textbox within your game then you will have to either write some code for an editbox control or use someone else''s code for doing this in a dx app.


I haven''t tried it recently, but I''ve never had a problem displaying dialog boxes in DX7 days.
"We are born naked, wet, and hungry. Then things get worse."
Look up: FlipToGDISurface()
Check the DDraw Fullscreendialog sample at the SDK.
--------------------------------------------- If God with me, Who against me?Personal Web Samuel Prince Blog...
first of all, thanks guys,

following the reply u guys gave me, i''ve look up the fullscreendialog at ddraw samples. now i manage to get the dialog prompt out, but the edit box inside the dialog box still can''t be seen and the dialog box cannot stay long. how can i make the dialog box stay until the user has input the data?



This topic is closed to new replies.

Advertisement