Jump to content
  • Advertisement
Sign in to follow this  
gav86

StretchRect(directX) not drawing all pixels?

This topic is 4838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well i'm sure its a simple numbers thing that I have overlooked... But I just cant 'see' it in the code.. I'm drawing 4 squares of 10*10 pixels, from a bitmap that is 40 pixels wide, 10 high. *edit* forgot to include the actual problem: the bottom line of pixels is not being drawn .. ie it only seems to be going down to the 9th pixel. here is the code..
for(int i = 0; i<4 ; i++)
{

	RECT source;
	RECT destination;

	source.top = 0;
	source.bottom = 10;
	source.left = i*10;	
	source.right = i*10 + 10;

	destination.top = 100;
	destination.bottom = 110;
	destination.left = i*10 + 10*i;
	destination.right = i*10 + 10*i + 10;

	hResult = pd3dDevice->StretchRect( squaresSurface,
   					 &source,
					 backbuffer,
					 &destination,
					 D3DTEXF_NONE );
}
As a starting point, does an image start counting at pixel 0 or 1?

Share this post


Link to post
Share on other sites
Advertisement
are you trying to draw a small image or a background?
if its a small image, try using the ID3DXSprite Interface
if you havent already, i used that for the smaller images and stretcrect for my backgrounds and menus

Share this post


Link to post
Share on other sites
Ah OK thanks, I hadn't looked into sprites yet but it's probably more suited to what I'm doing.

Basically I'm trying to set up the block/square drawing section of a tetris clone - although I am currently only in the design phase of it. . figuring out the structure of the program etc..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!