Jump to content
  • Advertisement

Archived

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

WillTop

IDirectDraw7::SetDisplayMode return E_NOTIMPL?

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

My sourse codes: DWORD dwError; WNDCLASSEX wc; DDSURFACEDESC2 ddsd; //Set up Window class wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(hInstance, "LARGE"); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = GetStockBrush(BLACK_BRUSH); wc.lpszMenuName = NAME; wc.lpszClassName = TITLE; wc.cbSize = sizeof(WNDCLASSEX); wc.hIconSm = LoadIcon(hInstance, "SMALL"); //Register Window class if (!RegisterClassEx(&wc)) { MessageBox( hwnd, "Failed to register window class", TITLE, MB_OK); return InitFail(hwnd); } //Create a window hwnd = CreateWindowEx(WS_EX_TOPMOST, NAME, TITLE, WS_VISIBLE | WS_POPUP, 0, 0, SCREENWIDTH/*GetSystemMetrics(SM_CXSCREEN) / 2*/, SCREENHEIGHT/*GetSystemMetrics(SM_CYSCREEN)/2*/, NULL, NULL, hInstance, NULL); if(!hwnd) { MessageBox( hwnd, "Main window not created", TITLE, MB_OK); return InitFail(hwnd); } //Create DirectDraw object DirectDrawCreateEx(NULL, (void **)&DDObject, IID_IDirectDraw7, NULL ); if(Result != DD_OK) { MessageBox(hwnd, "The DirectDraw Object could not be created", TITLE, MB_OK); return InitFail(hwnd); } //Get exclusive mode Result = DDObject->SetCooperativeLevel( hwnd, DDSCL_NORMAL );// DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ); dwError = GetLastError(); if(Result != DD_OK) { MessageBox(hwnd, "Could not gain exclusive, fullscreen access", TITLE, MB_OK); return InitFail(hwnd); } //Set the video mode IDirectDraw7::SetDisplayMode Result = DDObject->SetDisplayMode(SCREENWIDTH, SCREENHEIGHT, CLRMODE, 0, 0); dwError = GetLastError(); char szTemp[256]; ::ZeroMemory( szTemp, sizeof( char ) * 256 ); sprintf( szTemp, "[Error]\tError Code£º%d\n", dwError ); OutputDebugString( szTemp ); // // Result = E_NOTIMPL and dwError = 0? why? // if(Result != DD_OK) { MessageBox(hwnd, "Set Display Mode failed", TITLE, MB_OK); return InitFail(hwnd); }

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!