Sign in to follow this  

Editbox in DirectX

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

Hi, I'm trying to create an editbox window (to use as a textbox). I'm using DirectX 9 and Win32. To problem I have is that DirectX draws over my edit box. With some trial and error I added the WS_POPUP style to the edit box window's style and I got the editbox to show in front of the directx rendering. But when I select or unselect my editbox the main window loses or gains focus. So is there a way to prevent this from happening, or should I do something different than setting the WS_POP property? Edit: it seems that WS_POPUP makes it an independent window and it doesn't move anymore with the parent window. Cheers [Edited by - Cleese852 on June 9, 2009 8:29:16 AM]

Share this post


Link to post
Share on other sites
Have you considered using the DXUT framework? It provides some of the basic controls (including edit boxes) and is built on top of Direct3D. That way you don't have to wrestle with Win32 and D3D...

Share this post


Link to post
Share on other sites
I took a look at the CustomUI sample, but I already have a working textbox class, and most of the code I can understand. But it's the conflict with directX that I can't solve, and I'm not really a Win32 expert so I can't come up with a solution..

Share this post


Link to post
Share on other sites
Can you not just render your GUI last?
Loop:
{
- ...
- RenderScene()
- RenderWhatever()
- ...
- RenderGUI() (so your editbox would be rendered here)
}

Share this post


Link to post
Share on other sites
I do not need to say to my editbox to render itself. It's a window actually, so I can only show and hide it. DirectX is rendering over this (child) window apparently.

Share this post


Link to post
Share on other sites
ddlox, I also initially thought that, but then I remembered that he is using Win32 components and that his UI is not being rendered by Direct3D but by GDI.

Cleese852, I would tend to agree with Jason that you should be using the DXUT framework or find a free GUI library to use as hand coding GUI libraries are cumbersome and there are pretty nice ones that exist already.

Share this post


Link to post
Share on other sites

This topic is 3111 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this