Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

cplusplus_cpp

Error, can not get AttachedSurface

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

LPDIRECTDRAW7 lpDD=0; LPDIRECTDRAWSURFACE7 lpDDSPrimary=0; LPDIRECTDRAWSURFACE7 lpDDSBack=0; LPDIRECTDRAWSURFACE7 bit; case WM_CREATE: DDSURFACEDESC2 ddsd; DDSCAPS2 ddscaps; if(FAILED(DirectDrawCreateEx(0,(LPVOID*)&lpDD,IID_IDirectDraw7,0))) MessageBox(hwnd,"DirectDrawCreateEx","Failed",MB_OK); if(FAILED(lpDD->SetCooperativeLevel(hwnd,DDSCL_FULLSCREEN|DDSCL_EXCLUSIVE|DDSCL_ALLOWREBOOT))) MessageBox(hwnd,"CooperativeLevel","FAiled",MB_OK); if(FAILED(lpDD->SetDisplayMode(800,600,16,0,0))) MessageBox(hwnd,"DisplaySettings","Failed",MB_OK); ZeroMemory(&ddsd,sizeof(ddsd)); ddsd.dwSize=sizeof(ddsd); ddsd.dwFlags=DDSD_CAPS|DDSD_BACKBUFFERCOUNT; ddsd.ddsCaps.dwCaps=DDSCAPS_FLIP|DDSCAPS_COMPLEX|DDSCAPS_PRIMARYSURFACE; ddsd.dwBackBufferCount=1; if(FAILED(lpDD->CreateSurface(&ddsd,&lpDDSPrimary,0))) MessageBox(hwnd,"CreateSurface primary","error",MB_OK); ddscaps.dwCaps=DDSCAPS_BACKBUFFER; //Does no difference if(FAILED(lpDDSPrimary->GetAttachedSurface(&ddscaps,&lpDDSBack))) MessageBox(hwnd,"GetAttachedSurface","error",MB_OK); ZeroMemory(&ddsd,sizeof(ddsd)); ddsd.dwSize=sizeof(ddsd); ddsd.dwFlags=DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH; ddsd.ddsCaps.dwCaps=DDSCAPS_OFFSCREENPLAIN; ddsd.dwHeight=100; ddsd.dwWidth=100; if(FAILED(lpDD->CreateSurface(&ddsd,&bit,0))) MessageBox(hwnd,"Error, Load Bitmap Surface","Error",MB_OK); bit=DDLoadBitmap(lpDD,"a.bmp",0,0); // When The window is created, I get the message "Error, Could not get attached surface" This is my own code.. What is wrong? It´s just like the tutorials :S

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!