Jump to content
  • Advertisement
Sign in to follow this  
Robinhood

What's wrong with my code?

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

HRESULT hr; DDSURFACEDESC2 ddsd; ZeroMemory( &ddsd, sizeof(ddsd) ); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_CKSRCBLT | DDSD_ALPHABITDEPTH; ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; ddsd.ddsCaps.dwCaps2= DDSCAPS2_TEXTUREMANAGE; ddsd.dwWidth = bmp.bmWidth; ddsd.dwHeight = bmp.bmHeight; ddsd.dwAlphaBitDepth = 32; ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = RGB(255,0,255); ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = RGB(255,0,255); //pDD is LPDIRECTDRAW4;m_pdds is LPDIRECTDRAWSURFACE4 //Windowed Mode,1024x768x32 if( FAILED( hr = pDD->CreateSurface( pddsd, &m_pdds, NULL ) ) ) return hr; I hope someone will help.

Share this post


Link to post
Share on other sites
Advertisement
Give us a chance mate! What is the error? Check your hr value, stick it into the Error Lookup Tool under decimal and then post back with the error description.

Also, stop using DirectDraw! You can use Direct3D9 in orthogonal mode.

Kind regards.

Mark Coleman

Share this post


Link to post
Share on other sites
Thanks for the advice.The error is E_INVALIDARG and I don't know what is wrong.
The reason we still use DirectX7 lies in that the game need to show IME window in fullscreen mode and DirectX8/9 can't bring it out.I know MS has developed some GUI in directX9 Feb,but the fake IME window in SDK doesn't suit us at all.

Share this post


Link to post
Share on other sites
Quote:
Original post by Robinhood
the game need to show IME window in fullscreen mode and DirectX8/9 can't bring it out.


SetDialogBoxMode - This method allows the use of Microsoft Windows Graphics Device Interface (GDI) dialog boxes in full-screen mode applications.

Share this post


Link to post
Share on other sites
You seem to be filling in ddsd, but never passing it to CreateSurface
Edit: Oh, that's what Raymond_Porter420 said :P

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!