Thread: directx gui windows?

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    319

    directx gui windows?

    what i am have been trying todo is create windows and buttons on the device but with normal create window and set those as child to the main dx hWnd ,
    but when i just render a basic dx app with create deivce and render and then create the child window i was expecting to see in full screen mode , the screen flickers from the color the window is to the color you set clear to ,
    i have set the main dx window to WS_CLIPCHILDREN , but it still flickers
    i have looked at directx UT SDK docs and was unable to understand how to create a window in DXUT that is transparent like you can do in normal win32 api ,
    the directx sdk docs shows how to create scrollbar , edit , static buttons but not a normal window ,
    or stop the flicking and just have it set the to the color clear is set to
    Last edited by Anddos; 04-17-2008 at 07:27 AM.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Are you trying to use GDI inside of Direct3D? If so stop.

    An easy way to create windows is to make use of IDirect3DDevice9::SetViewPort(). There are some gotchas but you do get clipping for free.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    319
    Are you trying to use GDI inside of Direct3D? If so stop.

    An easy way to create windows is to make use of IDirect3DDevice9::SetViewPort(). There are some gotchas but you do get clipping for free.

    if you get clipping for free with this function , then why wouldent windows gdi create window etc show up on the device?

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Direct3D and GDI do not get along well. Direct3D needs complete control of the screen. You can IDirect3DDevice9::SetDialogBoxMode(true) and dialogs will appear but it comes with a performance hit. In general do not use GDI graphical elements inside of Direct3D. Even with fonts you must blit these to a DC, create a texture, and then create your fonts using this texture or you can use ID3DXFont which is not as robust as GDI fonts.

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    319
    why wont this work?
    d3ddev->ColorFill(Surface , &rect , D3DCOLOR_XRGB(0, 255, 0));
    Last edited by Anddos; 04-20-2008 at 08:43 AM.

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    ColorFill operates on surfaces. Surfaces are what textures are. So if you created a texture, retrieved the surface level 0, and then called ColorFill and passed in the surface, NULL for rect, and the color you desire - it would fill the entire texture.

    You would then create a quad the size of your viewport (actually the screen since the viewport scales to match the screen) and use that texture you just color filled.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GUI library that works on windows and linux?
    By Logan in forum C++ Programming
    Replies: 2
    Last Post: 04-28-2006, 08:40 PM
  2. How to move a sprite around inside a windows GUI
    By BuezaWebDev in forum C++ Programming
    Replies: 5
    Last Post: 04-07-2005, 09:42 PM
  3. GUI Programming (Not Games), OpenGL vs DirectX?
    By Zeusbwr in forum Game Programming
    Replies: 11
    Last Post: 01-20-2005, 01:02 PM
  4. Menu Item Caption - /a for right aligned Accelerator?
    By JasonD in forum Windows Programming
    Replies: 6
    Last Post: 06-25-2003, 11:14 AM