Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / General Programming / GUI like steam Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
cipherx

February 07, 2005, 08:51 AM

Hi,

I wanted to make a GUI for my game. I was wondering how the GUI in CS / HL / Steam was made. It looks clean and familiar like windows and customized just a little bit to fit perfectly into the game.

It looks like the controls are just Win32 resources with some type of color / skin. Does anyone know how you can just select one set of colors that will be applied to a whole set of controls? Another advantage of doing it this way is that I would not have the overhead of writing a resource editor for this which would be a very painful task. Instead I can just use the VC++ resource editor. (Of course, the colors will not show there, but I can manage that)

Finally, I was wondering if it is possible to bring up things like dialog boxes in full screen mode in D3D, with D3D drawing at the back and the dialogs in front of it.

Thanks,

- Mark

 
Victor Widell

February 07, 2005, 07:08 PM

It's most likely a fully custom implementation.

I don't think it is even possible to just modify the existing win32 drawing routines. The guys who made WindowBlinds (a windows skinning app) had to implement their own window drawing and hook it up instead of the default one.

You could google this site for "gui library". It should give you quite a few hits.

 
AticAtac

February 08, 2005, 04:31 AM

Correct me if i am wrong, but you can always "hook" the WM_PAINT, WM_DRAW, ... messages and modify the drawing under windows.

 
Warren Marshall

February 08, 2005, 08:06 AM

If you override WM_PAINT and WM_ERASEBACKGROUND for any window, you should be able to do whatever you like.

 
Scoot

February 08, 2005, 09:45 AM

I'm not sure if this is any use to you but check out the

IDirect3DDevice9::SetDialogBoxMode( bool bEnableDialogs )

function, which I noticed a few months ago. Apparently if you set this and create GDI dialog boxes as children of the device window they will be correctly drawn even in fullscreen mode. I've never used it myself as I think a custom option always gives you more flexibility, speed and a more "gamey" feel :o)

-Scoot

 
etienne2005

February 08, 2005, 11:35 AM


Like Warren said you override the EraseBackground
and you make sure the Base function is not called by removing the
call to the base class function

There is all the NC_ Message
This stand for Non-Client Area, basically the frame

With m_hWnd of the Dialog you can create the ClientDC or Non-Client DC
and use GDI drawing to draw bitmap or color with CPen, CBrush And CRect

 
Billy Zelsnack

February 08, 2005, 12:30 PM

I wrote the original vgui stuff. I'm not sure how it has changed since, but if you use the finder tool in Spy++ it shows the window is from the class 'Surface' which is what I had called it. So if is the same that means they are doing all the drawing and input management themselves. I used to have a cool little useless showoff demo where you could swap back and forth between win32 and D3D/OGL and it was pixel perfect.

 
cipherx

February 09, 2005, 11:39 PM

Cool Scoot, I think that is what I was looking for. I must definately check out this function more in detail.

- Sid

 
cipherx

February 09, 2005, 11:53 PM

Scoot it worked. For anyone else looking at this forum, you just need to call the SetDialogBoxMode function once during initialization.

Now that I have this function, here is my plan ->
1) I have made a skinning lib based on the code from http://www.codeproject.com/useritems/SkinCtrl.asp
2) With this, I can make resources in VC++ editor and then use them in my app.
This will also save me a lot of ovhead and save me from writing a complete GUI engine.

As the menu parts of the game are not too speed dependant, I can do with the overheads caused by the skinning lib and the windows messages.

Once again thanks to all the guys who helped.

- Sid

 
This thread contains 9 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.