DrawSquare() Function [by Topblast]

Posts 4658 of 58 · Page 4 of 4
Hmm for the Solid Square, it would be much easier using FillRGB.

this way you can use same function for xhair as you would for square.

example:


Globals:
Code:
int CenterX = GetSystemMetrics( 0 ) / 2;//Gets screen X resolution then cutting it in half to get the center.
int CenterY = GetSystemMetrics( 1 ) / 2;//Gets screen Y resolution then cutting it in half to get the center.

Void:
Code:
void cBase::FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
{
	D3DRECT rec = { x, y, x + w, y + h };
	pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
}

Then for the xhair:
Code:
FillRGB(CenterX-15, CenterY, 30, 1,Red,pDevice);FillRGB(CenterX, CenterY-15, 1, 30,Red,pDevice);
Or for the Box (Left Side for Menu):
Code:
FillRGB(20, 200, 150, 400,Red,pDevice);
Quote Originally Posted by CAFlames View Post
Hmm for the Solid Square, it would be much easier using FillRGB.

this way you can use same function for xhair as you would for square.

example:


Globals:
Code:
int CenterX = GetSystemMetrics( 0 ) / 2;//Gets screen X resolution then cutting it in half to get the center.
int CenterY = GetSystemMetrics( 1 ) / 2;//Gets screen Y resolution then cutting it in half to get the center.

Void:
Code:
void cBase::FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
{
	D3DRECT rec = { x, y, x + w, y + h };
	pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
}

Then for the xhair:
Code:
FillRGB(CenterX-15, CenterY, 30, 1,Red,pDevice);FillRGB(CenterX, CenterY-15, 1, 30,Red,pDevice);
Or for the Box (Left Side for Menu):
Code:
FillRGB(20, 200, 150, 400,Red,pDevice);

My friend do u understand what Clear() Really does?

That will not do Transparency.
Quote Originally Posted by topblast View Post



My friend do u understand what Clear() Really does?

That will not do Transparency.
he said a solid square. He does not need transparency.
Quote Originally Posted by topblast View Post



My friend do u understand what Clear() Really does?

That will not do Transparency.
Where did I say it was transparent? if i wanted transparent I would add an alpha blend.... this is for a solid box / line anywhere on screen for a box, random line, or xhair.
Quote Originally Posted by CAFlames View Post


Where did I say it was transparent? if i wanted transparent I would add an alpha blend.... this is for a solid box / line anywhere on screen for a box, random line, or xhair.
Do u kno the real reason for Clear?

Both of you.
Quote Originally Posted by topblast View Post


Do u have to be so technical about things.
I wasn't being technical, but a clearly misleading post had been posted (by yourself).

Quote Originally Posted by topblast View Post


Do u kno the real reason for Clear?

Both of you.
I believe I know more than you. Bloody annoying me << That's just my honest belief right now, not being stuck up or anything.. which might change very soon

The IDIRECT3DDDEVICE::Clear() method clears a specified area of one or more surfaces to a specified color.
Quote Originally Posted by topblast View Post


Do u kno the real reason for Clear?

Both of you.
Honestly I used thatfillrgb method but i named some stuff different and never used the clear... but I saw on a thread about d3d xhairs that he used it so i just included it and used his. So no I dont.
Quote Originally Posted by freedompeace View Post
I wasn't being technical, but a clearly misleading post had been posted (by yourself).



I believe I know more than you. Bloody annoying me << That's just my honest belief right now, not being stuck up or anything.. which might change very soon

The IDIRECT3DDDEVICE::Clear() method clears a specified area of one or more surfaces to a specified color.
And in the cast of speed?
Quote Originally Posted by topblast View Post


And in the cast of speed?
cast or case of speed?

If it is case then Clear() is much faster than the publxly released FillRGB functions.
Quote Originally Posted by freedompeace View Post
cast or case of speed?

If it is case then Clear() is much faster than the publxly released FillRGB functions.
Vs DrawPrimitive
Quote Originally Posted by topblast View Post


Vs DrawPrimitive
Clear is faster, duh <<
Quote Originally Posted by freedompeace View Post
Clear is faster, duh <<
I give up trying to get things in your head.
Thanks for sharing this this will go great with my next hack
Posts 4658 of 58 · Page 4 of 4
This thread is closed for replies.

Tags for this Thread

None

Need help?