Home > error with > error with lpdd - createsurface

Error With Lpdd - Createsurface

Programming Boards Game Programming Problem with CreateSurface function (DirectDraw) Getting started with C or C++ | C Tutorial | C++ Tutorial | C and C++ FAQ | Get a compiler | Fixes for common problems Thread: Problem with CreateSurface function (DirectDraw) Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 01-05-2006 #1 SkyRaign View Profile View Forum Posts Registered User Join Date Sep 2005 Posts 41 Problem with CreateSurface function (DirectDraw) Code: LPDIRECTDRAW7 lpdd; DirectDrawCreateEx(NULL,(void**)&lpdd,IID_IDirectDraw7,NULL); lpdd->SetCooperativeLevel(hHandle,DDSCL_NORMAL); if((lpdd->SetDisplayMode(1024,768,16,0,0))!=DD_OK) { return(0); } //directDraw surface description struct DDSURFACEDESC2 ddsd; //directDraw interface pointer LPDIRECTDRAWSURFACE7 lpddsprimary; ddsd.dwSize=sizeof(ddsd); ddsd.dwFlags=DDSD_CAPS; ddsd.ddsCaps.dwCaps=DDSCAPS_PRIMARYSURFACE; if(lpdd->CreateSurface(&ddsd,&lpddsprimary,NULL)!=DDERR_INVALIDCAPS) { ShowWindow(hHandle,SW_MINIMIZE); } I've changed out the error flags until I found the one that the CreateSurface function returned. I cannot figure out why this is happening and I have no idea how to fix it. Any help? 01-05-2006 #2 VirtualAce View Profile View Forum Posts Super Moderator Join Date Aug 2001 Posts 9,608 DirectDraw is dead. Face it. Use D3D. 01-06-2006 #3 MrWizard View Profile View Forum Posts Registered User Join Date Apr 2002 Posts 1,571 Since you usually want to have a back buffer in addition to the primary surface, you may consider something like this: Code: memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; ddsd.dwBackBufferCount = 1; "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your mos

Informationen durch Cookies auf und außerhalb von Facebook zu. Weitere Informationen zu unseren Cookies und dazu, wie du die Kontrolle darüber behältst, findest du hier: Cookie-Richtlinie.FacebookE-Mail-Adresse oder HandynummerPasswortKonto vergessen?RegistrierenUm auf http://cboard.cprogramming.com/game-programming/74188-problem-createsurface-function-directdraw.html Facebook mehr von Priston Tale Brasil zu sehen, melde dich an oder erstelle ein Konto.RegistrierenAnmeldenUm auf Facebook mehr von Priston Tale Brasil zu sehen, melde dich an oder erstelle ein Konto.RegistrierenAnmeldenJetzt https://www.facebook.com/pristonoficial/posts/511937855491609 nicht   DeutschEnglish (US)TürkçePolskiItalianoRomânăFrançais (France)РусскийالعربيةEspañolPortuguês (Brasil)RegistrierenAnmeldenMessengerFacebook LiteHandyFreunde findenBannerNutzerSeitenOrteSpieleStandorteStarsGruppenMomentsÜber unsWerbeanzeige erstellenSeite erstellenEntwicklerKarriereDatenschutzCookiesDatenschutzinfoNutzungsbedingungenHilfeEinstellungenAktivitätenprotokoll Facebook © 2016