Skip to main content
gamedev.net
🔒 Locked

Present

Started by Newbie00 Mar 7, 2004 at 12:26 AM 3 replies 750+ views
Original Post
Newbie00
Newbie00
Can someone show me an example of how to use the first parameter in IDirect3DDevice8:resent?
circlesoft
circlesoft
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]
Newbie00
Newbie00
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?
circlesoft
circlesoft
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):
Here
Here
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 );

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.