Original Post
Hi all. Im using directx9 The screen resolution i am using is 1024x786. I wish to load the same size image from a file onto the screen as a background image (as the image is the same size as the screen it will be static). What I have done so far is to create a 2d rectangle using customvertex to hold the image like so and then render the rectangle to the screen. The problem is that the rectangle doenst fit the entire screen even though it is the same size as the screen. The width takes up the whole screen but the height doesnt. So i recoded the above structure like so this turns the rectangle into a square and does take up the whole screen. However since the image isnt a square (1024x768) the image is slightly stretched vertically. EDIT: Sorry my explanation seems really bad. I'll try again. The image I want to map to the screen is 1024x768 which is 4:3. The screen resolution is also 1024x768, 4:3. I created a 4:3 rectangle to map the image onto. The image is perfectly in proportion but strangely the 4:3 rectangle doesnt map perfectly onto the 4:3 screen resolution (when the width of the rectangle takes up all the width of the screen the height of the rectangle is smaller than the height of the screen). When i change the rectangle to a square (1:1) it does take up the entire screen but the 4:3 image is then being mapped onto a 1:1 squre which causes the image to stretch vertically. What technique do I use to successfully map the 4:3 background onto the 4:3 screen without it stretching? Thanks
[SOURCE]
struct CUSTOMVERTEX t_vert[] =
{
{512, 384,0, 0xffffffff, 0, 0,},
{-512, 384,0, 0xffffffff, 1, 0,},
{512, -384, 0, 0xffffffff, 0, 1,},
{-512,-384,0, 0xffffffff, 1, 1,},
};
[/SOURCE][SOURCE]
struct CUSTOMVERTEX t_vert[] =
{
{512, 512,0, 0xffffffff, 0, 0,},
{-512, 512,0, 0xffffffff, 1, 0,},
{512, -512, 0, 0xffffffff, 0, 1,},
{-512,-512,0, 0xffffffff, 1, 1,},
};
[/SOURCE]