Jump to content
  • Advertisement

Archived

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

DarkEvilOne

DirectDraw Clippers

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

How do i setup the region data struct that is needed to set the clip list for a DirectDraw clipper? I want to setup a clipper to clip the whole of my backbuffer surface (in fullscreen mode) but i''m not sure how to setup the region data struct properly.

Share this post


Link to post
Share on other sites
Advertisement
Is it just me.. Or does noone here know anything about DirectDraw? I don''t think i''ve ever had a DirectDraw related question answered here. Why doesn''t anyone know about DirectDraw? Does anyone even know it exists?

Share this post


Link to post
Share on other sites
Get hold of Andre LaMothe''s first "tricks" book - he covers everything you could possibly need. Also hunt down "Sam''s Teach yourself DirectX 7 in 24 hours" by Robert Dunlop.

Share this post


Link to post
Share on other sites
AFAIK (I''ve not used DirectDraw for 5 years!), clipper objects are NOT supported in fullscreen mode!.

If your app is running in windowed mode, then the setup is roughly (from looking at my archive of game code I wrote back then):

// create clipper and assign it to our window
// with the size being the same as the window
DirectDrawCreateClipper( 0, &lpDDCClipper, NULL );
lpDDCClipper->SetHWnd( 0, hWndDevice );

// attach clipper to primary surface/swap chain
lpDDSPrimary->SetClipper( lpDDCClipper );




Simon O''Connor
Game Programmer &
Microsoft DirectX MVP

Share this post


Link to post
Share on other sites
Tricks of the windows game programming gurus? That book sounds pretty good, i''ll see if i can scrape some money together and buy a copy

In my program the mouse is used to move the center point of an object around the screen and when the screen is redrawn the object is drawn centered on that point.

If the edge of the object goes off the screen then my program locks up and turns nasty on me sometimes requiring me to use the reset button of my computer.

Someone suggested i use a clipper object and the SetClipList method to set a rectangle the size of the screen to be clipped and then i attach that to my backbuffer. My problem is i''m not sure exactly how to setup the RGNDATA struct which is required by the SetClipList method.

Thanks

Share this post


Link to post
Share on other sites
Re: S1CA.

Umm...I''m currently writing a game using DirectX 7( that had the last true interface of DirectDraw ) and its running in Full screen mode using clippers.

The only limitation with the clipper is that it only works with the "Blt" method but not the "BltFast" method.

We''ll let you off this time as its been 5 years for you!

Re: DarkEvilOne.

With that sorted out - use the Blt command if you want to use supported clippers. If you use BltFast - you have to write your own rectangle clipper.

Which isn''t too difficult if you think it out throughly first. Before you make your call to BltFast - you want a function you can call to take the blitting rectangle and do the appropriate adjustments...

Good luck!

Share this post


Link to post
Share on other sites
Yeah i know BltFast doesn''t support clippers.

I found a way around my problem. Instead of setting up the RGNDATA struct myself i''ve found out that theres some Windows API functions to do it for me. First i have to call CreateRectRgn() to create a HRGN object. Then i call GetRegionData() on that HRGN object to get the RGNDATA struct. I can''t try this out right now but it should work

Thanks

Share this post


Link to post
Share on other sites
quote:
Original post by Anri
Re: S1CA.

Umm...I''m currently writing a game using DirectX 7( that had the last true interface of DirectDraw ) and its running in Full screen mode using clippers.

The only limitation with the clipper is that it only works with the "Blt" method but not the "BltFast" method.

We''ll let you off this time as its been 5 years for you!



Oops, yep you''re quite right - I was looking through some old code of mine to jog my memory. It wasn''t setting the clipper in fullscreen cases but I now realise that it was for different reasons than lack of support.

Share this post


Link to post
Share on other sites
Re: DarkEvilOne.

Hmmm...sounds like a plan. even if it doesn''t work - you still have the makings of a good programmer. Check the docs for anything that might help...well done!

Re: S1CA.

Awww, geee! I''m sure you''ll pick me up on something as well - sooner or later...

Share this post


Link to post
Share on other sites
quote:
Original post by DarkEvilOne
Is it just me.. Or does noone here know anything about DirectDraw? I don''t think i''ve ever had a DirectDraw related question answered here. Why doesn''t anyone know about DirectDraw? Does anyone even know it exists?


Direct Draw isn''t really supported any more, you are supposed to use D3D in 2D mode. My game is using DirectDraw so I am in the same boat as you

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!