Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 5370 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

Since the tutorials in the SDK don't implement the source rect and destination rect features of Present(), I'll elaborate a little further.

Specifying a source rectangle will tell D3D to only present that specific part of the rendered back buffer to the screen. Here is an example:
RECT sourceRectangle;
// Top left corner of rectangle is at (0,0)
sourceRectangle.left = 0;
sourceRectangle.top = 0;

// Bottom right corner of rectangle is at (200, 300)
sourceRectangle.right = 200;
sourceRectangle.bottom = 300;

d3dDevice->Present( sourceRectangle, NULL, NULL, NULL );
Hope this helps you out

Dustin Franklin
Mircrosoft DirectX MVP

[edited by - circlesoft on March 7, 2004 10:59:17 AM]

Share this post

Link to post
Share on other sites
Thank you. I now get the compile error.

error C2664: ''Present'' : cannot convert parameter 1 from ''struct tagRECT'' to ''const struct tagRECT *''

How would I fix that?

Share this post

Link to post
Share on other sites
It would be advisable for you to have a firm grasp on C++ before you really get into DirectX. DirectX is tough enough as it is, so you really should be proficient with C++ first.

Some decent looking C++ intro sites (from a quick search on google):
Very Good

To answer your question flat-out, you''re getting that error because Present() wants sourceRectangle as a pointer. Change it to:
d3dDevice->Present( &sourceRectangle, NULL, NULL, NULL );

Share this post

Link to post
Share on other sites

  • 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!