The source image is 1920x1200 px.
Here is my render funtion:
VOID Render()
{
// Clear the backbuffer and the zbuffer
g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
D3DCOLOR_XRGB( 0, 0, 255 ), 1.0f, 0 );
// Begin the scene
if( SUCCEEDED( g_pd3dDevice->BeginScene() ) )
{
g_pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER);
g_pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_BORDER);
g_pd3dDevice->SetSamplerState(0, D3DSAMP_BORDERCOLOR, 0x000000ff);
g_pd3dDevice->SetTexture( 0, g_pTexture );
// Render the vertex buffer contents
g_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof( CUSTOMVERTEX ) );
g_pd3dDevice->SetFVF( D3DFVF_CUSTOMVERTEX );
g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, 2);//2 * 50 - 2 );
// End the scene
g_pd3dDevice->EndScene();
}
// Present the backbuffer contents to the display
// shows in two windows
g_pd3dDevice->Present( NULL, NULL, NULL, NULL );
HWND hWnd = WindowFromDC(g_hDc);
RECT rc; rc.bottom = 600, rc.left = 100, rc.right = 600, rc.top = 100;
//RECT rc; rc.bottom = in->height, rc.left = 0, rc.right = in->width, rc.top = 0;
g_pd3dDevice->Present( NULL, &rc, hWnd, NULL );
}
What will be seen shows in the attach file
Why does the image the program displays look so blurred? How to set the texture to look better. The source image is 1920x1200 px !