Jump to content
  • Advertisement
Sign in to follow this  
Sinan

directdraw

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

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 ?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
I have already take the image :)(it is not clear but can be recognized the motion.
thanks,
sinan

Share this post


Link to post
Share on other sites
Sign in to follow this  

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