Click to See Complete Forum and Search --> : Trouble with surface creation
Alex_ManOwaR
November 26th, 2003, 10:02 AM
Hello to all!
Please help me and excuse me for silly question, but I'm in panic!
If somebody know how to create DirectDraw surface in windowed mode?
Then I set second parameter of SetCooperativeLevel to DDSCL_NORMAL, IDirectDraw method CreateSurface return DDERR_NOEXCLUSIVEMODE. I'm understand why, but my application must work in windowed mode, without blinking.
Please help me if you can.
With best regards,
Alex ManOwaR
Marc G
November 26th, 2003, 11:52 AM
I don't know immediatly a solution, but perhaps you could post this question at www.flipcode.com. There are a lot of people using DirectX and OpenGL.
galathaea
December 2nd, 2003, 12:02 PM
It sounds like you are trying to use DDSCL_EXCLUSIVE as a flag (you can't unless you want to go full screen -- and its not useful until you want to do things like setting the display mode of your drivers / hardware). However, its very difficult to answer these type of questions without some example code of where you are experiencing the error (just the full SetCooperativeLevel call would be a good start), because it is often much easier to fix a problem than write a program.
However, if all that you are asking for is how to associate a DirectDraw object with a window, then it looks like you are pretty much already there, and there really isn't much to demonstrate
HRESULT creationMessage = ::DirectDrawCreateEx(
NULL, // or other, if you do not desire default display driver
reinterpret_cast<void * *>(&yourDirectDrawInterfacePointer),
IID_IDirectDrawX, // X = version# (ie. 3, 7)
NULL // unless there are any internals here);
// interpret and respond to whatever the creation message is
HRESULT attachMessage = yourDirectDrawInterfacePointer->
SetCooperativeLevel(windowToAttachTo,
DDSCL_NORMAL);
// interpret and respond to whatever the attach message is
// then go about making your primary surface
// and maybe set up some clipping regions
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.