Advertisement Jump to content
Sign in to follow this  

StretchRect(directX) not drawing all pixels?

This topic is 4898 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; = 0;
	source.bottom = 10;
	source.left = i*10;	
	source.right = i*10 + 10; = 100;
	destination.bottom = 110;
	destination.left = i*10 + 10*i;
	destination.right = i*10 + 10*i + 10;

	hResult = pd3dDevice->StretchRect( squaresSurface,
					 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
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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!