findDirectX11.lua 753 B

123456789101112131415161718192021222324252627282930313233343536
  1. function findDirectX11()
  2. local dx11path = os.getenv("DXSDK_DIR")
  3. if (dx11path) then
  4. local filepath = string.format("%s%s",dx11path,"Include/D3D11.h")
  5. headerdx11 = io.open(filepath, "r")
  6. if (headerdx11) then
  7. printf("Found DX11: '%s'", filepath)
  8. return true
  9. end
  10. end
  11. return false
  12. end
  13. function initDirectX11()
  14. configuration {}
  15. local dx11path = os.getenv("DXSDK_DIR")
  16. defines { "ADL_ENABLE_DX11"}
  17. includedirs {"$(DXSDK_DIR)/include"}
  18. configuration "x32"
  19. libdirs {"$(DXSDK_DIR)/Lib/x86"}
  20. configuration "x64"
  21. libdirs {"$(DXSDK_DIR)/Lib/x64"}
  22. configuration {}
  23. links {"d3dcompiler",
  24. "dxerr",
  25. "dxguid",
  26. "d3dx9",
  27. "d3d9",
  28. "winmm",
  29. "comctl32",
  30. "d3dx11"
  31. }
  32. return true
  33. end