   Tips wanted for 2D GUI in Direct3D
  The application I work on needs an extensive GUI. This means I have to draw a lot of 2D lines and quads and texts. I currently have implemented this in Direct3D by calling GetDC and applying normal Windows GDI functions on my canvas (using LineTo/MoveTo for lines, FillRect for quads and ExtTextOut for text). This works on nvidia based cards, but it doesn't on my ATi Radeon 9800. I assume that the results of the GDI calls are overwritten by Direct3D in a later stage.I can do texts by using D3DXFont, but how should I do lines/quads? Should I do them with Direct3D by using D3DPT_LINESSTRIP for lines and untextured, colored triangles for quads? Or should I use DirectDraw in stead? Is this even possible (combining Direct3D and DirectDraw)? I'm not that experienced with Direct3D, so please don't flame me for asking stupid questions ;)Thanks in advance for any tips!Marc   
  I am not experienced with Direct3D, too but I think Direct3D can be used with DirectDraw because I saw it in book. I think it's name was Programming in DirectX in 21 days but I am not sure. Unfortunately, I can't remember on way how to reach it. For 2D GUIs I prefer using of DD.   ;  I remember reading somewhere that before DX8, Direct3D was based on DirectDraw, so you could get the DirectDraw interface from Direct3D, and use that. But now, you can't do that. For lines, there's D3DXLine. I haven't needed very many lines, so I've neglected that part of my drawing class, but it should work.I also haven't needed to draw colored rectangles that often, so I just use this as a quick solution:int draw::DrawColor(int x,int y,int x2,int y2,D3DCOLOR color) {D3DRECT rect = {x,y,x2,y2};return device->Clear(1,&rect,D3DCLEAR_TARGET,color,NULL,NULL);}It seems to work fast enough for my purposes, but if it's slow, I remember you can set the width of lines with D3DXLine, so you could possibly implement a faster solution by drawing a vertical line the length of the rectangle, and set it's width to the width of the rectangle.   ;  I haven't read it but this this book may be just what you are after. I have it in my Amazon shopping basket but haven't got around to ordering it yet... Perhaps someone who has read it can say if it is any good. It may be in Gamedev's book review section too.   ;  Darn!!! D3DXFont is not yet in DirectX 7!!! :(Is the source code for D3DXFont available somewhere, so I could try to hack it into DirectX 7 code? I *have* to use DirectX 7....   ;  Don't use Clear to draw, just use an untextured quad.Source for D3DXFont is not available.  I think CD3DFont does exist though.  If it is it will be in the Samples directory in a Common folder.  It's not quite as nice as the new D3DXFont, but it does have good performance.;  there is a decent article on the subject here on GDNet under misc. section.having said that, ive developed a pretty robust GUI in D3D,  its basically just a tree structure using recursion and a base class that all of your controls derive from, i used function pointers to implement an event system but the broadcasting/listening socket pattern would be more robust.for the graphics i use D3DXFont for text, textured quads with alpha for just about everything else. Oh yeah, Direct Input to capture the events and DSound for alerts.   ;Quote:Original post by Mike29936int draw::DrawColor(int x,int y,int x2,int y2,D3DCOLOR color) {D3DRECT rect = {x,y,x2,y2};return device->Clear(1,&rect,D3DCLEAR_TARGET,color,NULL,NULL);}This would be a very bad idea of you are rendering a 3d scene before the menu in particular. In DX8 I would render the menu first, in 3D, depth enabled before anything else. As long as we're not talking about using transparent menus that is. But either way, it's better than using clear, which can't do transparent menus anyway, and better than using an ortho projected camera later, since you'll have rendered somethings that the menu occludes that could have been depth tested. I suggest you use dx8 at the moment, because it's very different from dx7 and if you want to move on to shaders later, you'll have to relearn dx8 again.