Archived

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

genjuro_lyb

CreateSurface error!

Recommended Posts

-------------------------------------------------------------- #define FULLSCREEN_DEBUG ... ... #ifdef FULLSCREEN_DEBUG hRet = g_pDD->SetCooperativeLevel(hWnd, DDSCL_NORMAL) ; if (hRet != DD_OK) return InitFail(hWnd, hRet, "SetCooperativeLevel FAILED"); #else //FULLSCREEN_DEBUG hRet = g_pDD->SetCooperativeLevel(hWnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); if (hRet != DD_OK) return InitFail(hWnd, hRet, "SetCooperativeLevel FAILED"); // Set the video mode to 640x480x8 hRet = g_pDD->SetDisplayMode(800, 600, 8, 0, 0); if (hRet != DD_OK) return InitFail(hWnd, hRet, "SetDisplayMode FAILED"); #endif //FULLSCREEN_DEBUG // Create the primary surface with 1 back buffer ZeroMemory(&ddsd, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; ddsd.dwBackBufferCount = 1; hRet = g_pDD->CreateSurface(&ddsd, &g_pDDSPrimary, NULL); if (hRet != DD_OK) return InitFail(hWnd, hRet, "CreateSurface FAILED"); --------------------------------------------------------------- CreateSurface return error : DDERR_NOEXCLUSIVEMODE /* * Operation requires the application to have exclusive mode but the * application does not have exclusive mode. */ how to createsurface in window mode?

Share this post


Link to post
Share on other sites