-xGhost- (01-24-2011),[MPGH]AVGN (01-22-2011),GodHack2 (01-19-2011),msulaimain (01-19-2011),Tony Stark` (01-27-2011),zatchbell3 (01-24-2011)
Draw Square Function
I promise u a Function that will have a little more effect to it instead of just Old dead boxes of color. even MPGH's GUI uses something like it. DrawSquare() is simple.
CREDIT : TOPBLAST!
[php]
void DrawSquare(
__in LPDIRECT3DDEVICE9 pDevice,
__in int x,
__in int y,
__in int w,
__in int h,
__in DWORD color1);
Parameters
pDevice [in]
LPDIRECT3DDEVICE9
Pointer to an IDirect3DDevice9 interface, the device to be associated with the drawing of the object.
X [in]
INT
Specifies the x-coordinate of the rectangle''s upper-left corner.
Y [in]
INT
Specifies the y-coordinate of the rectangle''s upper-left corner.
W (Weight) [in]
INT
The width of the Square in logical units.
H (Height) [in]
INT
The height of the Square in logical units.
Color1 [in]
DWORD
The General color of the Square.
[/php]
[php]
//-----------------------------------------------------------------------------
// Name: sVertex
// Desc: This is a structure a Point/Vertex.
//-----------------------------------------------------------------------------
struct sVertex
{
float x, y, z, ht;
DWORD color;
enum FVF
{
FVF_Flags = (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)
};
};
//-----------------------------------------------------------------------------
// Name: DrawSquare()
// Desc: Draws a Square with an EFFECT.
//-----------------------------------------------------------------------------
void DrawSquare(LPDIRECT3DDEVICE9 pDevice,
int x,
int y,
int w,
int h,
DWORD color1)
{
sVertex Veri[6] =
{
{(float)x ,(float)y , 0.0f, 0.0f, (color1-0x00888888)},
{(float)(x+w) ,(float)y , 0.0f, 0.0f, (color1-0x00888888)},
{(float)x ,(float)(y+(h/2)) , 0.0f, 0.0f, (color1)},
{(float)(x+w) ,(float)(y+(h/2)) , 0.0f, 0.0f, (color1)},
{(float)x ,(float)(y+h) , 0.0f, 0.0f, (color1+0x00555555)},
{(float)(x+w) ,(float)(y+h) , 0.0f, 0.0f, (color1+0x00555555)},
};
pDevice->SetTexture( 0, NULL );
pDevice->SetRenderState( D3DRS_LIGHTING, FALSE);
pDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW);
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
pDevice->SetRenderState( D3DRS_FOGENABLE, false );
pDevice->SetFVF( sVertex::FVF_Flags );
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,4,Veri,sizeof (sVertex));
}
[/php]
Last edited by topblast; 01-19-2011 at 02:27 PM.
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development
-xGhost- (01-24-2011),[MPGH]AVGN (01-22-2011),GodHack2 (01-19-2011),msulaimain (01-19-2011),Tony Stark` (01-27-2011),zatchbell3 (01-24-2011)
Looks nice?
No I do not make game hacks anymore, please stop asking.
Last edited by topblast; 01-19-2011 at 02:43 PM.
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development
More like a rectangle
Member since September 25, 2010
Current Objectives:
- Graduate college with a degree in Computer Science
- Find a decent job in the Computer Science Field
- Learn more programming languages
Looking for Elo Boosting Job - League of Legends
Looking for Bronze -> Gold Jobs
Skype: whatthedream
Member since September 25, 2010
Current Objectives:
- Graduate college with a degree in Computer Science
- Find a decent job in the Computer Science Field
- Learn more programming languages
Looking for Elo Boosting Job - League of Legends
Looking for Bronze -> Gold Jobs
Skype: whatthedream
looks like a french fry
I'm sorry to say but this doesn't match my menu base
No I do not make game hacks anymore, please stop asking.
it looks good, but ya, dont think it will match menus like flames said.
flameswor10 (01-19-2011)
I didnt see his menu base 0.0
Wait.. ahh fuck it. Ur base need GUI Editions everyone got the same blue.
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development