Skip to main content
GameDev.net gamedev.net
🔒 Locked

Clear and Present

Started by Dov Sherman Jan 7, 2003 at 2:19 PM 2 replies 300+ views
Original Post
Dov Sherman
Dov Sherman
IDirect3DDevice8::Clear() and IDirect3DDevice8:resent() can each accept rectangles as parameters to limit their area of effect. What happens when they are passed rectangles which are partially or wholly off-screen?
Dov Sherman
Dov Sherman
quote:
Original post by Anonymous Poster
From the docs:

Present()
"If the rectangle exceeds the source surface, the rectangle is clipped to the source surface."
"If the rectangle exceeds the destination client area, the rectangle is clipped to the destination client area."

Clear()
"Coordinates are clipped to the bounds of the viewport rectangle."


Although that seems to be true for Clear(), experimenting with Present() has shown me that this is not an accurate description. Possibly, rectangles which are partially on and partially off will be clipped but if the rectangle is completely off, it seems to wind up presenting unexpected areas of the screen. It might be a video-card specific bug.

In any case, I''m preceding my rectangle-based calls to Present() with a check to make sure the rectangle is within the viewport bounds, clip it if it straddles or skip the Present() call if it''s completely outside.

Topic Locked

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

Sign in to reply to this topic.