Archived

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

CreateSurface error!

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

-------------------------------------------------------------- #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