Results 1 to 4 of 4
  1. #1
    ademir1's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Location
    LPDIRECT3DSURFACE9
    Posts
    26
    Reputation
    10
    Thanks
    6
    My Mood
    Aggressive

    DrawBox and DrawCircleFull

    Here is my method DrawBox and DrawCircle.

    Code:
    #define D3DFVF_TEXTUREVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1)
    Code:
    struct TEXTUREVERTEX
    {
    	D3DXVECTOR3 vec;
    	FLOAT rhw;
    	DWORD color;
    	FLOAT u, v;
    };
    Code:
    void CriarVertex( TEXTUREVERTEX* pVertices, FLOAT x, FLOAT y, FLOAT u, FLOAT v, DWORD dwCor )
    {
    	pVertices->vec = D3DXVECTOR3( x - 0.5f, y - 0.5f, 0 );
    	pVertices->rhw   = 1.0f;
    	pVertices->u     = u;
    	pVertices->v     = v;
    	pVertices->color = dwCor;
    }
    Box:

    Code:
    void DesenharCaixa1(int x,int y,int w,int h, DWORD ColorStart,int UsarVertex1,LPDIRECT3DDEVICE9 m_pd3dDevice)
    {
    	RECT rect = { x, y, x + w, y + h };;
    
    	FLOAT Esquerda   = (FLOAT)rect.left;
    	FLOAT Cima    = (FLOAT)rect.top;
    	FLOAT Direita  = (FLOAT)rect.right;
    	FLOAT Baixo = (FLOAT)rect.bottom;
    
    	TEXTUREVERTEX vertex[ 4 ];
    	TEXTUREVERTEX* pVertices = vertex; 
    
    	CriarVertex( pVertices, Esquerda, Cima, rect.left, rect.left, ColorStart );
    	pVertices++;
    	CriarVertex( pVertices, Direita, Cima, rect.right, rect.right, ColorStart );
    	pVertices++;
    	CriarVertex( pVertices, Esquerda, Baixo, rect.bottom, rect.bottom, ColorStart );
    	pVertices++;
    	CriarVertex( pVertices, Direita, Baixo, rect.top+rect.right,rect.top+rect.right, ColorStart );
    	pVertices++;
    
    	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, 1 );
    	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, 1 );
    	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC );//qualidade
    	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_ANISOTROPIC );//qualidade	
    
    	m_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );	
    	m_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE,   TRUE );
    
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_SELECTARG1 );
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP,   D3DTOP_MODULATE );
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_TFACTOR  );
    
        m_pd3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
        m_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_CURRENT);
        m_pd3dDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
        m_pd3dDevice->SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
        m_pd3dDevice->SetTextureStageState(1, D3DTSS_ALPHAARG2, D3DTA_CURRENT);
    
    
        m_pd3dDevice->SetVertexShader( NULL );
    	m_pd3dDevice->SetTexture( 0, NULL );
    	m_pd3dDevice->SetTexture( 1, NULL );
    	m_pd3dDevice->SetFVF( D3DFVF_TEXTUREVERTEX );
    	m_pd3dDevice->DrawPrimitiveUP( D3DPT_TRIANGLESTRIP, 2, vertex, sizeof( TEXTUREVERTEX ) );
    	m_pd3dDevice->SetTexture( 0, NULL );
    	m_pd3dDevice->SetTexture( 1, NULL );
    }
    Circle:
    Code:
    BOOL DesenharCirculo(int x,int y,DWORD dwCor, float bTamanho, BOOL bNoCentro,LPDIRECT3DDEVICE9 m_pd3dDevice)
    {
    	POINT pt = {x,y};
    	if( bTamanho == 0.0f )
    		bTamanho = float(min(pt.x,pt.y)/2);
    	bTamanho *= 1.0f;
    
    	if( !bNoCentro )
    	{
    		pt.x += long(bTamanho);
    		pt.y += long(bTamanho);
    	}
    	TEXTUREVERTEX pVertex[366];
    	float x1 = float(pt.x);
    	float y1 = float(pt.y);
    	float u1 = 0.5f;
    	float v1 = 0.5f;
    
    	for( int i=0;i<=363; )
    	{
    		float angle = ( i / 57.3f );
    		float x2 = pt.x + ( bTamanho * sin( angle ) );
    		float y2 = pt.y + ( bTamanho * cos( angle ) );
    		float u2 = 0.5f + ( 0.5f * sin( angle ) );
    		float v2 = 0.5f + ( 0.5f * cos( angle ) );
    
    		CriarVertex( &pVertex[i++], float(pt.x), float(pt.y), 0.5f, 0.5f,dwCor );
    		CriarVertex( &pVertex[i++], x1, y1, u1, v1 ,dwCor);
    		CriarVertex( &pVertex[i++], x2, y2, u2, v2 ,dwCor);
    		y1 = y2;
    		x1 = x2;
    		u1 = u2;
    		v1 = v2;
    	}
    	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, 1 );
    	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, 1 );
    
     	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP );
    	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP );
    
    	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC );//qualidade
    	m_pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_ANISOTROPIC );//qualidade
    
    	m_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );	
    	m_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE,   TRUE );
    
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_SELECTARG1 );
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP,   D3DTOP_MODULATE );
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
    	m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_TFACTOR  );
    	m_pd3dDevice->SetVertexShader( NULL );
    
    	//m_pd3dDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_PASSTHRU  );//Rendertarget mascara alpha
        //IDirect3DSurface9 *pRenderTarget = NULL;
        //m_pd3dDevice->GetBackBuffer(0,1,D3DBACKBUFFER_TYPE_MONO,&pRenderTarget);
        //m_pd3dDevice->CreateDepthStencilSurface(800,600,D3DFMT_A8R8G8B8,D3DMULTISAMPLE_NONMASKABLE,NULL,true,&pRenderTarget,NULL);//
        //pRenderTarget->Release();
    	//m_pd3dDevice->SetRenderTarget(0,pRenderTarget);//
    	//////////////
        m_pd3dDevice->SetTexture( 0, NULL );
    	m_pd3dDevice->SetTexture( 1, NULL );
    	m_pd3dDevice->SetFVF( D3DFVF_TEXTUREVERTEX );
    	m_pd3dDevice->DrawPrimitiveUP( D3DPT_TRIANGLESTRIP, 363, pVertex, sizeof( TEXTUREVERTEX ) );
    	m_pd3dDevice->SetTexture( 0, NULL );
    	m_pd3dDevice->SetTexture( 1, NULL );
    
    	return TRUE;
    
    }

    The circle is complete, it is not only the edge, good for use in radar, or not! And it can be helpful to some..


    Credits : Ademir,DirectX(used as start), Jeff (struct).


    Last edited by ademir1; 06-10-2013 at 04:16 PM.
    Black Demon Uma nova Criação

    Sempre tem um noob para encher o saco!

  2. #2
    Skaterforeva1's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Up your ass
    Posts
    936
    Reputation
    32
    Thanks
    485
    My Mood
    Psychedelic
    And its not in English Oh-well Thanks!




    ^Suck it!

  3. #3
    matypatty's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Posts
    864
    Reputation
    229
    Thanks
    2,694
    My Mood
    Amused
    he uses internet explorer, would not trust/10

  4. The Following 5 Users Say Thank You to matypatty For This Useful Post:

    Genesis (06-17-2013),MatyPattyJr (06-13-2013),Saltine (06-13-2013),SinfulEXP (06-17-2013),Skaterforeva1 (06-13-2013)

  5. #4
    ademir1's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Location
    LPDIRECT3DSURFACE9
    Posts
    26
    Reputation
    10
    Thanks
    6
    My Mood
    Aggressive
    Quote Originally Posted by matypatty View Post
    he uses internet explorer, would not trust/10
    Not, i use Google Chrome!

    sorry for my bad english
    Black Demon Uma nova Criação

    Sempre tem um noob para encher o saco!

Similar Threads

  1. CS 1.6 VAC2 proof hacks AND cheat death hacks
    By Brunogol in forum General Game Hacking
    Replies: 28
    Last Post: 12-18-2006, 08:26 PM
  2. Get Avatars and Sigs!
    By Dave84311 in forum General
    Replies: 25
    Last Post: 05-17-2006, 08:44 PM
  3. Plz I Want Maple Global Hacks And Where Do I Get Game Engine 2 Make The Hacks Work???
    By mattinthehat in forum MapleStory Hacks, Cheats & Trainers
    Replies: 3
    Last Post: 01-15-2006, 06:12 PM
  4. Lineag2 and Ragnarok
    By suppaman in forum General Gaming
    Replies: 12
    Last Post: 01-01-2006, 04:07 PM
  5. i need short icq number pls and hack to wr..
    By BoneXDBreaker in forum WarRock - International Hacks
    Replies: 1
    Last Post: 12-26-2005, 05:08 PM