DirectDraw Clippers

Started by
10 comments, last by DarkEvilOne 19 years, 10 months ago
Yeah i know DirectDraw went out when DirectX8 came out and that people have started using Direct3D for 2D work. I''ve tried playing with Direct3D but all this stuff about matrices and camera/screen/world transformations etc just goes way over my head. So i''m going to stick to DirectDraw for now I''ll learn D3D eventually i just need to keep trying to understand it till it gets into my head.

Does anyone know what to do with the Buffer member of the windows RGNDATA struct? In the help file i''ve got it says this about it..

typedef struct _RGNDATA { // rgnd      RGNDATAHEADER rdh;     char          Buffer[1]; } RGNDATA;BufferSpecifies an arbitrary-size buffer that contains the RECT structures that make up the region.


Buffer is a single byte and i need to store 16 bytes there so i''m guessing i would need to allocate memory or something? And if i have to allocate memory then how do i go about doing that? Buffer can''t be assigned to the new memory location because it''s a constant pointer.

Damn the windows API can be evil.
Advertisement
Hmm, ok sorry ignore that last post

I just had an idea. I created a new struct like so:

struct MyRgn{	RGNDATAHEADER rdh;	RECT Buffer[1];};



It''s the same as the windows RGNDATA struct except i use a RECT where RGNDATA uses a char for the Buffer member. Then i simply cast it when i pass it to GetRegionData() and IDirectDrawClipper.SetClipList().

I run some tests to make sure all the functions i used were returning ok and i also tested the clipper by drawing a rectangle off the bottom and right edges of the backbuffer and drawing it to the screen and everything went fine.

Thanks anyway!

This topic is closed to new replies.

Advertisement