Jump to content
  • Advertisement

Archived

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

JSCFaith

Newbie Question: CreateClipper problem

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

Hey, Well whenever I call CreateClipper I get an INVALID_OBJECT error. Could someone tell me whats wrong, here is the code for the create clipper:
        

LPDIRECTDRAWCLIPPER   lpddclipper; // Clipper

LPRGNDATA             clipper; // Pointer to region data that contains header and clip list.




        ddrval = lpDD->CreateClipper(0, &lpddclipper, NULL); 
	switch(ddrval) {

	case DDERR_INVALIDOBJECT: 
		MessageBox(hwnd, "no dude 1", "", MB_OK);
		break;
	case DDERR_INVALIDPARAMS:  
		MessageBox(hwnd, "no dude 2", "", MB_OK);
		break;
	case DDERR_NOCOOPERATIVELEVELSET:
		MessageBox(hwnd, "no dude 3", "", MB_OK);
		break;
	case DDERR_OUTOFMEMORY:  
		MessageBox(hwnd, "no dude 4", "", MB_OK);
		break;
	}


	

	clipper = (LPRGNDATA)malloc(sizeof(RGNDATAHEADER)+1*sizeof(RECT));

	clipper->rdh.dwSize = sizeof(RGNDATAHEADER);
	clipper->rdh.iType = RDH_RECTANGLES;
	clipper->rdh.nCount = 1;
	clipper->rdh.nCount = 1 * sizeof(RECT);

	clipper->rdh.rcBound.top = 0;MessageBox(hwnd, "no dude 1", "", MB_OK);
	clipper->rdh.rcBound.left = 0;
	clipper->rdh.rcBound.right = 640;
	clipper->rdh.rcBound.bottom = 480;

	if(FAILED(lpddclipper->SetClipList(clipper, 0))) {

		MessageBox(hwnd, "no dude 2", "", MB_OK);
	}
	if(FAILED(lpDDSBack->SetClipper(lpddclipper))) {

		MessageBox(hwnd, "no dude 3", "", MB_OK);
	}

	free(clipper);

        
Well if someone could help me I would like that, Thanks. James, Later Edited by - JSCFaith on 7/16/00 12:58:49 PM

Share this post


Link to post
Share on other sites
Advertisement

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