-
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
-
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.
-
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?
-
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.
-
why wont this work?
d3ddev->ColorFill(Surface , &rect , D3DCOLOR_XRGB(0, 255, 0));
-
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.