I study DirectX using the book "DirectX and C ++. The Art of Programming" by Flenov ME I am writing on Visual Studio 2015. So, when I try to initialize, the compiler curses FAILED. Error: Flags: undeclared identifier.

Function source code:

HRESULT DX3DInit(IDirect3D9** ppiD3D9, IDirect3DDevice9** ppiD3DDevice9, HWND hWnd, DWORD iWidth, DWORD iHeight, BOOL bFullScreen) { if ((*ppiD3D9 = Direct3DCreate9(D3D_SDK_VERSION)) == NULL) return E_FAIL; D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.BackBufferWidth = iWidth; d3dpp.BackBufferHeight = iHeight; int iRes; if (!bFullScreen) iRes = MessageBox(hWnd, "Use fullscreen mode?", "Screen", MB_YESNO | MB_ICONQUESTION); else iRes = IDYES; if (iRes == IDYES) { d3dpp.BackBufferFormat = D3DFMT_R5G6B5; d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP; d3dpp.Windowed = FALSE; d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; } else { RECT wndRect; RECT clientRect; GetWindowRect(hWnd, &wndRect); GetWindowRect(hWnd, &clientRect); int iWinWidth = iWidth + (wndRect.right - wndRect.left) - (clientRect.right - clientRect.left); int iWinHeight = iHeight + (wndRect.bottom - wndRect.top) - (clientRect.bottom - clientRect.top); MoveWindow(hWnd, wndRect.left, wndRect.top, iWinWidth, iWinHeight, TRUE); D3DDISPLAYMODE d3ddm; (*ppiD3D9)->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm); d3dpp.BackBufferFormat = d3ddm.Format; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.Windowed = TRUE; } DWORD Falgs = D3DCREATE_MIXED_VERTEXPROCESSING | D3DCREATE_MULTITHREADED; HRESULT hRes; if (FAILED(hRes = (*ppiD3D9)->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, Flags, &d3dpp, ppiD3DDevice9))) return hRes; float Aspect = (float)d3dpp.BackBufferWidth / (float) d3dpp.BackBufferHeight; D3DXMATRIX matProjection; D3DXMatrixPerspectiveFovLH(&matProjection, D3DX_PI / 4.0f, Aspect, 10.0f, 1000.0f); (*ppiD3DDevice9)->SetTransform(D3DTS_PROJECTION, &matProjection); return S_OK; } 

Closed due to the fact that off-topic participants are Harry , AK , Denis Bubnov , aleksandr barakin , Cerbo 6 Feb '17 at 14:43 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Harry, AK, Denis Bubnov, aleksandr barakin, Cerbo
If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Well, because you have declared the variable "Falgs" and not "Flags"

    • Thank you, did not notice - Andrew Rogachuk