Skip to main content
gamedev.net
🔒 Locked

Window Mode problems

Started by sakky Jul 19, 2002 at 10:06 PM 5 replies 350+ views
Original Post
sakky
sakky
How do I get a Window-Mode with MFC and DirectX? The primary surface keeps eating up the whole damn window. I''m using a clipper here, should I use....
  
RECT lpClntRc; // Client RECT that DX should take over

CMainFrame *cMF = new CMainFrame(); // Derived from CFrameWnd

cMF-> Create(NULL,"Title-Bar",WS_TILTED|WS_SYSMENU,CRect(0,0,300,300));

m_pMainWnd = cMF;
cMF->ShowWindow(SW_SHOW);
cMF->UpdateWindow();

// and so on with MFC and DX set up


lpDD->SetCooperativeLevel(cMF->GetSafeHwnd(),DDSCL_NORMAL);

// ok every thang work until I try to Clear the primary surface


  
I have a clipper ready, should i use the GetClientArea to set the RECT for the Clipper? That should work right? Well how do I do this?
Take back the internet with the most awsome browser around, FireFox
sakky
sakky
Yes I remember something lke that in the DX samples with the clipper. Can you tell me why you would release the clipper? I''v been going through out the whole program keeping it attached. Is this a bad thang or waste of space? I would think it would take more time to create a clipper and release it every time you needed it. Or do you only have to reinit the clipper or somthing? I don''t understand about the clipper. But it did keep the surface in the right area. But I''m not realeasing it after I''v set every thang up and stuff.
Take back the internet with the most awsome browser around, FireFox
Evil Bill
Evil Bill
If you do GetClipper() or whatever, the reference count increases.
AFAIK, you have to do SetClipper(...,NULL) to clear and release the current clipper from the surface, then you can Release() it.

HTH, Steve

Steve
DirectX Programmer
Soon to be the new Bill Gates
Member of the Unban Mindwipe Society (UMWS)
sakky
sakky
Ok, I think I got that owkring well enough. I only had a few questions about the clipper. Now on to better thangs.

How do I get the popups to show when DirectX has token over? Iwould like to see a code sample of that because I use to have one from the SDK files. I think the function was called InitFail?? or something.
Take back the internet with the most awsome browser around, FireFox

Topic Locked

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

Sign in to reply to this topic.