Skip to main content
gamedev.net
🔒 Locked

directdraw

Started by Sinan Aug 24, 2005 at 7:54 AM 2 replies 650+ views
Original Post
Sinan
Sinan
I am trying to write a program (using VC++) about displaying image. I take them from camera and its driver card. I obtain image buffer (YUY2 format) and I want to display image by directdraw. But I couldn't. It gives error when 'Lock'function execute. Error message is "DDERR_INVALIDPARAMS". I looked msdn and I find that : If you attempt to create a wide surface in video memory when the DDCAPS2_WIDESURFACES flag isn't present, the attempt will fail and return DDERR_INVALIDPARAMS. Note that attempting to create extremely large surfaces might still fail, even if the driver exposes the DDCAPS2_WIDESURFACES flag. { m_OffScreen->Lock(rect, &ddsd,DDLOCK_EVENT|DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT, 0); } Could you help me ?
khognar
khognar
DDSURFACEDESC2 ddsdSrc;
ZeroMemory( &ddsdSrc,sizeof(ddsdSrc) );
ddsdSrc.dwSize = sizeof(ddsdSrc);

//if Mm_OffScreen is CDsiplay object use this
if(FAILED(Mm_OffScreen->m_pddsBackBuffer->Lock(NULL, &ddsdSrc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, NULL)))
{
//Errorhandling!
}


// if Mm_OffScreen is a CSurface object use this
if(FAILED(Mm_OffScreen->m_pdds->Lock(NULL, &ddsdSrc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, NULL)))
{
//Errorhandling!
}

i hope this will help!

p.m. : eğer başka bişey kullanıyosan.yada kafana takılan bişi varsa bunla ilgili msn'den konusalım.
Zedix
Zedix
Hi,
If you look at the SDK, you'll notice that the DDLOCK_EVENT parameter is not currently implemented. Try to remove that flag and try again.

Just a suggestion :)
Sinan
Sinan
I have already take the image :)(it is not clear but can be recognized the motion.
thanks,
sinan

Topic Locked

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

Sign in to reply to this topic.