LPD3DXCONTEXT D3DXContext = NULL;......int PASCALWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ fError = fopen("Error.log", "w"); // Open file for logging errors. HRESULT hr; hr = D3DXInitialize(); if ( FAILED(hr) ) LogError(hr);// Set up and register the window class. WNDCLASS wc = {0}; wc.lpfnWndProc = (WNDPROC) WindowProc; wc.hInstance = hInstance; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH); wc.lpszClassName = NAME; RegisterClass(&wc);// Create the window. HWND hwnd; hwnd = CreateWindow(NAME, TITLE, WS_POPUP, 0, 0, 800, 600, (HWND) NULL, (HMENU) NULL, hInstance, NULL); SetCursor(false); // Hide the cursor. ShowWindow(hwnd, SW_SHOWNORMAL); // Display the window. UpdateWindow(hwnd);// Create the D3DX context hr = D3DXCreateContext(D3DX_DEFAULT, D3DX_CONTEXT_FULLSCREEN, hwnd, 800, 600, &D3DXContext); if ( FAILED(hr) ) LogError(hr);
What in the world is going on? I am still getting a DDERR_CANNOTATTACHSURFACE error and D3DXContext remains NULL after the call. I am linking with DDGUID.LIB, DDRAW.LIB, D3DIM.LIB, D3DXD.LIB, and DINPUT.LIB. I have all of the appropriate headers included. All of the SDK examples and all of the tutorials from the web work correctly. Why not this? BTW, I've tried linking with the retail version of the D3DX library also. It didn't work. I've also tried about evey possible combination of parameters with both D3DXCreateContext() and D3DXCreateContextEx() as well as many different CreateWindow() params, and I can't figure it out.
Edited by - Matthew02 on July 13, 2000 11:32:50 PM