Introducing MPGH's AIGA. The latest advancement in artificial intelligence. Click here now to learn more!

Thread: D3D Menu Design

Results 1 to 15 of 15
  1. #1
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty

    D3D Menu Design

    I am looking for a bit of advice with D3D Menus.

    I coded a little bit of D3D from the ground up, but D3D Menus are a little confusing because they are injected into an already running game. I thought about creating a new D3DDEVICE, but wouldn't that just completely override the games screen? So what would I need to do? Find the pointer to the D3D device in the games code, etc? Please help :P

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    DirectDraw for menu's = epic
    but decrapitated and doesnt work too well on nvidia cards ;(

    I think using 2 D3D devices will conflict due to them both wanting to have focus.

    edit: Windows 7 has Direct2D as replacement for DirectDraw.
    Last edited by Hell_Demon; 02-13-2010 at 12:09 PM.
    Ah we-a blaze the fyah, make it bun dem!

  3. The Following User Says Thank You to Hell_Demon For This Useful Post:

    why06 (02-13-2010)

  4. #3
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    You dont need to create another device for a basic d3d menu. All you need to hook is endscene in most games.
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  5. The Following User Says Thank You to zhaoyun333 For This Useful Post:

    why06 (02-13-2010)

  6. #4
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by zhaoyun333 View Post
    You dont need to create another device for a basic d3d menu. All you need to hook is endscene in most games.
    Hmmmm... good idea thanks ;P

    Thanks for the tips.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  7. #5
    Calebb's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    212
    Reputation
    12
    Thanks
    75
    Code:
    void DrawString(int x, int y, DWORD color, LPD3DXFONT g_pFont, const char *fmt, ...)
    {
    	if(g_pFont == NULL) { return; }
    
    	RECT FontPos = { x, y, x + 120, y + 16 };
    	char buf[1024] = {'\0'};
    	va_list va_alist;
    
    	va_start(va_alist, fmt);
    	vsprintf_s(buf, fmt, va_alist);
    	va_end(va_alist);
    
    	g_pFont->DrawText(NULL, (LPCWSTR)buf, -1, &FontPos, DT_NOCLIP, color);
    }
    For drawing text.

    Would be,
    Code:
    DrawString(Menu.x,Menu.y,D3DCOLOR_ARGB(255,255,255,255),g_pFont,Menu.title); //only reason its menu.x, menu.y, and menu.title, Is bc i declared them in a struct earlier. ;P


    Code:
    void DrawRect( int x, int y, int w, int h, D3DCOLOR color,LPDIRECT3DDEVICE9 pDevice)
    {
    	if(pDevice == NULL) { return; }
    
    	D3DRECT BarRect = { x, y, x + w, y + h }; 
    	pDevice->Clear(1, &BarRect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, color, 0,  0); 
    }
    For drawing a rectangle.

    Code:
    DrawRect(Menu.x - 5,Menu.y - 5,180,270,D3DCOLOR_ARGB(200,216,216,216),pDevice);
    Some D3DColors:
    Code:
    GenerateTexture(Device_Interface, &texGreen , D3DCOLOR_ARGB(255,0,255,0));
    GenerateTexture(Device_Interface, &texRed , D3DCOLOR_ARGB(255,255,0,0));
    GenerateTexture(Device_Interface, &texBlue , D3DCOLOR_ARGB(255,0,0,255));
    GenerateTexture(Device_Interface, &texOrange , D3DCOLOR_ARGB(255,255,165,0));
    GenerateTexture(Device_Interface, &texYellow , D3DCOLOR_ARGB(255,255,255,0));
    GenerateTexture(Device_Interface, &texPink , D3DCOLOR_ARGB(255,255,192,203));
    GenerateTexture(Device_Interface, &texCyan , D3DCOLOR_ARGB(255,0,255,255));
    GenerateTexture(Device_Interface, &texPurple , D3DCOLOR_ARGB(255,160,32,240));
    GenerateTexture(Device_Interface, &texBlack , D3DCOLOR_ARGB(255,0,0,0));
    GenerateTexture(Device_Interface, &texWhite , D3DCOLOR_ARGB(255,255,255,255));
    GenerateTexture(Device_Interface, &texSteelBlue , D3DCOLOR_ARGB(255,33,104,140));
    GenerateTexture(Device_Interface, &texLightSteelBlue, D3DCOLOR_ARGB(255,201,255,255));
    GenerateTexture(Device_Interface, &texLightBlue , D3DCOLOR_ARGB(255,26,140,306));
    GenerateTexture(Device_Interface, &texSalmon , D3DCOLOR_ARGB(255,196,112,112));
    GenerateTexture(Device_Interface, &texBrown , D3DCOLOR_ARGB(255,168,99,20));
    GenerateTexture(Device_Interface, &texTeal , D3DCOLOR_ARGB(255,38,140,140));
    GenerateTexture(Device_Interface, &texLime , D3DCOLOR_ARGB(255,50,205,50));
    GenerateTexture(Device_Interface, &texElectricLime , D3DCOLOR_ARGB(255,204,255,0));
    GenerateTexture(Device_Interface, &texGold , D3DCOLOR_ARGB(255,255, 215, 0));
    GenerateTexture(Device_Interface, &texOrangeRed , D3DCOLOR_ARGB(255,255,69,0));
    GenerateTexture(Device_Interface, &texGreenYellow , D3DCOLOR_ARGB(255,173,255,47));
    GenerateTexture(Device_Interface, &texAquaMarine , D3DCOLOR_ARGB(255,127,255,212));
    GenerateTexture(Device_Interface, &texSkyBlue , D3DCOLOR_ARGB(255,0,191,255));
    GenerateTexture(Device_Interface, &texSlateBlue , D3DCOLOR_ARGB(255,132, 112, 255));
    GenerateTexture(Device_Interface, &texCrimson , D3DCOLOR_ARGB(255,220,20,60));
    GenerateTexture(Device_Interface, &texDarkOliveGreen, D3DCOLOR_ARGB(255,188,238,104 ));
    GenerateTexture(Device_Interface, &texPaleGreen , D3DCOLOR_ARGB(255,154,255, 154));
    GenerateTexture(Device_Interface, &texDarkGoldenRod , D3DCOLOR_ARGB(255,255, 185, 15 ));
    GenerateTexture(Device_Interface, &texFireBrick , D3DCOLOR_ARGB(255,255,48,48));
    GenerateTexture(Device_Interface, &texDarkBlue , D3DCOLOR_ARGB(255,0,0,204));
    GenerateTexture(Device_Interface, &texDarkerBlue , D3DCOLOR_ARGB(255,0,0,153));
    GenerateTexture(Device_Interface, &texDarkYellow , D3DCOLOR_ARGB(255,255,204,0));
    GenerateTexture(Device_Interface, &texLightYellow , D3DCOLOR_ARGB(255,255,255,153));
    https://www.colorpicker.com/
    For more ARGB's. Hope I helped.

    EDIT:
    Beginning of the rendering menu:
    Code:
    void RenderMenu(LPDIRECT3DDEVICE9 pDevice, LPD3DXFONT g_pFont)
    {
    	if(pDevice == NULL || g_pFont == NULL) { return; }
    
    	if (GetAsyncKeyState(VK_INSERT)&1){ CH_Menu = !CH_Menu; }
    
    	if (CH_Menu)
    	{
    		// How Many Hacks //
    		SetHighlights(Menu.maxitems);
    Last edited by Calebb; 02-13-2010 at 09:23 PM.

  8. The Following User Says Thank You to Calebb For This Useful Post:

    why06 (02-13-2010)

  9. #6
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Hey Thanks for the colors. That should help out a lot

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  10. #7
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    I think the hard part is form a working method to handle the selected menu item. Also, the on and off control.

    Other than that, the rest is fairly simple.

  11. #8
    Calebb's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    212
    Reputation
    12
    Thanks
    75
    Code:
    //for setting highlights
    void SetHighlights(int menusize)
    {
    	if(GetAsyncKeyState(VK_UP)&1)
    	{
    		for(int i=0; i < menusize+1; i++)
    		{
    			if (highlight[i] == 1)
    			{
    				int a = i-1;
    
    				if(a < 0)
    					break;
    
    				else
    				{
    					highlight[a]=1;
    					highlight[i]=0;
    					break;
    				}
    			}
    		}
    	}
    
    	if(GetAsyncKeyState(VK_DOWN)&1)
    	{
    		for(int i=0; i < menusize+2; i++)
    		{
    			if (highlight[i] == 1)
    			{
    				int a = i+1;
    
    				if(a > menusize)
    					break;
    
    				else
    				{
    					highlight[a]=1;
    					highlight[i]=0;
    					break;
    				}
    			}
    		}
    	}
    }

  12. #9
    falzarex's Avatar
    Join Date
    Apr 2008
    Gender
    male
    Location
    here
    Posts
    417
    Reputation
    14
    Thanks
    145
    Hey all I'm back after a long time being away

    anyway Hans211's menu is a good example of a proper functional menu
    I assume u know what it does but just an example
    in endscene, the class is instantiated in which your menus are drawn and switch states are reset
    inside the menu sources u can easily change or add new colors and functions to it provided u know where to look

    a simpler way would just be to use coordinates to place your test and options but I know u would want to make a smexy looking menu
    good luck why06 on your menu
    Quote Originally Posted by falzarex aka myself
    GTFO FUCKER U DONT BELONG IN THE INTERNETZ WORLD COZ ITS MINE


    This is an epic fail resume
    Hello VBfags.
    A 'member' of the almighty C++ section will soon join you, he is 13 year old, has the IQ and typing skills of a VBfag, so I thought he would fit in here nicely.

    A few reasons why he should be in this section instead of the C++ section:
    1) He has the IQ of a VBfag.
    2) He has no sense of grammer/spelling at all.
    3) He thinks he is pro(like most of the people in here)
    4) He thinks copy pasting is fun(exactly what you guys do)
    5) He loves it up the ass(he will keep you VBfags nice and warm)

  13. #10
    radnomguywfq3's Avatar
    Join Date
    Jan 2007
    Gender
    male
    Location
    J:\E\T\A\M\A\Y.exe
    Posts
    8,858
    Reputation
    381
    Thanks
    1,823
    My Mood
    Sad
    Design each component speratly, I.e make a control class, buttons should inherit control class, and windows should inherit a panel class which inherit a control class.

    Sorry for the crappy reply, just trying to boost post count.

  14. The Following User Says Thank You to radnomguywfq3 For This Useful Post:

    Hell_Demon (02-15-2010)

  15. #11
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by falzarex View Post
    Hey all I'm back after a long time being away

    anyway Hans211's menu is a good example of a proper functional menu
    I assume u know what it does but just an example
    in endscene, the class is instantiated in which your menus are drawn and switch states are reset
    inside the menu sources u can easily change or add new colors and functions to it provided u know where to look

    a simpler way would just be to use coordinates to place your test and options but I know u would want to make a smexy looking menu
    good luck why06 on your menu
    Good to see you back falvarex!

    I am trying to get the Design of the submenu right now and working on acquiring the device pointer. Also David is helping too, in fact he's done more work then me on it, guess he's a little shy.

    I am looking at a bunch of other menu's now, which is taking a while since there's 0 documentation and hardly any comments in the code, The way it looks I might end up relying heavily on Azorbix's detour class at first, unless I could implement my own detour.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  16. #12
    falzarex's Avatar
    Join Date
    Apr 2008
    Gender
    male
    Location
    here
    Posts
    417
    Reputation
    14
    Thanks
    145
    Just asking but what kind of menu do u plan on making?
    pure keyboard menu with off,on options and folders?
    Or mouse menus with checkboxes and stuff
    just an idea but it would be cool to implement a slider control fully drawn in the menu

    actually poking around with the menu codes and trying each of them out with your own hook can allow you to understand how it works better and it's internal functions and stuff

    anyway i would like to see the endproduct and it's versatility in the sense that more custom controls could be easily implemented
    Quote Originally Posted by falzarex aka myself
    GTFO FUCKER U DONT BELONG IN THE INTERNETZ WORLD COZ ITS MINE


    This is an epic fail resume
    Hello VBfags.
    A 'member' of the almighty C++ section will soon join you, he is 13 year old, has the IQ and typing skills of a VBfag, so I thought he would fit in here nicely.

    A few reasons why he should be in this section instead of the C++ section:
    1) He has the IQ of a VBfag.
    2) He has no sense of grammer/spelling at all.
    3) He thinks he is pro(like most of the people in here)
    4) He thinks copy pasting is fun(exactly what you guys do)
    5) He loves it up the ass(he will keep you VBfags nice and warm)

  17. #13
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Right now it will be a text base menu navigatable by the keyboard. I always liked those better anyhow. However there are menus like this already, so the real point is to understand the design of my menu very well so that I can upgrade it to use pictures, boxes and other things. And be able to use it on a variety of games. Basically Im trying to develop a D3DMenu that I can build on and use throughout my hacking career. Right now I just need it to make pubs, but the reason IM creating this instead of using someone else's is that when I need to create a VIP hack or so forth, I will have a good solid understanding to work with for more advanced menu designs. So its a long term project.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  18. #14
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    x, 1, x
    3, 2, 3
    x, 1, x

    Make every x a seperate picture. that way you can stretch 1,2,1(top to bottom) on the X axis for wider window(without raping proportions) and stretch 3,2,3 on the Y axis for a higher window.

    Thats how I used to do it.
    Ah we-a blaze the fyah, make it bun dem!

  19. #15
    falzarex's Avatar
    Join Date
    Apr 2008
    Gender
    male
    Location
    here
    Posts
    417
    Reputation
    14
    Thanks
    145
    @why06
    ahh text based menus was what I started off with first
    mine used to be the one where your selected option is highlighted and I placed my options via coordinates

    @HD
    drawing a canvas on screen?
    Quote Originally Posted by falzarex aka myself
    GTFO FUCKER U DONT BELONG IN THE INTERNETZ WORLD COZ ITS MINE


    This is an epic fail resume
    Hello VBfags.
    A 'member' of the almighty C++ section will soon join you, he is 13 year old, has the IQ and typing skills of a VBfag, so I thought he would fit in here nicely.

    A few reasons why he should be in this section instead of the C++ section:
    1) He has the IQ of a VBfag.
    2) He has no sense of grammer/spelling at all.
    3) He thinks he is pro(like most of the people in here)
    4) He thinks copy pasting is fun(exactly what you guys do)
    5) He loves it up the ass(he will keep you VBfags nice and warm)

Similar Threads

  1. Crossfire D3D Menu Hack Design
    By Ryuesi in forum Help & Requests
    Replies: 12
    Last Post: 09-11-2011, 11:20 PM
  2. [Release] New Menu-Design, Hack Release
    By p0wn4ge in forum WarRock - International Hacks
    Replies: 25
    Last Post: 10-20-2009, 09:24 AM
  3. [Preview] New Menu-Design, Please Vote!
    By p0wn4ge in forum WarRock - International Hacks
    Replies: 36
    Last Post: 10-17-2009, 11:37 AM
  4. My D3D menu closes :| ! Source attached
    By Jammy122333 in forum C++/C Programming
    Replies: 1
    Last Post: 06-15-2008, 01:38 PM
  5. [Help]D3D Menu
    By cothen12 in forum C++/C Programming
    Replies: 13
    Last Post: 01-18-2008, 04:28 PM