Hello, I have small question.. I have game and.. I had there Square Minimap, but now I need Circle minimap. I tried something on internet, but when I used Filled Minimap, it have just color of minimap, and when I used normal rendering, it´s circle, but there is just one circle line, and in that circle isn´t anything, it´s empty. I´m using Device->SetTexture(0, pMINIMAP);
Working one : (square)
int nRng;int nPos; m_pTZOOMSCROLL->GetScrollPos(nRng, nPos);m_pTMAP->m_fTSCALE = TMINIMAP_INIT_SCALE / powf(TMINIMAP_SCALE_FACTOR, (FLOAT)nPos); CRect rect(0, 0,TMINIMAPTEX_SIZE,TMINIMAPTEX_SIZE); rect.OffsetRect(m_rc.left + m_rcAREA.left - (190 - m_rcAREA.Width()) / 0.85, m_rc.top + m_rcAREA.top - (190 - m_rcAREA.Height()) / 0.65); TNLVERTEX vRECT[4] = {{ FLOAT(rect.left), FLOAT(rect.top), 0.5f, 1.0f, 0xFFFFFFFF, 0.0f, 0.0f},{ FLOAT(rect.right), FLOAT(rect.top), 0.5f, 1.0f, 0xFFFFFFFF, 1.0f, 0.0f},{ FLOAT(rect.left), FLOAT(rect.bottom), 0.5f, 1.0f, 0xFFFFFFFF, 0.0f, 1.0f},{ FLOAT(rect.right), FLOAT(rect.bottom), 0.5f, 1.0f, 0xFFFFFFFF, 1.0f, 1.0f}};FLOAT fMIP = 0.0f; m_pDevice->m_pDevice->SetSamplerState( 0, D3DSAMP_MIPMAPLODBIAS, *((LPDWORD) &fMIP));m_pDevice->m_pDevice->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);m_pDevice->m_pDevice->SetTexture( 0, m_pTMINIMAP);m_pDevice->m_pDevice->SetFVF(T3DFVF_TNLVERTEX);m_pDevice->m_pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2, vRECT, sizeof(TNLVERTEX));
Not working one :
int nRng;int nPos; m_pTZOOMSCROLL->GetScrollPos(nRng, nPos);m_pTMAP->m_fTSCALE = TMINIMAP_INIT_SCALE / powf(TMINIMAP_SCALE_FACTOR, (FLOAT)nPos); CPoint rect(TMINIMAPTEX_SIZE); rect.Offset(m_rc.left + m_rcAREA.left - (190 - m_rcAREA.Width()) / 0.85, m_rc.top + m_rcAREA.top - (190 - m_rcAREA.Height()) / 0.65); const int NUMPOINTS = 30; TNLVERTEX Circle[NUMPOINTS + 1]; float WedgeAngle = ( float )( ( 2 * D3DX_PI ) / NUMPOINTS ); FLOAT fMIP = 0.0f; for( int i = 0; i m_pDevice->SetSamplerState( 0, D3DSAMP_MIPMAPLODBIAS, *((LPDWORD) &fMIP));m_pDevice->m_pDevice->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);m_pDevice->m_pDevice->SetTexture( 0, m_pTMINIMAP);m_pDevice->m_pDevice->SetFVF(D3DFVF_TL); m_pDevice->m_pDevice->DrawPrimitiveUP( D3DPT_LINESTRIP, NUMPOINTS, Circle, sizeof( TNLVERTEX ) );Thanks for any help!